summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-10-03 13:01:09 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2013-10-03 13:01:09 -0500
commitb15d1fda9feedb400ded3b8775c7e2b53ced42e3 (patch)
tree3cce9a8c9167cdccd7fa683caafa050aa3cdeab7
parent95248ab843168d79f8e362f4ca3a17a491717780 (diff)
downloadcxmanage-b15d1fda9feedb400ded3b8775c7e2b53ced42e3.tar.gz
CXMAN-218: cli: Add EEPROM versions to info/tspackage commands
-rw-r--r--cxmanage_api/cli/__init__.py32
-rw-r--r--cxmanage_api/cli/commands/info.py6
-rw-r--r--cxmanage_api/cli/commands/tspackage.py6
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.")