Skip to content

Commit

Permalink
return old code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuideGlyph committed Dec 23, 2024
1 parent d454f73 commit 9d1fc8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/modules/vmware_guest_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,17 @@ def _get_network_object(self, vm_obj):
if isinstance(network, vim.dvs.DistributedVirtualPortgroup):
dvs = network.config.distributedVirtualSwitch
if (switch_name and dvs.config.name == switch_name) or not switch_name:
if network.config.name == network_name:
return network
if hasattr(network.config.defaultPortConfig.vlan, 'vlanId') and \
network.config.defaultPortConfig.vlan.vlanId == vlan_id:
return network
if hasattr(network.config.defaultPortConfig.vlan, 'pvlanId') and \
network.config.defaultPortConfig.vlan.pvlanId == vlan_id:
return network
elif isinstance(network, vim.Network):
if network_name and network_name == network.name:
return network
if vlan_id:
for k in pg_lookup.keys():
if vlan_id == pg_lookup[k]['vlan_id']:
Expand Down

0 comments on commit 9d1fc8e

Please sign in to comment.