Change in vdsm[master]: BZ#845193 - Remove BRIDGE from nic/bond cofig file when remo...

ilvovsky at redhat.com ilvovsky at redhat.com
Thu Aug 30 06:47:48 UTC 2012


Igor Lvovsky has uploaded a new change for review.

Change subject: BZ#845193 - Remove BRIDGE from nic/bond cofig file when removing bridge
......................................................................

BZ#845193 - Remove BRIDGE from nic/bond cofig file when removing bridge

Change-Id: I4b1c678469cee610d346d1e4905ee1f02f58f4bc
Signed-off-by: Igor Lvovsky <ilvovsky at redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 11 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/7600/1

diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 58117f8..74d19c7 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -1034,18 +1034,21 @@
     if network and bridged:
         configWriter.removeBridge(network)
 
+    name = None
     if vlan:
         configWriter.removeVlan(vlan, bonding or nics[0])
-
-    # When removing bridgeless non-VLANed network
-    # we need to remove IP/NETMASK from the cfg file
-    name = None
-    if not bridged and not vlan:
+    else:
         name = bonding if bonding else nics[0]
-        # Just edit the bond/nic cfg file
         cf = configWriter.NET_CONF_PREF + name
-        for key in ('IPADDR', 'NETMASK', 'GATEWAY', 'BOOTPROTO'):
-            configWriter._updateConfigValue(cf, key, '', True)
+        if not bridged:
+            # When removing bridgeless non-VLANed network
+            # we need to remove IP/NETMASK from the cfg file
+            for key in ('IPADDR', 'NETMASK', 'GATEWAY', 'BOOTPROTO'):
+                configWriter._updateConfigValue(cf, key, '', True)
+        else:
+            # When removing bridged non-VLANed network
+            # we need to remove BRIDGE from the cfg file
+            configWriter._updateConfigValue(cf, 'BRIDGE', '', True)
 
     # The (relatively) new setupNetwork verb allows to remove a network
     # defined on top of an bonding device without break the bond itself.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b1c678469cee610d346d1e4905ee1f02f58f4bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky at redhat.com>


More information about the vdsm-patches mailing list