diff options
-rw-r--r-- | pyipmi/bmc.py | 14 | ||||
-rw-r--r-- | pyipmi/commands/fabric.py | 44 |
2 files changed, 15 insertions, 43 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py index c4e0d8a..cda3c9b 100644 --- a/pyipmi/bmc.py +++ b/pyipmi/bmc.py @@ -431,10 +431,10 @@ class BMC(object): return self.handle.fabric_getdepthchart(filename=filename, tftp_addr=tftp_addr) - def fabric_add_macaddr(self, nodeid=None, iface=0, macaddr=None): + def fabric_add_macaddr(self, iface, macaddr, nodeid=None): return self.handle.fabric_addmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) - def fabric_rm_macaddr(self, nodeid=None, iface=0, macaddr=None): + def fabric_rm_macaddr(self, iface, macaddr, nodeid=None): return self.handle.fabric_rmmacaddr(nodeid=nodeid, iface=iface, macaddr=macaddr) # @@ -527,16 +527,6 @@ class BMC(object): 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) - - # # fabric info commands # diff --git a/pyipmi/commands/fabric.py b/pyipmi/commands/fabric.py index 78e3328..c28a6fb 100644 --- a/pyipmi/commands/fabric.py +++ b/pyipmi/commands/fabric.py @@ -128,10 +128,13 @@ class AddMacAddrCommand(Command, ResponseParserMixIn): @property def ipmitool_args(self): - return ['cxoem', 'fabric', 'add', - 'macaddr', self._params['macaddr'], - 'node', self._params['nodeid'], - 'interface', self._params['iface']] + result = ['cxoem', 'fabric', 'add', + 'macaddr', self._params['macaddr'], + 'interface', self._params['iface']] + if self._params['nodeid']: + result += ['node', self._params['nodeid']] + return result + class RmMacAddrCommand(Command, ResponseParserMixIn): """Describes the ipmitool fabric rm macaddr command""" @@ -139,30 +142,12 @@ class RmMacAddrCommand(Command, ResponseParserMixIn): @property def ipmitool_args(self): - return ['cxoem', 'fabric', 'rm', - 'macaddr', self._params['macaddr'], - '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']] + result = ['cxoem', 'fabric', 'rm', + 'macaddr', self._params['macaddr'], + 'interface', self._params['iface']] + if self._params['nodeid']: + result += ['node', self._params['nodeid']] + return result class GetLinkspeedCommand(Command, ResponseParserMixIn): """Describes the ipmitool fabric get linkspeed command""" @@ -315,9 +300,6 @@ fabric_commands = { "fabric_addmacaddr" : AddMacAddrCommand, "fabric_rmmacaddr" : RmMacAddrCommand, - "node_addmacaddr" : NodeAddMacAddrCommand, - "node_rmmacaddr" : NodeRmMacAddrCommand, - "fabric_info_getroutingtable" : GetRoutingTableCommand, "fabric_info_getlinkmap" : GetLinkMapCommand, "fabric_info_getdepthchart" : GetDepthChartCommand, |