summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2012-05-17 12:00:11 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2012-05-17 12:00:11 -0500
commit89a09c5561857000a549c613bc17c1f8152b91bf (patch)
treea6333354d1871b5f18a0c54606bea75f815a0d51
parentb91722c985bc23462938b1bfa30f645370177e44 (diff)
downloadpyipmi-89a09c5561857000a549c613bc17c1f8152b91bf.tar.gz
Add fabric IP list and MAC list commands.
-rw-r--r--pyipmi/bmc.py8
-rw-r--r--pyipmi/commands/__init__.py4
-rw-r--r--pyipmi/commands/fabric.py42
-rw-r--r--pyipmi/fabric.py11
4 files changed, 64 insertions, 1 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py
index ff6c12c..05273d5 100644
--- a/pyipmi/bmc.py
+++ b/pyipmi/bmc.py
@@ -310,6 +310,14 @@ class BMC(object):
return self.handle.user_priv(userid=userid, priv_level=priv_level,
channel=channel)
+ def get_ip_list(self, filename, tftp_addr):
+ return self.handle.fabric_iplist(filename=filename,
+ tftp_addr=tftp_addr)
+
+ def get_mac_list(self, filename, tftp_addr):
+ return self.handle.fabric_maclist(filename=filename,
+ tftp_addr=tftp_addr)
+
class LanBMC(BMC):
"""A BMC that's accessed over the LAN"""
diff --git a/pyipmi/commands/__init__.py b/pyipmi/commands/__init__.py
index 91f8ff3..bb83c10 100644
--- a/pyipmi/commands/__init__.py
+++ b/pyipmi/commands/__init__.py
@@ -1,4 +1,4 @@
-#Copyright 2011 Calxeda, Inc. All Rights Reserved.
+#Copyright 2012 Calxeda, Inc. All Rights Reserved.
"""IPMI commands that are implemented
These don't always map directly to IPMI requests, although sometimes
@@ -23,6 +23,7 @@ from fru import fru_commands
from lan import lan_commands
from channel import channel_commands
from user import user_commands
+from fabric import fabric_commands
ipmi_commands = {}
@@ -43,3 +44,4 @@ ipmi_commands.update(fru_commands)
ipmi_commands.update(lan_commands)
ipmi_commands.update(channel_commands)
ipmi_commands.update(user_commands)
+ipmi_commands.update(fabric_commands)
diff --git a/pyipmi/commands/fabric.py b/pyipmi/commands/fabric.py
new file mode 100644
index 0000000..e920031
--- /dev/null
+++ b/pyipmi/commands/fabric.py
@@ -0,0 +1,42 @@
+#Copyright 2012 Calxeda, Inc. All Rights Reserved.
+
+from .. import Command
+from pyipmi.tools.responseparser import ResponseParserMixIn
+from pyipmi.fabric import *
+
+class FabricIPListCommand(Command, ResponseParserMixIn):
+ """ Describes the cxoem fabric list_ip_addrs IPMI command
+ """
+
+ name = "Retrieve IP List"
+ result_type = FabricIPListResult
+
+ response_fields = {
+ 'File Name' : {}
+ }
+
+ @property
+ def ipmitool_args(self):
+ return ["cxoem", "fabric", "config", "list_ip_addrs", "tftp",
+ self._params['tftp_addr'], "file", self._params['filename']]
+
+class FabricMACListCommand(Command, ResponseParserMixIn):
+ """ Describes the cxoem fabric list_macs IPMI command
+ """
+
+ name = "Retrieve MAC List"
+ result_type = FabricMACListResult
+
+ response_fields = {
+ 'File Name' : {}
+ }
+
+ @property
+ def ipmitool_args(self):
+ return ["cxoem", "fabric", "config", "list_macs", "tftp",
+ self._params['tftp_addr'], "file", self._params['filename']]
+
+fabric_commands = {
+ "fabric_iplist" : FabricIPListCommand,
+ "fabric_maclist" : FabricMACListCommand
+}
diff --git a/pyipmi/fabric.py b/pyipmi/fabric.py
new file mode 100644
index 0000000..9741c0a
--- /dev/null
+++ b/pyipmi/fabric.py
@@ -0,0 +1,11 @@
+"""Fabric results
+
+"""
+
+class FabricIPListResult(object):
+ """Object to hold fabric ip list results"""
+ pass
+
+class FabricMACListResult(object):
+ """Object to hold fabric mac list results"""
+ pass