Ido Barkan has uploaded a new change for review.
Change subject: do not delete networks from parameters ......................................................................
do not delete networks from parameters
Change-Id: I546c7f196f4b6bdace528a0cbbe6cfe5a212bfe1 Signed-off-by: ibarkan ibarkan@redhat.com --- M vdsm/network/api.py 1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/35690/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py index 434ce3d..6843789 100755 --- a/vdsm/network/api.py +++ b/vdsm/network/api.py @@ -668,6 +668,10 @@
logger.debug("Applying...") with ConfiguratorClass(options.get('_inRollback', False)) as configurator: + networks_to_add = dict( + (net, attributes) + for net, attributes in networks.iteritems() + if 'remove' not in attributes) # Remove edited networks and networks with 'remove' attribute for network, attrs in networks.items(): if network in _netinfo.networks: @@ -675,7 +679,6 @@ delNetwork(network, configurator=configurator, force=force, implicitBonding=False, _netinfo=_netinfo) if 'remove' in attrs: - del networks[network] del libvirt_nets[network] _netinfo.updateDevices() del _netinfo.networks[network] @@ -687,7 +690,6 @@ _delBrokenNetwork(network, libvirt_nets[network], configurator=configurator) if 'remove' in attrs: - del networks[network] del libvirt_nets[network] _netinfo.updateDevices() elif 'remove' in attrs: @@ -701,7 +703,7 @@
# We need to use the newest host info _netinfo.updateDevices() - for network, attrs in networks.iteritems(): + for network, attrs in networks_to_add.iteritems(): d = dict(attrs) if 'bonding' in d: d.update(_buildBondOptions(d['bonding'], bondings, _netinfo))