Change in vdsm[master]: net: support strings for 'bridged' in kernelConfig

ibarkan at redhat.com ibarkan at redhat.com
Sun Jul 12 12:39:59 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: net: support strings for 'bridged' in kernelConfig
......................................................................

net: support strings for 'bridged' in kernelConfig

Because kernelConfig did not know how to normalize this parameter in
running config, _should_keep_bridged got wrong parameters if
setupNetworks edited a network with 'bridged': 'false'. This
resulted in a bridge being left behind after the network was removed.

Change-Id: Ib6eb36e69c14c752712ed16d86ed5dd37007f7b7
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M lib/vdsm/netconfpersistence.py
M tests/functional/networkTests.py
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/43444/1

diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index 6834cf5..5f10f24 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -328,9 +328,11 @@
 
     def _normalize_bridge(self, config_copy):
         for net_attr in config_copy.networks.itervalues():
-            if net_attr.get('bridged', True):
+            if utils.tobool(net_attr.get('bridged', True)):
                 net_attr['bridged'] = True
                 self._normalize_stp(net_attr)
+            else:
+                net_attr['bridged'] = False
 
     def _normalize_stp(self, net_attr):
         stp = net_attr.pop('stp', net_attr.pop('STP', None))
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 6e5f025..2520201 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1481,12 +1481,12 @@
         with dummyIf(1) as nics:
             nic, = nics
             status, msg = self.setupNetworks(
-                {NETWORK_NAME: {'nic': nic, 'STP': 'no', 'bridged': True,
+                {NETWORK_NAME: {'nic': nic, 'STP': 'no', 'bridged': 'true',
                                 'mtu': 1500}}, {}, NOCHK)
             self.assertEquals(status, SUCCESS, msg)
             bridge = ipwrapper.getLink(NETWORK_NAME)
             status, msg = self.setupNetworks(
-                {NETWORK_NAME: {'nic': nic, 'bridged': False, 'mtu': 1500}},
+                {NETWORK_NAME: {'nic': nic, 'bridged': 'false', 'mtu': 1500}},
                 {}, NOCHK)
             self.assertEquals(status, SUCCESS, msg)
             self.assertNotIn(


-- 
To view, visit https://gerrit.ovirt.org/43444
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6eb36e69c14c752712ed16d86ed5dd37007f7b7
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