Change in vdsm[ovirt-3.5]: addNetwork script: Prevent empty bond and vlan from reaching...

asegurap at redhat.com asegurap at redhat.com
Tue Sep 30 13:49:09 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: addNetwork script: Prevent empty bond and vlan from reaching RunningConfig
......................................................................

addNetwork script: Prevent empty bond and vlan from reaching RunningConfig

The consumers of the addNetwork script pass empty parameters, e.g. ""
in order to fill the positional arguments that the script takes. The
problem with that is that those parameters were being passed to
addNetwork without modification, and that includes the
_alterNetworkConfig wrapper that makes addNetwork requests reach
runningConfig (and eventually PersistentConfig).

Due to the issue above, a stored network could contain entries like
'bonding': '' and 'vlan': '' that would mess with selective network
restoration.

Change-Id: If6d56eefc05cdb7456f80b7ec13d0be8ad087aa3
Bug-Url: https://bugzilla.redhat.com/1144639
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M vdsm/network/api.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/33542/1

diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 0565624..8b37808 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -752,6 +752,12 @@
         kwargs = _parseKwargs(sys.argv[3:])
         if 'nics' in kwargs:
             kwargs['nics'] = kwargs['nics'].split(',')
+        # Remove empty vlan and bonding so that they don't make it to
+        # _alterRunningConfig
+        if 'vlan' in kwargs and kwargs['vlan'] == '':
+            del kwargs['vlan']
+        if 'bonding' in kwargs and kwargs['bonding'] == '':
+            del kwargs['bonding']
         addNetwork(bridge, **kwargs)
     elif sys.argv[1] == 'del':
         bridge = sys.argv[2]


-- 
To view, visit http://gerrit.ovirt.org/33542
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6d56eefc05cdb7456f80b7ec13d0be8ad087aa3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list