summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2014-11-18 19:49:15 +0100
committerJan Cholasta <jcholast@redhat.com>2014-12-10 16:59:56 +0000
commit337faf506462a01c6dbcd00f2039ed5627691864 (patch)
treec8996b70536e5f6d28a7951d7d244ad502d6e42f /ipapython
parent6d3403edacbf547c31085acb0d542ec7f56c6e90 (diff)
downloadfreeipa-337faf506462a01c6dbcd00f2039ed5627691864.tar.gz
freeipa-337faf506462a01c6dbcd00f2039ed5627691864.tar.xz
freeipa-337faf506462a01c6dbcd00f2039ed5627691864.zip
Using wget to get status of CA
This is just workaround Ticket: https://fedorahosted.org/freeipa/ticket/4676 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/dogtag.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index 67180d59b..3d70bccfc 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -193,6 +193,16 @@ def get_ca_certchain(ca_host=None, dogtag_constants=None):
return chain
+def _parse_ca_status(body):
+ doc = xml.dom.minidom.parseString(body)
+ try:
+ item_node = doc.getElementsByTagName("XMLResponse")[0]
+ item_node = item_node.getElementsByTagName("Status")[0]
+ return item_node.childNodes[0].data
+ except IndexError:
+ raise error_from_xml(doc, _("Retrieving CA status failed: %s"))
+
+
def ca_status(ca_host=None, use_proxy=True):
"""Return the status of the CA, and the httpd proxy in front of it
@@ -216,13 +226,7 @@ def ca_status(ca_host=None, use_proxy=True):
elif status != 200:
raise errors.RemoteRetrieveError(
reason=_("Retrieving CA status failed: %s") % reason)
- doc = xml.dom.minidom.parseString(body)
- try:
- item_node = doc.getElementsByTagName("XMLResponse")[0]
- item_node = item_node.getElementsByTagName("Status")[0]
- return item_node.childNodes[0].data
- except IndexError:
- raise error_from_xml(doc, _("Retrieving CA status failed: %s"))
+ return _parse_ca_status(body)
def https_request(host, port, url, secdir, password, nickname, **kw):