diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index e984c5031d..f52b87e12e 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -1004,10 +1004,10 @@ class PyVmomiHelper(PyVmomi): dvps = self.cache.get_all_objs(self.content, [vim.dvs.DistributedVirtualPortgroup]) for dvp in dvps: if hasattr(dvp.config.defaultPortConfig, 'vlan') and \ - dvp.config.defaultPortConfig.vlan.vlanId == network['vlan']: + dvp.config.defaultPortConfig.vlan.vlanId == int(network['vlan']): network['name'] = dvp.config.name break - if dvp.config.name == network['vlan']: + if dvp.config.name == str(network['vlan']): network['name'] = dvp.config.name break else: