Name of global custom attributes are not managed by the inventory (#41786)

This commit is contained in:
smutel 2018-07-05 10:48:20 +02:00 committed by Abhijeet Kasurde
parent ed5a0f2d9c
commit f7dbf581b1

View file

@ -397,7 +397,7 @@ class VMWareInventory(object):
cfm = content.customFieldsManager cfm = content.customFieldsManager
if cfm is not None and cfm.field: if cfm is not None and cfm.field:
for f in cfm.field: for f in cfm.field:
if f.managedObjectType == vim.VirtualMachine: if not f.managedObjectType or f.managedObjectType == vim.VirtualMachine:
self.custom_fields[f.key] = f.name self.custom_fields[f.key] = f.name
self.debugl('%d custom fields collected' % len(self.custom_fields)) self.debugl('%d custom fields collected' % len(self.custom_fields))
except vmodl.RuntimeFault as exc: except vmodl.RuntimeFault as exc: