Fix inventory_manage when the component for a host is not defined

Previously this would fail with a stacktrace, so now display something
useful when the component is not defined.

Change-Id: I27aa0d0b32fd1db47cc2fc43afbad085ea22d0bf
This commit is contained in:
Jonathan Rosser 2020-05-26 17:10:12 +01:00
parent 9ff56201c9
commit 5c53b88e4c

View File

@ -236,6 +236,9 @@ def print_inventory(inventory, sort_key):
else:
row = []
for _rl in required_list:
if _rl == 'component':
if values.get(_rl) is None:
values[_rl] = "-undefined-"
if _rl == 'container_name':
if values.get(_rl) is None:
values[_rl] = key