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

2017-09-16 Thread Neels Hofmeyr
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


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

2017-09-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


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

2017-09-12 Thread Pau Espin Pedrol

Review at  https://gerrit.osmocom.org/3916

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/3916/1

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: newchange
Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol