summaryrefslogtreecommitdiff
path: root/pyipmi
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-05-01 16:33:52 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2013-05-01 16:33:52 -0500
commitaad89cbd06f426cc4c190f6b8e67b7aa063036cd (patch)
tree895fb7ad476d82693a0702b9d9220a57c8c31581 /pyipmi
parent66555751f8f0b7dc6b2276b7ba4a4460e6e0f0a6 (diff)
downloadpyipmi-aad89cbd06f426cc4c190f6b8e67b7aa063036cd.tar.gz
fabric: Remove NodeAddMacAddr and NodeRmMacAddr
These should be considered subsets of AddMacAddr and RmMacAddr, where the nodeid param is optional.
Diffstat (limited to 'pyipmi')
-rw-r--r--pyipmi/bmc.py14
-rw-r--r--pyipmi/commands/fabric.py44
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,