From 173f1eaf7ebc69e2faf41cd409106e4129880229 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 11 May 2018 14:24:47 -0400 Subject: [PATCH] Include absent devices in the json of nodeinventory --- confluent_client/bin/nodeinventory | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodeinventory b/confluent_client/bin/nodeinventory index 9cef8549..9c8a6f2b 100755 --- a/confluent_client/bin/nodeinventory +++ b/confluent_client/bin/nodeinventory @@ -130,8 +130,13 @@ try: for inv in res['databynode'][node]['inventory']: prefix = inv['name'] if not inv['present']: - if not filters and not options.json: - print '{0}: {1}: Not Present'.format(node, prefix) + if not filters: + if options.json: + if node not in databynode: + databynode[node] = {} + databynode[node][prefix] = inv + else: + print '{0}: {1}: Not Present'.format(node, prefix) continue info = inv['information'] info.pop('board_extra', None)