This commit is contained in:
parent
fb61680ccd
commit
9387c75e29
1 changed files with 3 additions and 2 deletions
|
@ -1075,10 +1075,11 @@ class PyVmomiHelper(PyVmomi):
|
||||||
dvps = self.cache.get_all_objs(self.content, [vim.dvs.DistributedVirtualPortgroup])
|
dvps = self.cache.get_all_objs(self.content, [vim.dvs.DistributedVirtualPortgroup])
|
||||||
for dvp in dvps:
|
for dvp in dvps:
|
||||||
if hasattr(dvp.config.defaultPortConfig, 'vlan') and \
|
if hasattr(dvp.config.defaultPortConfig, 'vlan') and \
|
||||||
dvp.config.defaultPortConfig.vlan.vlanId == int(network['vlan']):
|
isinstance(dvp.config.defaultPortConfig.vlan.vlanId, int) and \
|
||||||
|
str(dvp.config.defaultPortConfig.vlan.vlanId) == network['vlan']:
|
||||||
network['name'] = dvp.config.name
|
network['name'] = dvp.config.name
|
||||||
break
|
break
|
||||||
if dvp.config.name == str(network['vlan']):
|
if dvp.config.name == network['vlan']:
|
||||||
network['name'] = dvp.config.name
|
network['name'] = dvp.config.name
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue