From 41031fe121d6ec8bc9a6bb48b62068a9af905dc3 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 6 Mar 2013 10:17:58 +0200 Subject: 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 --- ipapython/platform/fedora16/service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipapython') diff --git a/ipapython/platform/fedora16/service.py b/ipapython/platform/fedora16/service.py index c2e35d32..dac8c004 100644 --- a/ipapython/platform/fedora16/service.py +++ b/ipapython/platform/fedora16/service.py @@ -136,7 +136,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 -- cgit