summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2013-03-21 17:13:46 +0100
committerMartin Kosek <mkosek@redhat.com>2013-03-21 17:19:52 +0100
commit4f8c88988eb14f59df37750d8be31e45d7ebf55c (patch)
treeb685c348163a903fcfa18c9bcf31a0d52b770001
parentfdfcd2cf2456fce303553d88cbf53067c975d2f3 (diff)
downloadfreeipa-4f8c88988eb14f59df37750d8be31e45d7ebf55c.tar.gz
freeipa-4f8c88988eb14f59df37750d8be31e45d7ebf55c.tar.xz
freeipa-4f8c88988eb14f59df37750d8be31e45d7ebf55c.zip
Process exceptions when talking to Dogtag
The problem is the ca_status() uses an HTTP GET operation to check Dogtag's status. Under some circumstances Dogtag may take a long time to respond, so the HTTP GET may time out much earlier than 2 minutes. And since the above code doesn't catch the exception, the whole loop fails immediately, so it doesn't wait for a full 2 minutes as expected. https://fedorahosted.org/freeipa/ticket/3492
-rw-r--r--ipapython/platform/fedora16.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipapython/platform/fedora16.py b/ipapython/platform/fedora16.py
index 628cad13d..0bf715698 100644
--- a/ipapython/platform/fedora16.py
+++ b/ipapython/platform/fedora16.py
@@ -158,7 +158,10 @@ class Fedora16CAService(Fedora16Service):
timeout = api.env.startup_timeout
op_timeout = time.time() + timeout
while time.time() < op_timeout:
- status = dogtag.ca_status()
+ try:
+ status = dogtag.ca_status()
+ except Exception:
+ status = 'check interrupted'
root_logger.debug('The CA status is: %s' % status)
if status == 'running':
break