Igor Lvovsky has uploaded a new change for review.
Change subject: Continue support nicless bridge.
......................................................................
Continue support nicless bridge.
In general we can define bridge without connect it to any interface (nic/bond).
This behaviour was broken mistakenly in previous commits, fixed now.
Change-Id: Ief7138b659370fef9b38987980216dd8453cfee1
Signed-off-by: Igor Lvovsky <ilvovsky(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 15 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/7831/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 6fe7ac7..0afc012 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -1040,20 +1040,22 @@
if network and bridged:
configWriter.removeBridge(network)
- iface = bonding if bonding else nics[0]
- if vlan:
- configWriter.removeVlan(vlan, iface)
- else:
- cf = configWriter.NET_CONF_PREF + iface
- 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)
+ nic = nics[0] if nics else None
+ iface = bonding if bonding else nic
+ if iface:
+ if vlan:
+ configWriter.removeVlan(vlan, iface)
else:
- # When removing bridged non-VLANed network
- # we need to remove BRIDGE from the cfg file
- configWriter._updateConfigValue(cf, 'BRIDGE', '', True)
+ cf = configWriter.NET_CONF_PREF + iface
+ 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/7831
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief7138b659370fef9b38987980216dd8453cfee1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky(a)redhat.com>