Enable source variables for Azure inventory

This commit is contained in:
Paul Neumann
2018-05-14 21:53:27 +02:00
committed by Bill Nottingham
parent 475a2bd9bb
commit 4b7f106e9f
4 changed files with 31 additions and 2 deletions

View File

@@ -1946,12 +1946,17 @@ class RunInventoryUpdate(BaseTask):
cp.set(section, 'group_by_resource_group', 'yes')
cp.set(section, 'group_by_location', 'yes')
cp.set(section, 'group_by_tag', 'yes')
if inventory_update.source_regions and 'all' not in inventory_update.source_regions:
cp.set(
section, 'locations',
','.join([x.strip() for x in inventory_update.source_regions.split(',')])
)
azure_rm_opts = dict(inventory_update.source_vars_dict.items())
for k,v in azure_rm_opts.items():
cp.set(section, k, six.text_type(v))
# Return INI content.
if cp.sections():
f = cStringIO.StringIO()