From 5c53b88e4c4401d2baf9af98dc0676255ff31899 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Tue, 26 May 2020 17:10:12 +0100 Subject: [PATCH] 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 --- osa_toolkit/manage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osa_toolkit/manage.py b/osa_toolkit/manage.py index c8d5f9b3b8..d803e4c087 100644 --- a/osa_toolkit/manage.py +++ b/osa_toolkit/manage.py @@ -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