From 597faecc04ccddca1ad933657a3197aea58828aa Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 15 Jul 2021 11:24:23 -0400 Subject: [PATCH] Change error for nodefirmware with present, but empty noderange --- confluent_client/bin/nodefirmware | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodefirmware b/confluent_client/bin/nodefirmware index 8f8ab62c..62ff32a7 100755 --- a/confluent_client/bin/nodefirmware +++ b/confluent_client/bin/nodefirmware @@ -147,10 +147,12 @@ def update_firmware(session, filename): def show_firmware(session): global exitcode firmware_shown = False + nodes_matched = False for component in components: for res in session.read( '/noderange/{0}/inventory/firmware/all/{1}'.format( noderange, component)): + nodes_matched = True exitcode |= client.printerror(res) if 'databynode' not in res: continue @@ -161,7 +163,9 @@ def show_firmware(session): for prefix in inv: firmware_shown = True printfirm(node, prefix, inv[prefix]) - if not firmware_shown and not exitcode: + if not nodes_matched: + sys.stderr.write('No matching nodes for noderange "{0}"'.format(noderange)) + elif not firmware_shown and not exitcode: argparser.print_help()