From aad89cbd06f426cc4c190f6b8e67b7aa063036cd Mon Sep 17 00:00:00 2001 From: George Kraft Date: Wed, 1 May 2013 16:33:52 -0500 Subject: fabric: Remove NodeAddMacAddr and NodeRmMacAddr These should be considered subsets of AddMacAddr and RmMacAddr, where the nodeid param is optional. --- pyipmi/bmc.py | 14 ++------------ pyipmi/commands/fabric.py | 44 +++++++++++++------------------------------- 2 files changed, 15 insertions(+), 43 deletions(-) (limited to 'pyipmi') 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) # @@ -526,16 +526,6 @@ 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) - # # 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, -- cgit v1.2.1