Alex Lourie has uploaded a new change for review.

Change subject: packaging: setup: added a test on postgres status
......................................................................

packaging: setup: added a test on postgres status

It covers for cases where the postgresql service reports
status up but the server is not ready to receive connections.
In such cases the setup fails on DB operations.

This patch updates the change introduced by patch c048ec2d942c

Change-Id: I9b5c6ebadb03077e9173e64548883407ca69b502
Bug-Url: https://bugzilla.redhat.com/1029969
Signed-off-by: Alex Lourie <alou...@redhat.com>
---
M packaging/common_utils.py
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/73/21573/1

diff --git a/packaging/common_utils.py b/packaging/common_utils.py
index fba9c71..74cd583 100755
--- a/packaging/common_utils.py
+++ b/packaging/common_utils.py
@@ -512,16 +512,16 @@
     postgres_service = Service('postgresql')
     postgres_service.status()
 
+    return postgres_service.lastStateUp
+
+def isPostgresServerUp():
     output, rc = runPostgresSuQuery(
         query='"select 1;"',
         database='template1',
         failOnError=False,
     )
 
-    return (
-        postgres_service.lastStateUp and
-        rc == 0
-    )
+    return rc == 0
 
 def startPostgres():
     '''
@@ -531,7 +531,7 @@
         startPostgresService()
 
     for i in range(0, POSTGRES_START_CYCLES):
-        if isPostgresUp():
+        if isPostgresServerUp():
             break
         time.sleep(2)
     else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b5c6ebadb03077e9173e64548883407ca69b502
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-dwh
Gerrit-Branch: ovirt-3.3.1
Gerrit-Owner: Alex Lourie <alou...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to