diff --git a/confluent_client/bin/nodefirmware b/confluent_client/bin/nodefirmware index 465314d7..0c6a0958 100755 --- a/confluent_client/bin/nodefirmware +++ b/confluent_client/bin/nodefirmware @@ -56,7 +56,7 @@ components = ['all'] argparser = optparse.OptionParser( usage="Usage: " - "%prog [list][update [--backup ]]|[]") + "%prog [list][updatestatus][update [--backup ]]|[]") argparser.add_option('-b', '--backup', action='store_true', help='Target a backup bank rather than primary') argparser.add_option('-m', '--maxnodes', type='int', @@ -65,14 +65,18 @@ argparser.add_option('-m', '--maxnodes', type='int', (options, args) = argparser.parse_args() upfile = None +querystatus = False try: noderange = args[0] if len(args) > 1: if args[1] == 'update': upfile = args[2] else: + comps = [] if args[1] == 'list': comps = args[2:] + elif args[1] == 'updatestatus': + querystatus = True else: comps = args[1:] components = [] @@ -171,7 +175,16 @@ def show_firmware(session): try: session = client.Command() - if upfile is None: + if querystatus: + for res in session.read( + '/noderange/{0}/inventory/firmware/updatestatus'.format(noderange)): + for node in res.get('databynode', {}): + currstat = res['databynode'][node].get('status', None) + if currstat: + print('{}: {}'.format(node, currstat)) + else: + print(repr(res)) + elif upfile is None: show_firmware(session) else: update_firmware(session, upfile) diff --git a/confluent_client/doc/man/nodefirmware.ronn b/confluent_client/doc/man/nodefirmware.ronn index bd55f847..b8925976 100644 --- a/confluent_client/doc/man/nodefirmware.ronn +++ b/confluent_client/doc/man/nodefirmware.ronn @@ -3,7 +3,7 @@ nodefirmware(8) -- Report firmware information on confluent nodes ## SYNOPSIS -`nodefirmware [list][update [--backup ]]|[]` +`nodefirmware [list][updatestatus][update [--backup ]]|[]` ## DESCRIPTION @@ -17,6 +17,9 @@ not be relevant to redfish. Additionally, the Lenovo XCC makes certain information available over IPMI that is not otherwise available (for example the FPGA version where applicable). +The updatestatus argument will describe the state of firmware updates on the +nodes. + In the update form, it accepts a single file and attempts to update it using the out of band facilities. Firmware updates can end in one of three states: