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()