diff options
author | Sumedh Sathaye <sumedh.sathaye@calxeda.com> | 2013-04-19 15:50:27 -0500 |
---|---|---|
committer | Sumedh Sathaye <sumedh.sathaye@calxeda.com> | 2013-04-26 13:29:15 -0500 |
commit | 58cf5f5081366159e40ce5bd937be46d54b64fca (patch) | |
tree | 9d17f46145275aa0983cf3c31a9535d4a0535d2b | |
parent | e9384de5b0a035981413a9a7c64b081ef6d9fffb (diff) | |
download | pyipmi-58cf5f5081366159e40ce5bd937be46d54b64fca.tar.gz |
Added support for add/rm mac address to a node/interface combo.
-rw-r--r-- | pyipmi/bmc.py | 5 | ||||
-rw-r--r-- | pyipmi/commands/fabric.py | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py index 500eccd..80be90c 100644 --- a/pyipmi/bmc.py +++ b/pyipmi/bmc.py @@ -430,6 +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=""): + return self.handle.fabric_addmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) + + def fabric_rm_macaddr(self, nodeid="", iface=0, macaddr=""): + return self.handle.fabric_rmmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) # # fabric config commands diff --git a/pyipmi/commands/fabric.py b/pyipmi/commands/fabric.py index 67a78b4..2deb425 100644 --- a/pyipmi/commands/fabric.py +++ b/pyipmi/commands/fabric.py @@ -106,6 +106,28 @@ class GetMacAddrCommand(Command, ResponseParserMixIn): result.extend(['node', self._params['nodeid']]) return result +class AddMacAddrCommand(Command, ResponseParserMixIn): + """Describes the ipmitool fabric add macaddr command""" + name = "Add macaddr command" + + @property + def ipmitool_args(self): + return ['cxoem', 'fabric', 'add', + 'macaddr', self._params['macaddr'], + 'node', self._params['nodeid'], + 'interface', self._params['iface']] + +class RmMacAddrCommand(Command, ResponseParserMixIn): + """Describes the ipmitool fabric rm macaddr command""" + name = "Remove macaddr command" + + @property + def ipmitool_args(self): + return ['cxoem', 'fabric', 'rm', + 'macaddr', self._params['macaddr'], + 'node', self._params['nodeid'], + 'interface', self._params['iface']] + class GetLinkspeedCommand(Command, ResponseParserMixIn): """Describes the ipmitool fabric get linkspeed command""" name = "Get linkspeed command" @@ -253,6 +275,8 @@ fabric_commands = { "fabric_getlinkspeed" : GetLinkspeedCommand, "fabric_getlinkstats" : GetLinkStatsCommand, "fabric_getlinkmap" : GetLinkMapCommand, - "fabric_getroutingtable" : GetRoutingTableCommand, "fabric_getdepthchart" : GetDepthChartCommand + "fabric_getroutingtable" : GetRoutingTableCommand + "fabric_addmacaddr" : AddMacAddrCommand, + "fabric_rmmacaddr" : RmMacAddrCommand, } |