mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
simplified DistributedVirtualSwitch
namespacing (#40191)
This commit is contained in:
parent
26ea64cdea
commit
3744b69a40
1 changed files with 1 additions and 6 deletions
|
@ -143,12 +143,7 @@ def find_datastore_by_name(content, datastore_name):
|
||||||
|
|
||||||
def find_dvs_by_name(content, switch_name):
|
def find_dvs_by_name(content, switch_name):
|
||||||
|
|
||||||
# https://github.com/vmware/govmomi/issues/879
|
vmware_distributed_switches = get_all_objs(content, [vim.DistributedVirtualSwitch])
|
||||||
# https://github.com/ansible/ansible/pull/31798#issuecomment-336936222
|
|
||||||
try:
|
|
||||||
vmware_distributed_switches = get_all_objs(content, [vim.dvs.VmwareDistributedVirtualSwitch])
|
|
||||||
except IndexError:
|
|
||||||
vmware_distributed_switches = get_all_objs(content, [vim.DistributedVirtualSwitch])
|
|
||||||
|
|
||||||
for dvs in vmware_distributed_switches:
|
for dvs in vmware_distributed_switches:
|
||||||
if dvs.name == switch_name:
|
if dvs.name == switch_name:
|
||||||
|
|
Loading…
Reference in a new issue