Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: ensure engine is up
......................................................................

packaging: setup: ensure engine is up

Consider engine up only if the answer match
db up response.
Avoids to try adding the host if the engine
is not fully up.

Change-Id: I4726a868d81d7f316585d7554c32ee728611875a
Signed-off-by: Sandro Bonazzola <sbona...@redhat.com>
---
M src/plugins/ovirt-hosted-engine-setup/engine/health.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/57/16757/1

diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/health.py 
b/src/plugins/ovirt-hosted-engine-setup/engine/health.py
index cd0cc34..a1ef076 100644
--- a/src/plugins/ovirt-hosted-engine-setup/engine/health.py
+++ b/src/plugins/ovirt-hosted-engine-setup/engine/health.py
@@ -25,6 +25,7 @@
 
 import contextlib
 import gettext
+import re
 import urllib2
 
 
@@ -44,6 +45,8 @@
     engine health status handler plugin.
     """
 
+    DB_UP_RE = re.compile('.*DB Up.*')
+
     def __init__(self, context):
         super(Plugin, self).__init__(context=context)
 
@@ -59,12 +62,13 @@
             with contextlib.closing(urllib2.urlopen(health_url)) as urlObj:
                 content = urlObj.read()
                 if content:
+                    if self.DB_UP_RE.match(content) is not None:
+                        isUp = True
                     self.logger.info(
-                        _('Engine is up with status: {status}').format(
+                        _('Engine replied: {status}').format(
                             status=content,
                         )
                     )
-                    isUp = True
         except urllib2.URLError:
             self.logger.error(_('Engine is still unreachable'))
         return isUp


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4726a868d81d7f316585d7554c32ee728611875a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to