summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/schema.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-12 15:13:21 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-12 17:06:54 +0200
commitf111ee775eba76d92ee9dde223a60c2ccd016f04 (patch)
tree5e4f60428c00c410e2ac5e2b7220925b8fd46bb6 /src/osmo_gsm_tester/schema.py
parent15aae98cf0ea9d73e7e8d75539ae3e909446a5db (diff)
resource: ipa_unit_id is expected to be a positive integer
Diffstat (limited to 'src/osmo_gsm_tester/schema.py')
-rw-r--r--src/osmo_gsm_tester/schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 2da80cd..b904960 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -66,8 +66,14 @@ def auth_algo(val):
return
raise ValueError('Unknown Authentication Algorithm: %r' % val)
+def uint(val):
+ n = int(val)
+ if n < 0:
+ raise ValueError('Positive value expected instead of %d' % n)
+
INT = 'int'
STR = 'str'
+UINT = 'uint'
BOOL_STR = 'bool_str'
BAND = 'band'
IPV4 = 'ipv4'
@@ -79,6 +85,7 @@ AUTH_ALGO = 'auth_algo'
SCHEMA_TYPES = {
INT: int,
STR: str,
+ UINT: uint,
BOOL_STR: str2bool,
BAND: band,
IPV4: ipv4,