[PATCH] osmo-gsm-tester[master]: fix: None error on unavailable resources

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
Mon May 29 00:58:14 UTC 2017


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

fix: None error on unavailable resources

If not a single resource of a wanted item was left, we ran into a None. Report
unavailability instead.

Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
---
M src/osmo_gsm_tester/resource.py
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index b146ebd..8520612 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -299,7 +299,7 @@
             # here we have a resource of a given type, e.g. 'bts', with a list
             # containing as many BTSes as the caller wants to reserve/use. Each
             # list item contains specifics for the particular BTS.
-            my_list = self.get(key)
+            my_list = self.get(key, [])
 
             for_origin.log(log_label, len(want_list), 'x', key, '(candidates: %d)'%len(my_list))
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list