[MERGED] osmo-gsm-tester[master]: resource: ipa_unit_id is expected to be a positive integer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat Sep 16 19:51:36 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: resource: ipa_unit_id is expected to be a positive integer
......................................................................


resource: ipa_unit_id is expected to be a positive integer

Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
---
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/schema.py
2 files changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index da543f7..f8acb9e 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -51,7 +51,7 @@
         'ip_address[].addr': schema.IPV4,
         'bts[].label': schema.STR,
         'bts[].type': schema.STR,
-        'bts[].ipa_unit_id': schema.INT,
+        'bts[].ipa_unit_id': schema.UINT,
         'bts[].addr': schema.IPV4,
         'bts[].band': schema.BAND,
         'bts[].trx_remote_ip': schema.IPV4,
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 @@
         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 @@
 SCHEMA_TYPES = {
         INT: int,
         STR: str,
+        UINT: uint,
         BOOL_STR: str2bool,
         BAND: band,
         IPV4: ipv4,

-- 
To view, visit https://gerrit.osmocom.org/3916
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list