2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Change error for nodefirmware with present, but empty noderange

This commit is contained in:
Jarrod Johnson 2021-07-15 11:24:23 -04:00
parent 85643d82e8
commit 597faecc04

View File

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