Alex Lourie has uploaded a new change for review.

Change subject: packaging: setup: update postgres service restart functionality
......................................................................

packaging: setup: update postgres service restart functionality

Change-Id: I3aab88dfd754798515419453ddae77939c5915d3
Related-To: https://bugzilla.redhat.com/1029969
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/common_utils.py
1 file changed, 11 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/55/21655/1

diff --git a/packaging/common_utils.py b/packaging/common_utils.py
index 74cd583..28f50b5 100755
--- a/packaging/common_utils.py
+++ b/packaging/common_utils.py
@@ -527,8 +527,7 @@
     '''
     starts the postgresql service
     '''
-    if not isPostgresUp():
-        startPostgresService()
+    startPostgresService()
 
     for i in range(0, POSTGRES_START_CYCLES):
         if isPostgresServerUp():
@@ -547,9 +546,10 @@
         stopPostgresService()
 
 def startPostgresService():
-    logging.debug("starting postgresql")
-    postgres_service = Service('postgresql')
-    postgres_service.start()
+    if not isPostgresUp():
+        logging.debug("starting postgresql")
+        postgres_service = Service('postgresql')
+        postgres_service.start()
 
 def stopPostgresService():
     logging.debug("stopping postgresql")
@@ -833,9 +833,12 @@
                 )
 
 
-def restartPostgres():
+def restartPostgres(skipCheck=False):
     stopPostgres()
-    startPostgres()
+    if skipCheck:
+        startPostgresService()
+    else:
+        startPostgres()
 
 #TODO: Move all execution commands to execCmd
 def execCmd(
@@ -1335,7 +1338,7 @@
     with open(FILE_PG_HBA, 'w') as pghba:
         pghba.write('\n'.join(content))
 
-    restartPostgres()
+    restartPostgres(newval=='md5')
     return True
 
 def setPgHbaIdent():


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

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