mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
check if existing network is VDS and has port attribute (#31322)
This commit is contained in:
parent
ce04f6e961
commit
0334b3fd99
1 changed files with 4 additions and 3 deletions
|
@ -768,9 +768,10 @@ class PyVmomiHelper(PyVmomi):
|
|||
# VDS switch
|
||||
pg_obj = find_obj(self.content, [vim.dvs.DistributedVirtualPortgroup], network_devices[key]['name'])
|
||||
|
||||
if (nic.device.backing and
|
||||
(nic.device.backing.port.portgroupKey != pg_obj.key or
|
||||
nic.device.backing.port.switchUuid != pg_obj.config.distributedVirtualSwitch.uuid)):
|
||||
if (nic.device.backing and not hasattr(nic.device.backing, 'port')):
|
||||
nic_change_detected = True
|
||||
elif (nic.device.backing and (nic.device.backing.port.portgroupKey != pg_obj.key or
|
||||
nic.device.backing.port.switchUuid != pg_obj.config.distributedVirtualSwitch.uuid)):
|
||||
nic_change_detected = True
|
||||
|
||||
dvs_port_connection = vim.dvs.PortConnection()
|
||||
|
|
Loading…
Reference in a new issue