From 2a1a1fa8f93aa217b10f5f0a54c6f0f14f358767 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 29 May 2017 01:36:21 +0200 Subject: 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 --- src/osmo_gsm_tester/resource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ class Resources(dict): # 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)) -- cgit v1.2.3