Petr Horáček has uploaded a new change for review.

Change subject: hooks: ovs: fix bonded network change problem
......................................................................

hooks: ovs: fix bonded network change problem

When we try to change bonded network, it explodes every time because
of we are trying to remove running_nic which is None.

Now we first check if configuration is changed and then do optional
removal and setup of a nic.

Change-Id: Iecd3a064b4d4a428c61353b1533f8ed4be732c1b
Signed-off-by: Petr Horáček <phora...@redhat.com>
---
M vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/52344/1

diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py 
b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
index 5b291b2..e4a7fd9 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
@@ -101,11 +101,11 @@
         elif running_vlan != vlan:
             commands.extend(['--', 'set', 'port', net, 'tag=%d' % vlan])
     running_nic = running_config.networks[net].get('nic')
-    if running_nic is None:
-        commands.extend(_add_nic_port(net, nic, nets_by_nic))
-    elif running_nic != nic:
-        commands.extend(_del_nic_port(net, running_nic, nets_by_nic))
-        commands.extend(_add_nic_port(net, nic, nets_by_nic))
+    if running_nic != nic:
+        if running_nic is not None:
+            commands.extend(_del_nic_port(net, running_nic, nets_by_nic))
+        elif nic is not None:
+            commands.extend(_add_nic_port(net, nic, nets_by_nic))
 
     running_config.setNetwork(net, attrs)
     return commands


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecd3a064b4d4a428c61353b1533f8ed4be732c1b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phora...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to