diff options
author | Sumedh Sathaye <sumedh.sathaye@calxeda.com> | 2013-04-23 14:09:32 -0500 |
---|---|---|
committer | Sumedh Sathaye <sumedh.sathaye@calxeda.com> | 2013-04-26 13:30:24 -0500 |
commit | 178e27a68ac234e46af2fe4a7386984add6c8332 (patch) | |
tree | 310467fb0ea8a211703e28ccc9b8fa8b7a179727 | |
parent | 58cf5f5081366159e40ce5bd937be46d54b64fca (diff) | |
download | pyipmi-178e27a68ac234e46af2fe4a7386984add6c8332.tar.gz |
Added per-node support for virtual mac addr set/get test.
-rw-r--r-- | pyipmi/bmc.py | 15 | ||||
-rw-r--r-- | pyipmi/commands/fabric.py | 22 |
2 files changed, 35 insertions, 2 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py index 80be90c..fbd0bcc 100644 --- a/pyipmi/bmc.py +++ b/pyipmi/bmc.py @@ -430,10 +430,11 @@ class BMC(object): def fabric_get_depthchart(self, filename, tftp_addr=None): return self.handle.fabric_getdepthchart(filename=filename, tftp_addr=tftp_addr) - def fabric_add_macaddr(self, nodeid="", iface=0, macaddr=""): + + def fabric_add_macaddr(self, nodeid=None, iface=0, macaddr=None): return self.handle.fabric_addmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) - def fabric_rm_macaddr(self, nodeid="", iface=0, macaddr=""): + def fabric_rm_macaddr(self, nodeid=None, iface=0, macaddr=None): return self.handle.fabric_rmmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) # @@ -525,6 +526,16 @@ class BMC(object): def get_info_card(self): return self.handle.info_card() + # + # node commands + # + + def node_add_macaddr(self, iface=0, macaddr=None): + return self.handle.node_addmacaddr(iface=iface, macaddr=macaddr) + + def node_rm_macaddr(self, iface=0, macaddr=None): + return self.handle.node_rmmacaddr(iface=iface, macaddr=macaddr) + class LanBMC(BMC): """A BMC that's accessed over the LAN""" diff --git a/pyipmi/commands/fabric.py b/pyipmi/commands/fabric.py index 2deb425..e292bea 100644 --- a/pyipmi/commands/fabric.py +++ b/pyipmi/commands/fabric.py @@ -128,6 +128,26 @@ class RmMacAddrCommand(Command, ResponseParserMixIn): 'node', self._params['nodeid'], 'interface', self._params['iface']] +class NodeAddMacAddrCommand(Command, ResponseParserMixIn): + """Describes the ipmitool fabric add macaddr command to a node""" + name = "Node Add macaddr command" + + @property + def ipmitool_args(self): + return ['cxoem', 'fabric', 'add', + 'macaddr', self._params['macaddr'], + 'interface', self._params['iface']] + +class NodeRmMacAddrCommand(Command, ResponseParserMixIn): + """Describes the ipmitool fabric rm macaddr command from a node""" + name = "Node Remove macaddr command" + + @property + def ipmitool_args(self): + return ['cxoem', 'fabric', 'rm', + 'macaddr', self._params['macaddr'], + 'interface', self._params['iface']] + class GetLinkspeedCommand(Command, ResponseParserMixIn): """Describes the ipmitool fabric get linkspeed command""" name = "Get linkspeed command" @@ -279,4 +299,6 @@ fabric_commands = { "fabric_getroutingtable" : GetRoutingTableCommand "fabric_addmacaddr" : AddMacAddrCommand, "fabric_rmmacaddr" : RmMacAddrCommand, + "node_addmacaddr" : NodeAddMacAddrCommand, + "node_rmmacaddr" : NodeRmMacAddrCommand, } |