Prevent inventory-manger failing with arbitrary groups
In case an arbitrary record is added to openstack_user_config which ends with `_hosts` where metal setup is used, it can result in inventory-mange.py crash as the group will not be mapped. This case is handled now and script will properly display group assigment for this scenario. Related-Bug: #2102132 Change-Id: I73daae0334876399cb429b5a88376474abfef79e
This commit is contained in:
parent
29ce380dd8
commit
dd418a06e6
@ -202,8 +202,12 @@ def print_containers_per_group(inventory):
|
||||
continue
|
||||
|
||||
# Don't show default group
|
||||
if len(containers) == 1 and '_' not in containers[0]:
|
||||
continue
|
||||
if len(containers) == 1:
|
||||
if containers[0] is None:
|
||||
continue
|
||||
|
||||
if '_' not in containers[0]:
|
||||
continue
|
||||
|
||||
# Join with newlines here to avoid having a horrific table with tons
|
||||
# of line wrapping.
|
||||
|
Loading…
x
Reference in New Issue
Block a user