From 73faa376ad87004014356477048e7298d06de792 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 26 Mar 2019 06:13:50 +0100 Subject: [PATCH] VMware: Add check for custom attribute type before removal (#53632) --- .../modules/cloud/vmware/vmware_guest_custom_attribute_defs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py b/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py index 41e60a7bacb..a8421bc03b7 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest_custom_attribute_defs.py @@ -97,7 +97,7 @@ class VmAttributeDefManager(PyVmomi): changed = False f = dict() for x in self.custom_field_mgr: - if x.name == field: + if x.name == field and x.managedObjectType == vim.VirtualMachine: changed = True if not self.module.check_mode: self.content.customFieldsManager.RemoveCustomFieldDef(key=x.key)