Change in vdsm[master]: net: Compare kernel vs running bond config opt vals

edwardh at redhat.com edwardh at redhat.com
Wed Dec 2 14:51:44 UTC 2015


Edward Haas has uploaded a new change for review.

Change subject: net: Compare kernel vs running bond config opt vals
......................................................................

net: Compare kernel vs running bond config opt vals

Comparing between the bond running config and the
bond kernel config should consider that some values
may be inputted as name or numeric.
A dictionary is kept to translate between the name
and its numeric value.

The running config bonding option values are normalized
to their numeric values and compared to the kernel
config which represents the values as numeric.

Change-Id: I0f334a7ae2ecd8fc75c05972e37d539cf7c28661
Signed-off-by: Edward Haas <edwardh at redhat.com>
---
M lib/vdsm/kernelconfig.py
M tests/functional/networkTests.py
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/49579/1

diff --git a/lib/vdsm/kernelconfig.py b/lib/vdsm/kernelconfig.py
index 3aaa53f..7ae42b9 100644
--- a/lib/vdsm/kernelconfig.py
+++ b/lib/vdsm/kernelconfig.py
@@ -284,6 +284,13 @@
         numeric_mode = netinfo.BONDING_MODES_NAME_TO_NUMBER[mode]
         opts['mode'] = numeric_mode
 
+    # Force a numeric value for an option
+    for opname, opval in opts.items():
+        numeric_val = netinfo.get_bonding_option_numeric_val(numeric_mode,
+                                                             opname, opval)
+        if numeric_val is not None:
+            opts[opname] = numeric_val
+
     defaults = netinfo.getDefaultBondingOptions(numeric_mode)
     return dict(
         (k, v) for k, v in opts.iteritems() if v != defaults.get(k))
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index be27dc2..218ee43 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -577,7 +577,6 @@
                 {BONDING_NAME: {'remove': True}}, NOCHK)
             self.assertEqual(status, SUCCESS, msg)
 
-    @brokentest("canonize bond options to numbers in KernelConfig")
     @cleanupNet
     @permutations([[True], [False]])
     def testReorderBondingOptions(self, bridged):
@@ -587,7 +586,7 @@
             bonds = {BONDING_NAME: {'nics': nics,
                                     'options': 'lacp_rate=fast mode=802.3ad'}}
 
-            status, msg = self.vdsm_net.setupNetworks(nets, bonds, NOCHK)
+            status, msg = self.setupNetworks(nets, bonds, NOCHK)
             self.assertEqual(status, SUCCESS, msg)
 
             self.assertNetworkExists(NETWORK_NAME, bridged)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f334a7ae2ecd8fc75c05972e37d539cf7c28661
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>


More information about the vdsm-patches mailing list