Change in vdsm[master]: disconnect bridge port on rhel 6

ibarkan at redhat.com ibarkan at redhat.com
Wed Jan 21 09:05:55 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: disconnect bridge port on rhel 6
......................................................................

disconnect bridge port on rhel 6

This fixes a bug introduced in d6d7db4ca24606d35acafe6e92b1ee031c0c8fe1
 Where del network learned how to disconnect a bridge port.  Since rhel6 ip link
 command does not support 'nomaster', we also try brctl.

Change-Id: Ieaa6be3f4d5a202ef79704f3af76c8968765f54c
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M vdsm/network/api.py
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/37157/1

diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 3eafde0..084255a 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -430,6 +430,21 @@
                                  network)
 
 
+def _disconnect_bridge_port(bridge, port):
+    try:
+        ipwrapper.linkSet(port, ['nomaster'])
+    except ipwrapper.IPRoute2Error:
+        # rhel6 ip link command does not support 'nomaster'
+        rc, out, err = utils.execCmd(
+            [constants.EXT_BRCTL, 'delif', bridge, port])
+        if rc != 0:
+            raise ConfigNetworkError(
+                ne.ERR_FAILED_IFDOWN,
+                'Failed to disconnect {0} from {1}. error: {2}'.format(
+                    port, bridge, err
+                ))
+
+
 @_alterRunningConfig
 def _delNetwork(network, vlan=None, bonding=None, nics=None, force=False,
                 configurator=None, implicitBonding=True, _netinfo=None,
@@ -473,7 +488,7 @@
             # we are interested to leave the bridge here, we have to disconnect
             # it from the device so that the configurator will allow its
             # removal.
-            ipwrapper.linkSet(net_ent_to_remove.name, ['nomaster'])
+            _disconnect_bridge_port(net_ent.name, net_ent_to_remove.name)
     else:
         net_ent_to_remove = net_ent
 


-- 
To view, visit http://gerrit.ovirt.org/37157
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaa6be3f4d5a202ef79704f3af76c8968765f54c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list