summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-12-17 16:30:16 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-12-17 16:31:01 -0600
commit6c7d87675345624c37648180f194f3a84ad45b13 (patch)
treedda75cde76b284a86a5b692824dfbd0c84874318
parent5cb7f8af710627b90bb38f9b5ece5c0ebc3bdfde (diff)
downloadcxmanage-6c7d87675345624c37648180f194f3a84ad45b13.tar.gz
CXMAN-278: Add LAN info to tspackage command
Basically just a dump of "ipmitool lan print"
-rw-r--r--cxmanage_api/cli/__init__.py5
-rw-r--r--cxmanage_api/cli/commands/tspackage.py17
2 files changed, 21 insertions, 1 deletions
diff --git a/cxmanage_api/cli/__init__.py b/cxmanage_api/cli/__init__.py
index 00a7886..ea4284a 100644
--- a/cxmanage_api/cli/__init__.py
+++ b/cxmanage_api/cli/__init__.py
@@ -190,7 +190,10 @@ def run_command(args, nodes, name, *method_args):
tasks = {}
for node in nodes:
- tasks[node] = task_queue.put(getattr(node, name), *method_args)
+ target = node
+ for member in name.split("."):
+ target = getattr(target, member)
+ tasks[node] = task_queue.put(target, *method_args)
results = {}
errors = {}
diff --git a/cxmanage_api/cli/commands/tspackage.py b/cxmanage_api/cli/commands/tspackage.py
index 0a4beb3..75158a8 100644
--- a/cxmanage_api/cli/commands/tspackage.py
+++ b/cxmanage_api/cli/commands/tspackage.py
@@ -93,6 +93,10 @@ def tspackage_command(args):
print("Getting version information...")
write_version_info(args, nodes)
+ if not quit:
+ print("Getting LAN information...")
+ write_lan_info(args, nodes)
+
if not quiet:
print("Getting boot order...")
write_boot_order(args, nodes)
@@ -200,6 +204,19 @@ def write_version_info(args, nodes):
write_to_file(node, lines)
+
+def write_lan_info(args, nodes):
+ """Write LAN info for each node"""
+ results, _ = run_command(args, nodes, "bmc.lan_print")
+
+ for node in nodes:
+ lines = ["\n[ LAN info for Node %s ]" % node.node_id]
+ for (key, value) in sorted(vars(results[node]).items()):
+ lines.append("%s: %s" % (key, value))
+
+ write_to_file(node, lines)
+
+
def write_mac_addrs(args, nodes):
"""Write the MAC addresses for each node to their respective files."""
mac_addr_results, _ = run_command(