Change in vdsm[master]: net: fix possible 'stp' key duplication in persistent config

ibarkan at redhat.com ibarkan at redhat.com
Thu Jun 25 19:06:14 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: net: fix possible 'stp' key duplication in persistent config
......................................................................

net: fix possible 'stp' key duplication in persistent config

Before the fix, In case the persistent config had {'STP': 'no'} the
normalized config would be {'stp': False, 'STP': 'no'}.

Change-Id: I1b0e1be36d992b59c2078359166e0b3823929c35
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M lib/vdsm/netconfpersistence.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/42904/1

diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index a2adecd..5cb62b7 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -330,8 +330,12 @@
         for net_attr in config_copy.networks.itervalues():
             if net_attr.get('bridged', True):
                 net_attr['bridged'] = True
-                net_attr['stp'] = self._netinfo.stpBooleanize(
-                    net_attr.get('stp'))
+                self._normalize_stp(net_attr)
+
+    def _normalize_stp(self, net_attr):
+        stp = net_attr.pop('stp', net_attr.pop('STP', None))
+        net_attr['stp'] = self._netinfo.stpBooleanize(
+            stp)
 
     def _normalize_mtu(self, config_copy):
         for net_attr in config_copy.networks.itervalues():


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

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