1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

VMware: Add check for custom attribute type before removal (#53632)

This commit is contained in:
Fabian Becker 2019-03-26 06:13:50 +01:00 committed by Abhijeet Kasurde
parent ac07c6b5e6
commit 73faa376ad

View file

@ -97,7 +97,7 @@ class VmAttributeDefManager(PyVmomi):
changed = False changed = False
f = dict() f = dict()
for x in self.custom_field_mgr: for x in self.custom_field_mgr:
if x.name == field: if x.name == field and x.managedObjectType == vim.VirtualMachine:
changed = True changed = True
if not self.module.check_mode: if not self.module.check_mode:
self.content.customFieldsManager.RemoveCustomFieldDef(key=x.key) self.content.customFieldsManager.RemoveCustomFieldDef(key=x.key)