From b15d1fda9feedb400ded3b8775c7e2b53ced42e3 Mon Sep 17 00:00:00 2001 From: George Kraft Date: Thu, 3 Oct 2013 13:01:09 -0500 Subject: CXMAN-218: cli: Add EEPROM versions to info/tspackage commands --- cxmanage_api/cli/__init__.py | 32 +++++++++++++++++--------------- cxmanage_api/cli/commands/info.py | 6 +++--- cxmanage_api/cli/commands/tspackage.py | 6 +++--- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/cxmanage_api/cli/__init__.py b/cxmanage_api/cli/__init__.py index 2d98d8a..0d72116 100644 --- a/cxmanage_api/cli/__init__.py +++ b/cxmanage_api/cli/__init__.py @@ -41,6 +41,23 @@ from cxmanage_api.tasks import TaskQueue from cxmanage_api.cx_exceptions import TftpException +COMPONENTS = [ + ("ecme_version", "ECME version"), + ("cdb_version", "CDB version"), + ("stage2_version", "Stage2boot version"), + ("bootlog_version", "Bootlog version"), + ("a9boot_version", "A9boot version"), + ("a15boot_version", "A15boot version"), + ("uboot_version", "Uboot version"), + ("ubootenv_version", "Ubootenv version"), + ("dtb_version", "DTB version"), + ("node_eeprom_version", "Node EEPROM version"), + ("node_eeprom_config", "Node EEPROM config"), + ("slot_eeprom_version", "Slot EEPROM version"), + ("slot_eeprom_config", "Slot EEPROM config"), +] + + def get_tftp(args): """Get a TFTP server""" if args.internal_tftp: @@ -343,18 +360,3 @@ def _print_command_status(tasks, counter): dots = "".join(["." for x in range(counter % 4)]).ljust(3) sys.stdout.write(message % (successes, errors, nodes_left, dots)) sys.stdout.flush() - - -# These are needed for ipinfo and whenever version information is printed -COMPONENTS = [ - ("ecme_version", "ECME version"), - ("cdb_version", "CDB version"), - ("stage2_version", "Stage2boot version"), - ("bootlog_version", "Bootlog version"), - ("a9boot_version", "A9boot version"), - ("a15boot_version", "A15boot version"), - ("uboot_version", "Uboot version"), - ("ubootenv_version", "Ubootenv version"), - ("dtb_version", "DTB version"), -] - diff --git a/cxmanage_api/cli/commands/info.py b/cxmanage_api/cli/commands/info.py index 0f0b2ca..9d92fa9 100644 --- a/cxmanage_api/cli/commands/info.py +++ b/cxmanage_api/cli/commands/info.py @@ -63,13 +63,13 @@ def info_basic_command(args): components = COMPONENTS print "[ Info from %s ]" % node_strings[node] - print "Hardware version : %s" % result.hardware_version - print "Firmware version : %s" % result.firmware_version + print "Hardware version : %s" % result.hardware_version + print "Firmware version : %s" % result.firmware_version # var is the variable, string is the printable string of var for var, string in components: if hasattr(result, var): version = getattr(result, var) - print "%s: %s" % (string.ljust(19), version) + print "%s: %s" % (string.ljust(20), version) print if not args.quiet and errors: diff --git a/cxmanage_api/cli/commands/tspackage.py b/cxmanage_api/cli/commands/tspackage.py index 2d86aa4..c0c18c5 100644 --- a/cxmanage_api/cli/commands/tspackage.py +++ b/cxmanage_api/cli/commands/tspackage.py @@ -145,11 +145,11 @@ def write_version_info(args, nodes): if node in info_results: info_result = info_results[node] lines.append( - "Hardware version : %s" % + "Hardware version : %s" % info_result.hardware_version ) lines.append( - "Firmware version : %s" % + "Firmware version : %s" % info_result.firmware_version ) @@ -158,7 +158,7 @@ def write_version_info(args, nodes): for var, description in components: if hasattr(info_result, var): version = getattr(info_result, var) - lines.append("%s: %s" % (description.ljust(19), version)) + lines.append("%s: %s" % (description.ljust(20), version)) else: lines.append("No version information could be found.") -- cgit v1.2.1