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
This commit is contained in:
Alexander Bokovoy 2013-03-06 10:17:58 +02:00 committed by Martin Kosek
parent 1336b39906
commit 41031fe121

View File

@ -136,7 +136,10 @@ class Fedora16CAService(Fedora16Service):
timeout = api.env.startup_timeout timeout = api.env.startup_timeout
op_timeout = time.time() + timeout op_timeout = time.time() + timeout
while time.time() < op_timeout: while time.time() < op_timeout:
try:
status = dogtag.ca_status() status = dogtag.ca_status()
except Exception:
status = 'check interrupted'
root_logger.debug('The CA status is: %s' % status) root_logger.debug('The CA status is: %s' % status)
if status == 'running': if status == 'running':
break break