|
|
@ -99,6 +99,7 @@ class VMWareInventory(object):
|
|
|
|
host_filters = []
|
|
|
|
host_filters = []
|
|
|
|
skip_keys = []
|
|
|
|
skip_keys = []
|
|
|
|
groupby_patterns = []
|
|
|
|
groupby_patterns = []
|
|
|
|
|
|
|
|
groupby_custom_field_excludes = []
|
|
|
|
|
|
|
|
|
|
|
|
safe_types = [bool, str, float, None] + list(integer_types)
|
|
|
|
safe_types = [bool, str, float, None] + list(integer_types)
|
|
|
|
iter_types = [dict, list]
|
|
|
|
iter_types = [dict, list]
|
|
|
@ -230,6 +231,7 @@ class VMWareInventory(object):
|
|
|
|
'groupby_patterns': '{{ guest.guestid }},{{ "templates" if config.template else "guests"}}',
|
|
|
|
'groupby_patterns': '{{ guest.guestid }},{{ "templates" if config.template else "guests"}}',
|
|
|
|
'lower_var_keys': True,
|
|
|
|
'lower_var_keys': True,
|
|
|
|
'custom_field_group_prefix': 'vmware_tag_',
|
|
|
|
'custom_field_group_prefix': 'vmware_tag_',
|
|
|
|
|
|
|
|
'groupby_custom_field_excludes': '',
|
|
|
|
'groupby_custom_field': False}
|
|
|
|
'groupby_custom_field': False}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -304,8 +306,12 @@ class VMWareInventory(object):
|
|
|
|
groupby_pattern += "}}"
|
|
|
|
groupby_pattern += "}}"
|
|
|
|
self.groupby_patterns.append(groupby_pattern)
|
|
|
|
self.groupby_patterns.append(groupby_pattern)
|
|
|
|
self.debugl('groupby patterns are %s' % self.groupby_patterns)
|
|
|
|
self.debugl('groupby patterns are %s' % self.groupby_patterns)
|
|
|
|
|
|
|
|
temp_groupby_custom_field_excludes = config.get('vmware', 'groupby_custom_field_excludes')
|
|
|
|
|
|
|
|
self.groupby_custom_field_excludes = [x.strip('"') for x in [y.strip("'") for y in temp_groupby_custom_field_excludes.split(",")]]
|
|
|
|
|
|
|
|
self.debugl('groupby exclude strings are %s' % self.groupby_custom_field_excludes)
|
|
|
|
|
|
|
|
|
|
|
|
# Special feature to disable the brute force serialization of the
|
|
|
|
# Special feature to disable the brute force serialization of the
|
|
|
|
# virtulmachine objects. The key name for these properties does not
|
|
|
|
# virtual machine objects. The key name for these properties does not
|
|
|
|
# matter because the values are just items for a larger list.
|
|
|
|
# matter because the values are just items for a larger list.
|
|
|
|
if config.has_section('properties'):
|
|
|
|
if config.has_section('properties'):
|
|
|
|
self.guest_props = []
|
|
|
|
self.guest_props = []
|
|
|
@ -496,6 +502,8 @@ class VMWareInventory(object):
|
|
|
|
for tv in v['customvalue']:
|
|
|
|
for tv in v['customvalue']:
|
|
|
|
newkey = None
|
|
|
|
newkey = None
|
|
|
|
field_name = self.custom_fields[tv['key']] if tv['key'] in self.custom_fields else tv['key']
|
|
|
|
field_name = self.custom_fields[tv['key']] if tv['key'] in self.custom_fields else tv['key']
|
|
|
|
|
|
|
|
if field_name in self.groupby_custom_field_excludes:
|
|
|
|
|
|
|
|
continue
|
|
|
|
values = []
|
|
|
|
values = []
|
|
|
|
keylist = map(lambda x: x.strip(), tv['value'].split(','))
|
|
|
|
keylist = map(lambda x: x.strip(), tv['value'].split(','))
|
|
|
|
for kl in keylist:
|
|
|
|
for kl in keylist:
|
|
|
|