Sandro Bonazzola has uploaded a new change for review.

Change subject: bin: reduced timeout for --check-liveliness
......................................................................

bin: reduced timeout for --check-liveliness

limited the urlopen timeout to 20 seconds

Change-Id: Ie04f6d90454c1956d1b338efc03b14cbfebe5ee1
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M src/ovirt_hosted_engine_setup/check_liveliness.py
1 file changed, 8 insertions(+), 1 deletion(-)


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

diff --git a/src/ovirt_hosted_engine_setup/check_liveliness.py 
b/src/ovirt_hosted_engine_setup/check_liveliness.py
index 1c96849..acfd218 100644
--- a/src/ovirt_hosted_engine_setup/check_liveliness.py
+++ b/src/ovirt_hosted_engine_setup/check_liveliness.py
@@ -37,6 +37,7 @@
 class LivelinessChecker(base.Base):
 
     DB_UP_RE = re.compile('.*DB Up.*')
+    TIMEOUT = 20
 
     def __init__(self):
         super(LivelinessChecker, self).__init__()
@@ -48,7 +49,12 @@
         )
         isUp = False
         try:
-            with contextlib.closing(urllib2.urlopen(health_url)) as urlObj:
+            with contextlib.closing(
+                urllib2.urlopen(
+                    url=health_url,
+                    timeout=self.TIMEOUT,
+                )
+            ) as urlObj:
                 content = urlObj.read()
                 if content:
                     if self.DB_UP_RE.match(content) is not None:
@@ -96,4 +102,5 @@
         sys.exit(1)
     print _('Hosted Engine is up!')
 
+
 # vim: expandtab tabstop=4 shiftwidth=4


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie04f6d90454c1956d1b338efc03b14cbfebe5ee1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to