summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Mock <tyler.mock@calxeda.com>2013-04-26 11:02:44 -0500
committerTyler Mock <tyler.mock@calxeda.com>2013-04-26 11:02:44 -0500
commite9384de5b0a035981413a9a7c64b081ef6d9fffb (patch)
tree2259fce7e5f61639048f8c1e3438447b1b7d515e
parentcf1f3f8c33c56a313f4f8b2854a14deae8f279b6 (diff)
downloadpyipmi-e9384de5b0a035981413a9a7c64b081ef6d9fffb.tar.gz
Added support for get_fabric_depth_chart()
-rw-r--r--pyipmi/bmc.py4
-rw-r--r--pyipmi/commands/fabric.py34
-rw-r--r--pyipmi/fabric.py4
3 files changed, 39 insertions, 3 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py
index ccc4f47..500eccd 100644
--- a/pyipmi/bmc.py
+++ b/pyipmi/bmc.py
@@ -427,6 +427,10 @@ class BMC(object):
return self.handle.fabric_getroutingtable(filename=filename,
tftp_addr=tftp_addr)
+ def fabric_get_depthchart(self, filename, tftp_addr=None):
+ return self.handle.fabric_getdepthchart(filename=filename,
+ tftp_addr=tftp_addr)
+
#
# fabric config commands
#
diff --git a/pyipmi/commands/fabric.py b/pyipmi/commands/fabric.py
index bee022f..67a78b4 100644
--- a/pyipmi/commands/fabric.py
+++ b/pyipmi/commands/fabric.py
@@ -172,7 +172,7 @@ class GetLinkMapCommand(Command, ResponseParserMixIn):
'Error' : {}
}
- def parse_respons(self, out, err):
+ def parse_response(self, out, err):
return out.strip()
@property
@@ -199,7 +199,7 @@ class GetRoutingTableCommand(Command, ResponseParserMixIn):
'Error' : {}
}
- def parse_respons(self, out, err):
+ def parse_response(self, out, err):
return out.strip()
@property
@@ -217,6 +217,33 @@ class GetRoutingTableCommand(Command, ResponseParserMixIn):
return ["cxoem", "fabric", "info", "routing_table", "file",
self._params['filename']]
+class GetDepthChartCommand(Command, ResponseParserMixIn):
+ """Describes the ipmitool fabric info depth_chart command"""
+ name = "Get depth_chart command"
+ result_type = FabricGetDepthChartResult
+ response_fields = {
+ 'File Name' : {},
+ 'Error' : {}
+ }
+
+ def parse_response(self, out, err):
+ return out.strip()
+
+ @property
+ def ipmitool_args(self):
+ if self._params['tftp_addr'] != None:
+ tftp_args = self._params['tftp_addr'].split(":")
+ if len(tftp_args) == 1:
+ return ["cxoem", "fabric", "info", "depth_chart", "tftp",
+ tftp_args[0], "file", self._params['filename']]
+ else:
+ return ["cxoem", "fabric", "info", "depth_chart", "tftp",
+ tftp_args[0], "port", tftp_args[1], "file",
+ self._params['filename']]
+ else:
+ return ["cxoem", "fabric", "info", "depth_chart", "file",
+ self._params['filename']]
+
fabric_commands = {
"fabric_updateconfig" :UpdateConfigCommand,
@@ -226,5 +253,6 @@ fabric_commands = {
"fabric_getlinkspeed" : GetLinkspeedCommand,
"fabric_getlinkstats" : GetLinkStatsCommand,
"fabric_getlinkmap" : GetLinkMapCommand,
- "fabric_getroutingtable" : GetRoutingTableCommand
+ "fabric_getroutingtable" : GetRoutingTableCommand,
+ "fabric_getdepthchart" : GetDepthChartCommand
}
diff --git a/pyipmi/fabric.py b/pyipmi/fabric.py
index 328998c..059ea06 100644
--- a/pyipmi/fabric.py
+++ b/pyipmi/fabric.py
@@ -57,3 +57,7 @@ class FabricGetLinkMapResult(object):
class FabricGetRoutingTableResult(object):
"""Object to hold the fabric routing_table results"""
pass
+
+class FabricGetDepthChartResult(object):
+ """Object to hold the fabric depth_chart results"""
+ pass