Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: engine_page: use vdsm to detect mgmt interface
......................................................................

engine_page: use vdsm to detect mgmt interface

Replace the method to detect the mgmt interface by VDSM.

Change-Id: I9e1b69c0f465f1e38779e451777cae67bd4cde40
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1058257
Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>
---
M src/engine_page.py
1 file changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node-plugin-vdsm 
refs/changes/17/24417/1

diff --git a/src/engine_page.py b/src/engine_page.py
index 8e7d488..d548fc1 100644
--- a/src/engine_page.py
+++ b/src/engine_page.py
@@ -29,6 +29,8 @@
 from ovirt.node.config.defaults import NodeConfigFileSection, SSH, Management
 from ovirt.node.plugins import Changeset
 
+from vdsm import netinfo
+
 """
 Configure Engine
 """
@@ -42,20 +44,21 @@
        FIXME: Autoinstall should write MANAGED_BY and MANAGED_IFNAMES
        into /etc/defaults/ovirt
     """
-    MGMT_IFACES = ('ovirtmgmt', 'rhevm')
     cfg = VDSM().retrieve()
+    nets = netinfo.networks()
 
-    mgmtInterface = []
-    for iface in MGMT_IFACES:
-        if os.path.exists('/sys/class/net/' + iface):
-            mgmtInterface = [iface]
-            break
+    mgmtIface = []
+    if 'rhevm' in nets:
+        mgmtIface = [nets['rhevm'].get('iface', nets['rhevm']['bridge'])]
+    elif 'ovirtmgmt' in nets:
+        mgmtIface = [nets['ovirtmgmt'].get('iface',
+                                           nets['ovirtmgmt']['bridge'])]
 
     mgmt = Management()
     mgmt.update(
         "oVirt Engine http://%s:%s"; % (cfg["server"],
                                        cfg["port"]),
-        mgmtInterface,
+        mgmtIface,
         None
     )
 


-- 
To view, visit http://gerrit.ovirt.org/24417
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e1b69c0f465f1e38779e451777cae67bd4cde40
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node-plugin-vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to