Alex Lourie has uploaded a new change for review.

Change subject: packaging: Stop dwhd service before running DB operations
......................................................................

packaging: Stop dwhd service before running DB operations

Change-Id: I3b68b7b48369fbead691acd578fc8f960e644562
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/fedora/setup/engine-upgrade.py
1 file changed, 23 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/7686/1

diff --git a/packaging/fedora/setup/engine-upgrade.py 
b/packaging/fedora/setup/engine-upgrade.py
index 6f0d06e..14553d1 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -604,7 +604,7 @@
         messages.append(MSG_INFO_REPORTS)
 
 
-def stopDbRelatedServices(etlService, notificationService):
+def stopDbRelatedServices(etlService, notificationService, dwhService):
     """
     shut down etl and notifier services
     in order to disconnect any open sessions to the db
@@ -614,7 +614,7 @@
         try:
             etlService.stop(True)
         except:
-            logging.warn("Failed to stop ovirt-engine-etl")
+            logging.warn(MSG_ERR_FAILED_STOP_SERVICE % "ovirt-engine-etl")
             logging.warn(traceback.format_exc())
             messages.append(MSG_ERR_FAILED_STOP_SERVICE % "ovirt-engine-etl")
 
@@ -626,11 +626,19 @@
                 logging.debug("stopping ovirt-engine-notifierd service..")
                 notificationService.stop()
         except:
-            logging.warn("Failed to stop ovirt-engine-notifierd service")
+            logging.warn(MSG_ERR_FAILED_STOP_SERVICE % 
"ovirt-engine-notifierd")
             logging.warn(traceback.format_exc())
             messages.append(MSG_ERR_FAILED_STOP_SERVICE % 
"ovirt-engine-notifierd")
 
-def startDbRelatedServices(etlService, notificationService):
+    if dwhService.isServiceAvailable():
+        try:
+            dwhService.stop(True)
+        except:
+            logging.warn(MSG_ERR_FAILED_STOP_SERVICE % "ovirt-engine-dwhd")
+            logging.warn(traceback.format_exc())
+            messages.append(MSG_ERR_FAILED_STOP_SERVICE % "ovirt-engine-dwhd")
+
+def startDbRelatedServices(etlService, notificationService, dwhService):
     """
     bring back any service we stopped
     we won't start services that are down
@@ -639,14 +647,20 @@
     if etlService.isServiceAvailable():
         (output, rc) = etlService.conditionalStart()
         if rc != 0:
-            logging.warn("Failed to start ovirt-engine-etl")
+            logging.warn(MSG_ERR_FAILED_START_SERVICE % "ovirt-engine-etl")
             messages.append(MSG_ERR_FAILED_START_SERVICE % "ovirt-engine-etl")
 
     if notificationService.isServiceAvailable():
         (output, rc) = notificationService.conditionalStart()
         if rc != 0:
-            logging.warn("Failed to start ovirt-engine-notifierd: exit code 
%d" % rc)
+            logging.warn(MSG_ERR_FAILED_START_SERVICE % 
"ovirt-engine-notifierd")
             messages.append(MSG_ERR_FAILED_START_SERVICE % 
"ovirt-engine-notifierd")
+
+    if dwhService.isServiceAvailable():
+        (output, rc) = dwhService.conditionalStart()
+        if rc != 0:
+            logging.warn(MSG_ERR_FAILED_START_SERVICE % "ovirt-engine-dwhd")
+            messages.append(MSG_ERR_FAILED_START_SERVICE % "ovirt-engine-dwhd")
 
 def unsupportedVersionsPresent(oldversion=UNSUPPORTED_VERSION):
     """ Check whether there are UNSUPPORTED_VERSION
@@ -753,17 +767,18 @@
         # define db connections services
         etlService = utils.Service("ovirt-engine-etl")
         notificationService = utils.Service("ovirt-engine-notifierd")
+        dwhService = utils.Service("ovirt-engine-dwhd")
 
         # check if update is relevant to db update
         if isUpdateRelatedToDb(rhyum):
-            stopDbRelatedServices(etlService, notificationService)
+            stopDbRelatedServices(etlService, notificationService, dwhService)
 
             # Update the db and restore its name back
             runFunc([db.update], MSG_INFO_DB_UPDATE)
             runFunc([[db.rename, basedefs.DB_NAME]], MSG_INFO_RESTORE_DB)
 
             # Bring up any services we shut down before db upgrade
-            startDbRelatedServices(etlService, notificationService)
+            startDbRelatedServices(etlService, notificationService, dwhService)
 
         # post install conf
         runFunc(postFunc, MSG_INFO_RUN_POST)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b68b7b48369fbead691acd578fc8f960e644562
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
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