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 <[email protected]>
---
M src/engine_page.py
1 file changed, 11 insertions(+), 7 deletions(-)


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

diff --git a/src/engine_page.py b/src/engine_page.py
index 2910cca..6a0c54b 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
 """
@@ -41,20 +43,22 @@
        FIXME: Autoinstall should write MANAGED_BY and MANAGED_IFNAMES
        into /etc/defaults/ovirt
     """
-    MGMT_IFACES = ('ovirtmgmt', 'rhevm')
     cfg = VDSM().retrieve()
+    networks = netinfo.networks()
 
-    mgmtInterface = []
-    for iface in MGMT_IFACES:
-        if os.path.exists('/sys/class/net/' + iface):
-            mgmtInterface = [iface]
-            break
+    mgmtIface = []
+    for net in networks:
+        if net in ('ovirtmgmt', 'rhevm'):
+            if 'bridge' in networks[net]:
+                mgmtIface = [networks[net]['bridge']]
+            else:
+                mgmtIface = [networks[net]['iface']]
 
     mgmt = Management()
     mgmt.update(
         "oVirt Engine http://%s:%s"; % (cfg["server"],
                                        cfg["port"]),
-        mgmtInterface,
+        mgmtIface,
         None
     )
 


-- 
To view, visit http://gerrit.ovirt.org/24587
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: node-3.0
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to