summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthew.hodgins <matthew.hodgins@calxeda.com>2013-12-11 09:54:52 -0600
committermatthew.hodgins <matthew.hodgins@calxeda.com>2013-12-11 09:54:52 -0600
commitd1352ca89f89a2d486d7a1f72603d5b5dc08e725 (patch)
tree415b12bf333c7e77bab0a89743e3f927fc16c7e9
parentbc66eb82791039cf6784cafc06e686e19c5fa810 (diff)
downloadpyipmi-d1352ca89f89a2d486d7a1f72603d5b5dc08e725.tar.gz
CXMAN-258 exposing removing/unassigning networks
Signed-off-by: matthew.hodgins <matthew.hodgins@calxeda.com>
-rw-r--r--pyipmi/bmc.py3
-rw-r--r--pyipmi/commands/fabric_config.py22
2 files changed, 21 insertions, 4 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py
index 9482223..5211ae3 100644
--- a/pyipmi/bmc.py
+++ b/pyipmi/bmc.py
@@ -469,6 +469,9 @@ class BMC(object):
def fabric_config_add_network(self, name, uplink=None):
return self.handle.fabric_config_add_network(name=name, uplink=uplink)
+ def fabric_config_rm_network(self, name, uplink=None):
+ return self.handle.fabric_config_rm_network(name=name, uplink=uplink)
+
def fabric_config_get_uplinks(self, filename, tftp_addr=None):
return self.handle.fabric_config_get_uplinks(filename=filename,
tftp_addr=tftp_addr)
diff --git a/pyipmi/commands/fabric_config.py b/pyipmi/commands/fabric_config.py
index 7cf0b98..3530b77 100644
--- a/pyipmi/commands/fabric_config.py
+++ b/pyipmi/commands/fabric_config.py
@@ -299,12 +299,11 @@ class GetNetworksCommand(CommandWithErrors):
class AddNetworkCommand(Command, ResponseParserMixIn):
"""Describes the ipmitool fabric config add network command"""
- name = "Set uplink command"
+ name = "Add network command"
@property
def ipmitool_args(self):
- print self._params
- if('uplink' in self._params):
+ if(self._params['uplink'] is not None):
return ['cxoem', 'fabric', 'config', 'add', 'network',
self._params['name'], 'uplink', self._params['uplink']]
else:
@@ -312,6 +311,20 @@ class AddNetworkCommand(Command, ResponseParserMixIn):
self._params['name']]
+class RmNetworkCommand(Command, ResponseParserMixIn):
+ """Describes the ipmitool fabric config rm network command"""
+ name = "Rm network command"
+
+ @property
+ def ipmitool_args(self):
+ if(self._params['uplink'] is not None):
+ return ['cxoem', 'fabric', 'config', 'rm', 'network',
+ self._params['name'], 'uplink', self._params['uplink']]
+ else:
+ return ['cxoem', 'fabric', 'config', 'rm', 'network',
+ self._params['name']]
+
+
class GetUplinksCommand(CommandWithErrors):
"""Describes the cxoem fabric config get uplinks command"""
@@ -509,5 +522,6 @@ fabric_config_commands = {
'fabric_config_set_uplink_mode': SetUplinkModeCommand,
'fabric_config_get_networks': GetNetworksCommand,
'fabric_config_get_uplinks': GetUplinksCommand,
- 'fabric_config_add_network': AddNetworkCommand
+ 'fabric_config_add_network': AddNetworkCommand,
+ 'fabric_config_rm_network': RmNetworkCommand
}