Darshan N has uploaded a new change for review.

Change subject: gluster: Plugin under gluster for glusterpmd configuration.
......................................................................

gluster: Plugin under gluster for glusterpmd configuration.

Addition of new plugin glusterpmd(gluster process monitoring
daemon) under gluster. This plugin starts the glusterpmd during
host deploy if monitoring is enabled.

Change-Id: I9d8f3026740be567684e13f08324a7c36be40b26
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1138198
Signed-off-by: ndarshan <dnara...@redhat.com>
---
M ChangeLog
M src/plugins/ovirt-host-deploy/gluster/Makefile.am
M src/plugins/ovirt-host-deploy/gluster/__init__.py
A src/plugins/ovirt-host-deploy/gluster/glusterpmd.py
4 files changed, 64 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-host-deploy 
refs/changes/97/34697/1

diff --git a/ChangeLog b/ChangeLog
index de87235..fabd7dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 ????-??-?? - Version 1.2.4
 
+ * gluster: glusterpmd: support for glusterpmd configuration.
+   rhbz#1138198.
 
 2014-09-03 - Version 1.2.3
 
diff --git a/src/plugins/ovirt-host-deploy/gluster/Makefile.am 
b/src/plugins/ovirt-host-deploy/gluster/Makefile.am
index d84e4c3..ef0c03a 100644
--- a/src/plugins/ovirt-host-deploy/gluster/Makefile.am
+++ b/src/plugins/ovirt-host-deploy/gluster/Makefile.am
@@ -28,6 +28,7 @@
        __init__.py \
         nrpe.py \
        packages.py \
+       glusterpmd.py \
        $(NULL)
 
 clean-local: \
diff --git a/src/plugins/ovirt-host-deploy/gluster/__init__.py 
b/src/plugins/ovirt-host-deploy/gluster/__init__.py
index c3ebf24..fc447fa 100644
--- a/src/plugins/ovirt-host-deploy/gluster/__init__.py
+++ b/src/plugins/ovirt-host-deploy/gluster/__init__.py
@@ -26,12 +26,14 @@
 
 from . import packages
 from . import nrpe
+from . import glusterpmd
 
 
 @util.export
 def createPlugins(context):
     packages.Plugin(context=context)
     nrpe.Plugin(context=context)
+    glusterpmd.Plugin(context=context)
 
 
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/plugins/ovirt-host-deploy/gluster/glusterpmd.py 
b/src/plugins/ovirt-host-deploy/gluster/glusterpmd.py
new file mode 100644
index 0000000..074993f
--- /dev/null
+++ b/src/plugins/ovirt-host-deploy/gluster/glusterpmd.py
@@ -0,0 +1,59 @@
+#
+# ovirt-host-deploy -- ovirt host deployer
+# Copyright (C) 2012-2014 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+"""glusterpmd plugin."""
+
+
+import gettext
+_ = lambda m: gettext.dgettext(message=m, domain='ovirt-host-deploy')
+
+
+from otopi import util
+from otopi import plugin
+
+
+from ovirt_host_deploy import constants as odeploycons
+
+
+@util.export
+class Plugin(plugin.PluginBase):
+    """glusterpmd plugin"""
+
+    def __init__(self, context):
+        super(Plugin, self).__init__(context=context)
+
+    @plugin.event(
+        stage=plugin.Stages.STAGE_CLOSEUP,
+        condition=lambda self: (
+            self.environment[
+                odeploycons.GlusterEnv.MONITORING_ENABLE
+            ] and
+            self.environment[
+                odeploycons.GlusterEnv.ENABLE
+            ]
+        )
+    )
+    def _closeup(self):
+        if self.services.exists('glusterpmd'):
+            self.logger.info(_('Starting glusterpmd service'))
+            self.services.state('glusterpmd', True)
+
+
+# vim: expandtab tabstop=4 shiftwidth=4


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d8f3026740be567684e13f08324a7c36be40b26
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-host-deploy
Gerrit-Branch: ovirt-host-deploy-1.2
Gerrit-Owner: Darshan N <dnara...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to