Alex Lourie has uploaded a new change for review.

Change subject: packaging: Added functions references for cleaner code.
......................................................................

packaging: Added functions references for cleaner code.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/7465/1

diff --git a/packaging/fedora/setup/engine-upgrade.py 
b/packaging/fedora/setup/engine-upgrade.py
index a8e7c44..4a057bd 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -707,6 +707,12 @@
     db = DB()
     DB_NAME_TEMP = "%s_%s" % (basedefs.DB_NAME, utils.getCurrentDateTime())
 
+   # Functions/parameters definitions
+    stopEngineService = [stopEngine]
+    upgradeFunc = [rhyum.update]
+    postFunc = [runPost]
+    engineService = basedefs.ENGINE_SERVICE_NAME
+
     if unsupportedVersionsPresent():
         print MSG_ERROR_INCOMPATIBLE_UPGRADE
         raise Exception(MSG_ERROR_INCOMPATIBLE_UPGRADE)
@@ -741,9 +747,9 @@
     # No rollback in this case
     try:
         # We ask the user before stoping jboss or take command line option
-        if options.unattended_upgrade or checkJbossService():
+        if options.unattended_upgrade or checkJbossService(engineService):
             # Stopping engine
-            runFunc([stopEngine], MSG_INFO_STOP_JBOSS)
+            runFunc([stopEngineService], MSG_INFO_STOP_JBOSS)
         else:
             # This means that user chose not to stop jboss
             logging.debug("exiting gracefully")
@@ -762,7 +768,7 @@
     # In case of failure, do rollback
     try:
         # yum update
-        runFunc([rhyum.update], MSG_INFO_YUM_UPDATE)
+        runFunc([upgradeFunc], MSG_INFO_YUM_UPDATE)
 
         # define db connections services
         etlService = utils.Service("ovirt-engine-etl")
@@ -780,7 +786,7 @@
             startDbRelatedServices(etlService, notificationService)
 
         # post install conf
-        runFunc([runPost], MSG_INFO_RUN_POST)
+        runFunc([postFunc], MSG_INFO_RUN_POST)
 
     except:
         logging.error(traceback.format_exc())


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8fec87bf8dc99e990cb62d85e2915246f38fbac
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