Skip to content
Snippets Groups Projects
Commit 5ece1033 authored by Chris Hines's avatar Chris Hines
Browse files

update a dict rather than overwriting it

parent 9c5073e0
No related branches found
No related tags found
1 merge request!288update a dict rather than overwriting it
......@@ -34,9 +34,11 @@ def gatherInfo(md_key,md_value,authDict,project_id,inventory):
if groupName not in inventory: inventory[groupName] = []
inventory[groupName].append(hostname)
# Add other metadata
if not hostname in inventory['_meta']['hostvars']:
inventory['_meta']['hostvars'][hostname] = {}
for md in server.metadata.items():
if md[0] not in (md_key,'ansible_host_groups'):
inventory['_meta']['hostvars'][hostname] = { md[0]:md[1] }
inventory['_meta']['hostvars'][hostname].update({ md[0]:md[1] })
if novaVolumes:
volDict = {}
for volume in novaVolumes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment