Hello Dan Kenigsberg, Edward Haas,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/60871

to review the following change.

Change subject: net: use netinfo to split OVS nets and bonds
......................................................................

net: use netinfo to split OVS nets and bonds

Our decision of what should be done with a query (add, edit, remove)
should not be based on expected running configuration (saved in
RunningConfig) but on actual system state reported by netinfo.

Change-Id: I67f80ac27b824b7a07e87165fd43db48b919d957
Bug-Url: https://bugzilla.redhat.com/1195208
Signed-off-by: Petr Horáček <phora...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/57446
Continuous-Integration: Jenkins CI
Reviewed-by: Edward Haas <edwa...@redhat.com>
Reviewed-by: Dan Kenigsberg <dan...@redhat.com>
---
M lib/vdsm/network/ovs/switch.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/60871/1

diff --git a/lib/vdsm/network/ovs/switch.py b/lib/vdsm/network/ovs/switch.py
index 086fbd1..c095bd9 100644
--- a/lib/vdsm/network/ovs/switch.py
+++ b/lib/vdsm/network/ovs/switch.py
@@ -52,16 +52,16 @@
 
 
 def setup(nets, bonds):
-    running_config = RunningConfig()
+    _netinfo = info.get_netinfo()
     nets_to_be_added, nets_to_be_removed = _split_nets_action(
-        nets, running_config.networks)
+        nets, _netinfo['networks'])
     bonds_to_be_added_or_edited, bonds_to_be_removed = _split_bonds_action(
-        bonds, running_config.bonds)
+        bonds, _netinfo['bondings'])
 
     # TODO: remove and add filtered networks
 
 
-def _split_nets_action(nets, configured_nets):
+def _split_nets_action(nets, running_nets):
     # TODO: If a nework is to be edited, we remove it and recreate again.
     # We should implement editation.
     nets_to_be_removed = set()
@@ -70,9 +70,9 @@
     for net, attrs in six.iteritems(nets):
         if 'remove' in attrs:
             nets_to_be_removed.add(net)
-        elif net not in configured_nets:
+        elif net not in running_nets:
             nets_to_be_added[net] = attrs
-        elif attrs != configured_nets.get(net):
+        elif attrs != running_nets.get(net):
             nets_to_be_removed.add(net)
             nets_to_be_added[net] = attrs
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67f80ac27b824b7a07e87165fd43db48b919d957
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Petr Horáček <phora...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Edward Haas <edwa...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to