Alex Lourie has uploaded a new change for review.

Change subject: packaging: setup: improve dwhd service handling
......................................................................

packaging: setup: improve dwhd service handling

The new implementation adds dwhd service to init levels
using chkconfig call, also updates the stopping/starting
it similar to engine and postgres services.

Change-Id: I8c31f2cc75a5f4805bd53da1ffc23c71cf856bc6
Bug-Url: https://bugzilla.redhat.com/1022550
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/common_utils.py
1 file changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/91/20991/1

diff --git a/packaging/common_utils.py b/packaging/common_utils.py
index 18aa32d..e588df2 100755
--- a/packaging/common_utils.py
+++ b/packaging/common_utils.py
@@ -533,13 +533,23 @@
     postgres_service = Service('postgresql')
     postgres_service.stop()
 
+def isEtlUp():
+    '''
+    checks if the dwhd  service is up and running
+    '''
+    logging.debug("checking the status of dwhd")
+    etl_service = Service('ovirt-engine-dwhd')
+    etl_service.status()
+    return etl_service.lastStateUp
+
 def stopEtl():
     """
     stop the ovirt-engine-dwhd service
     """
     logging.debug("Stopping ovirt-engine-dwhd")
-    etl_service = Service('ovirt-engine-dwhd')
-    etl_service.stop()
+    if isEtlUp():
+        etl_service = Service('ovirt-engine-dwhd')
+        etl_service.stop()
 
 @transactionDisplay("Starting oVirt-ETL")
 def startEtl():
@@ -547,7 +557,9 @@
     starts the ovirt-engine-dwhd service
     '''
     etl_service = Service('ovirt-engine-dwhd')
-    etl_service.conditionalStart()
+    etl_service.autoStart()
+    if not isEtlUp():
+        etl_service.start()
 
 def copyFile(source, destination):
     '''


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c31f2cc75a5f4805bd53da1ffc23c71cf856bc6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-dwh
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to