Merge "Create entry for empty groups in inventory_rolemap"
This commit is contained in:
commit
4e526efb77
|
@ -49,7 +49,7 @@ def to_inventory_hostmap(data):
|
||||||
|
|
||||||
|
|
||||||
def to_inventory_rolemap(data):
|
def to_inventory_rolemap(data):
|
||||||
# Falttens inventory to a group->role mapping
|
# Flattens inventory to a group->role mapping
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
inventory = yaml.safe_load(data)
|
inventory = yaml.safe_load(data)
|
||||||
else:
|
else:
|
||||||
|
@ -65,6 +65,7 @@ def to_inventory_rolemap(data):
|
||||||
inventory[group]['vars']['tripleo_role_name']
|
inventory[group]['vars']['tripleo_role_name']
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
|
group_role_map[group] = []
|
||||||
if 'children' in inventory[group]:
|
if 'children' in inventory[group]:
|
||||||
for child in inventory[group]['children']:
|
for child in inventory[group]['children']:
|
||||||
# Children have not all been flattened yet
|
# Children have not all been flattened yet
|
||||||
|
@ -73,7 +74,6 @@ def to_inventory_rolemap(data):
|
||||||
todo.append(group)
|
todo.append(group)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
group_role_map[group] = []
|
|
||||||
for child in inventory[group]['children']:
|
for child in inventory[group]['children']:
|
||||||
group_role_map[group] += group_role_map[child]
|
group_role_map[group] += group_role_map[child]
|
||||||
group_role_map[group].sort()
|
group_role_map[group].sort()
|
||||||
|
|
Loading…
Reference in New Issue