Antoni Segura Puimedon has uploaded a new change for review.
Change subject: ifcfg: stop leaving leftover bridges when removing bonded networks
......................................................................
ifcfg: stop leaving leftover bridges when removing bonded networks
When having a network bridged non-vlanned bonded network, removing
the network while intending to remove the bond would remove the
network bridge and then create it again.
This patch fixes it by removing the 'BRIDGE' entry from the bond
before ifuppin it up again.
Change-Id: I3de692c7f089d6a9f404c3a2f6f568c12d8a985d
Bug-Url:
https://bugzilla.redhat.com/1071398
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/netconf/ifcfg.py
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/25203/1
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index ee69c3d..835aae4 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -189,6 +189,9 @@
else:
self.configApplier.setBondingMtu(bonding.name,
netinfo.DEFAULT_MTU)
+ if bonding.bridge is not None:
+ self.configApplier._updateConfigValue(
+ netinfo.NET_CONF_PREF + bonding.name, 'BRIDGE', None)
ifup(bonding.name)
else:
set_mtu = self._setNewMtu(
@@ -739,7 +742,8 @@
entries = [line for line in f.readlines()
if not line.startswith(entry + '=')]
- entries.append('\n' + entry + '=' + value)
+ if value is not None:
+ entries.append('\n' + entry + '=' + value)
self._backup(conffile)
with open(conffile, 'w') as f:
f.writelines(entries)
--
To view, visit
http://gerrit.ovirt.org/25203
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3de692c7f089d6a9f404c3a2f6f568c12d8a985d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>