Hello Fabian Deutsch,

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

    http://gerrit.ovirt.org/23081

to review the following change.

Change subject: Use Management class to pass informations
......................................................................

Use Management class to pass informations

Use Management class from ovirt node to provide information
to users.

Change-Id: I441375ea4f7e18b55a7e4d8a7f661e067598de30
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1048929
Signed-off-by: Fabian Deutsch <fabi...@fedoraproject.org>
Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>
---
M src/engine_page.py
1 file changed, 17 insertions(+), 1 deletion(-)


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

diff --git a/src/engine_page.py b/src/engine_page.py
index 679b8f9..3b1cba4 100644
--- a/src/engine_page.py
+++ b/src/engine_page.py
@@ -19,7 +19,7 @@
 # MA  02110-1301, USA.  A copy of the GNU General Public License is
 # also available at http://www.gnu.org/copyleft/gpl.html.
 from ovirt.node import plugins, valid, ui, utils, app, exceptions
-from ovirt.node.config.defaults import NodeConfigFileSection, SSH
+from ovirt.node.config.defaults import NodeConfigFileSection, SSH, Management
 from ovirt.node.plugins import Changeset
 from . import config
 import logging
@@ -34,6 +34,7 @@
 
 
 LOGGER = logging.getLogger(__name__)
+MGMT_IFACES = ('ovirtmgmt', 'rhevm')
 
 
 class Plugin(plugins.NodePlugin):
@@ -348,11 +349,26 @@
             self.logger.info("Starting vdsm-reg service")
             deployUtil._logExec([constants.EXT_SERVICE, 'vdsm-reg', 'start'])
 
+            mgmtInterface = []
+            for iface in MGMT_IFACES:
+                if os.path.exists('/sys/class/net/' + iface):
+                    mgmtInterface = [iface]
+                    break
+
+            mgmt = Management()
+            mgmt.update("oVirt Engine http://%s:%s"; % (cfg["server"],
+                                                       cfg["port"]),
+                        mgmtInterface,
+                        None)
+
             msgConf = "{engine_name} Configuration Successfully " \
                 " Updated".format(
                     engine_name=config.engine_name)
             self.logger.debug(msgConf)
         else:
+            mgmt = Management()
+            mgmt.clear()
+
             msgConf = "{engine_name} Configuration Failed".format(
                 engine_name=config.engine_name)
             raise RuntimeError(msgConf)


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

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

Reply via email to