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@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]
oVirt Jenkins CI Server has posted comments on this change.
Change subject: addNetwork script: Prevent empty bond and vlan from reaching RunningConfig ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_3.5_network_functional_tests_gerrit/12/ : There was an infra issue, please contact infra@ovirt.org
Dan Kenigsberg has posted comments on this change.
Change subject: addNetwork script: Prevent empty bond and vlan from reaching RunningConfig ......................................................................
Patch Set 1: Code-Review+2
Douglas Schilling Landgraf has posted comments on this change.
Change subject: addNetwork script: Prevent empty bond and vlan from reaching RunningConfig ......................................................................
Patch Set 1: Verified+1
Yaniv Bronhaim has submitted this change and it was merged.
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@redhat.com Reviewed-on: http://gerrit.ovirt.org/33542 Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Douglas Schilling Landgraf dougsland@redhat.com --- M vdsm/network/api.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Douglas Schilling Landgraf: Verified Dan Kenigsberg: Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: addNetwork script: Prevent empty bond and vlan from reaching RunningConfig ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el6-x86_64_merged/26/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc19-x86_64_merged/22/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc20-x86_64_merged/21/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el7-x86_64_merged/26/ : SUCCESS
vdsm-patches@lists.fedorahosted.org