From 429abe2bd53147381f3be1d1eae37cef7f5894cc Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Sun, 22 Feb 2015 23:44:33 -0800 Subject: [PATCH] CLOUDSTACK-8276: Changes in Marvin to find free vlan in a setup when vlan is not returned for an existing network with listNetworks API Signed-off-by: SrikanteswaraRao Talluri --- tools/marvin/marvin/lib/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index c59cf10625c..de6f14676e7 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -977,9 +977,9 @@ def get_free_vlan(apiclient, zoneid): if isinstance(networks, list) and len(networks) > 0: usedVlanIds = [int(nw.vlan) - for nw in networks if nw.vlan != "untagged"] + for nw in networks if (nw.vlan and str(nw.vlan).lower() != "untagged")] - if hasattr(physical_network, "vlan") is False: + if not hasattr(physical_network, "vlan"): while True: shared_ntwk_vlan = random.randrange(1, 4095) if shared_ntwk_vlan in usedVlanIds: