From 2c9c778ca7e44ee72a30ad1faeea3cd4b39e2bfc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 15 Apr 2019 11:08:56 -0400 Subject: [PATCH] Fix compatibility without module_type Some vendors do not provide module_type value. For such vendors, simply omit the information rather than fail. --- confluent_client/bin/nodeinventory | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodeinventory b/confluent_client/bin/nodeinventory index c2bd1094..95e1c7b0 100755 --- a/confluent_client/bin/nodeinventory +++ b/confluent_client/bin/nodeinventory @@ -58,7 +58,9 @@ def print_mem_info(node, prefix, meminfo): if meminfo.get('ecc', False): memdescfmt += 'ECC ' capacity = meminfo['capacity_mb'] / 1024 - memdescfmt += meminfo['module_type'] + modtype = meminfo.get('module_type', None) + if modtype: + memdescfmt += modtype memdesc = memdescfmt.format(capacity, meminfo['speed']) print('{0}: {1} description: {2}'.format(node, prefix, memdesc)) print('{0}: {1} manufacturer: {2}'.format(