summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-11-22 10:27:34 -0500
committerSimo Sorce <ssorce@redhat.com>2010-11-24 08:39:00 -0500
commit0ad0f4ba6cc54e44be5b49d67118087dee4851ea (patch)
tree0bca42625ca2e48d94e39b20667e9f1c5b9b313d /ipapython
parent97e9309db3708e839bd54bef442bf7296284eac6 (diff)
downloadfreeipa-0ad0f4ba6cc54e44be5b49d67118087dee4851ea.tar.gz
freeipa-0ad0f4ba6cc54e44be5b49d67118087dee4851ea.tar.xz
freeipa-0ad0f4ba6cc54e44be5b49d67118087dee4851ea.zip
Catch when we fail to get a cert chain from the CA during installation
Also don't free the XML document if it was never created. ticket 404
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/dogtag.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index 96d9469d0..014127e04 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -37,6 +37,7 @@ def get_ca_certchain(ca_host=None):
conn = httplib.HTTPConnection(ca_host, api.env.ca_port)
conn.request("GET", "/ca/ee/ca/getCertChain")
res = conn.getresponse()
+ doc = None
if res.status == 200:
data = res.read()
conn.close()
@@ -53,7 +54,10 @@ def get_ca_certchain(ca_host=None):
except Exception, e:
raise errors.RemoteRetrieveError(reason="Retrieving CA cert chain failed: %s" % str(e))
finally:
- doc.unlink()
+ if doc:
+ doc.unlink()
+ else:
+ raise errors.RemoteRetrieveError(reason="request failed with HTTP status %d" % res.status)
return chain