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 <talluri@apache.org>
This commit is contained in:
Gaurav Aradhye 2015-02-22 23:44:33 -08:00 committed by SrikanteswaraRao Talluri
parent e1827fc696
commit 429abe2bd5

View File

@ -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: