From 3744b69a40c6a66759ce5ede58ae9456c81ee3ba Mon Sep 17 00:00:00 2001 From: Deric Crago Date: Tue, 22 May 2018 06:08:31 -0400 Subject: [PATCH] simplified `DistributedVirtualSwitch` namespacing (#40191) --- lib/ansible/module_utils/vmware.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index 4af4599baa..6bd2073bc7 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -143,12 +143,7 @@ def find_datastore_by_name(content, datastore_name): def find_dvs_by_name(content, switch_name): - # https://github.com/vmware/govmomi/issues/879 - # 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]) + vmware_distributed_switches = get_all_objs(content, [vim.DistributedVirtualSwitch]) for dvs in vmware_distributed_switches: if dvs.name == switch_name: