mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
Merge pull request #1506 from ansible/update_vmware_inventory
Updating vmware_inventory from upstream
This commit is contained in:
@@ -287,11 +287,23 @@ class VMWareInventory(object):
|
|||||||
self.debugl('lower keys is %s' % self.lowerkeys)
|
self.debugl('lower keys is %s' % self.lowerkeys)
|
||||||
self.skip_keys = list(config.get('vmware', 'skip_keys').split(','))
|
self.skip_keys = list(config.get('vmware', 'skip_keys').split(','))
|
||||||
self.debugl('skip keys is %s' % self.skip_keys)
|
self.debugl('skip keys is %s' % self.skip_keys)
|
||||||
self.host_filters = list(config.get('vmware', 'host_filters').split(','))
|
temp_host_filters = list(config.get('vmware', 'host_filters').split('}},'))
|
||||||
|
for host_filter in temp_host_filters:
|
||||||
|
host_filter = host_filter.rstrip()
|
||||||
|
if host_filter != "":
|
||||||
|
if not host_filter.endswith("}}"):
|
||||||
|
host_filter += "}}"
|
||||||
|
self.host_filters.append(host_filter)
|
||||||
self.debugl('host filters are %s' % self.host_filters)
|
self.debugl('host filters are %s' % self.host_filters)
|
||||||
self.groupby_patterns = list(config.get('vmware', 'groupby_patterns').split(','))
|
|
||||||
self.debugl('groupby patterns are %s' % self.groupby_patterns)
|
|
||||||
|
|
||||||
|
temp_groupby_patterns = list(config.get('vmware', 'groupby_patterns').split('}},'))
|
||||||
|
for groupby_pattern in temp_groupby_patterns:
|
||||||
|
groupby_pattern = groupby_pattern.rstrip()
|
||||||
|
if groupby_pattern != "":
|
||||||
|
if not groupby_pattern.endswith("}}"):
|
||||||
|
groupby_pattern += "}}"
|
||||||
|
self.groupby_patterns.append(groupby_pattern)
|
||||||
|
self.debugl('groupby patterns are %s' % self.groupby_patterns)
|
||||||
# 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
|
# virtulmachine 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.
|
||||||
@@ -491,7 +503,7 @@ class VMWareInventory(object):
|
|||||||
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:
|
||||||
try:
|
try:
|
||||||
newkey = self.config.get('vmware', 'custom_field_group_prefix') + field_name + '_' + kl
|
newkey = self.config.get('vmware', 'custom_field_group_prefix') + str(field_name) + '_' + kl
|
||||||
newkey = newkey.strip()
|
newkey = newkey.strip()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.debugl(e)
|
self.debugl(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user