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

Change subject: net: access network caps via network API
......................................................................

net: access network caps via network API

With OVS, caps will be mixed from OVS netinfo, legacy netinfo and
nics netinfo (legacy and nics are now included in netinfo.cache.get).

Let's access netinfo from network API as we should move netinfo package
here as well. In API we will have centralized control of netinfo
mixing, faking,...

Change-Id: Icfce0d2fe741e89a3ca54b58c9738ce33495ec92
Signed-off-by: Petr Horáček <phora...@redhat.com>
---
M lib/vdsm/network/api.py
M vdsm/caps.py
2 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/57402/1

diff --git a/lib/vdsm/network/api.py b/lib/vdsm/network/api.py
index a2388ba..f3dca84 100644
--- a/lib/vdsm/network/api.py
+++ b/lib/vdsm/network/api.py
@@ -29,6 +29,7 @@
 import six
 
 from vdsm.config import config
+from vdsm.netinfo import cache as netinfo_cache
 from vdsm import commands
 from vdsm import constants
 from vdsm import hooks
@@ -45,7 +46,8 @@
 
 def caps_networks():
     """Complement existing non-root caps"""
-    return {}
+    # TODO: Version requests by engine to ease handling of compatibility.
+    return netinfo_cache.get(compatibility=30600)
 
 
 def _wait_for_udev_events():
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 66eb245..0a0e45a 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -27,7 +27,6 @@
 import libvirt
 
 from vdsm.config import config
-from vdsm.netinfo import cache as netinfo_cache
 from vdsm import cpuarch
 from vdsm import cpuinfo
 from vdsm import dsaversion
@@ -161,12 +160,7 @@
 
     caps.update(_getVersionInfo())
 
-    # TODO: Version requests by engine to ease handling of compatibility.
-    netinfo_data = netinfo_cache.get(compatibility=30600)
-    caps.update(netinfo_data)
-
-    super_caps_networks = supervdsm.getProxy().caps_networks()
-    caps.update(super_caps_networks)
+    caps.update(supervdsm.getProxy().caps_networks())
 
     try:
         caps['hooks'] = hooks.installed()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfce0d2fe741e89a3ca54b58c9738ce33495ec92
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