summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-11 14:38:25 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-24 13:25:47 +0100
commit0eb5a0e0ec2d232d2921ae5f9e8d0885146a5610 (patch)
treed7283a78b9fcf36599c4b2309e7f27f323bc6652 /ipaserver/plugins
parent1e0f98a146ecedf84b8e3e07fbd41a897ddd399d (diff)
downloadfreeipa-0eb5a0e0ec2d232d2921ae5f9e8d0885146a5610.tar.gz
freeipa-0eb5a0e0ec2d232d2921ae5f9e8d0885146a5610.tar.xz
freeipa-0eb5a0e0ec2d232d2921ae5f9e8d0885146a5610.zip
dogtag.py: fix exception logging of JSON data
'read_ca' and 'create_ca' have no logging when exception happened and it masks real reason why it failed. Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/dogtag.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 73c14ed53..142f838e1 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -2116,16 +2116,20 @@ class ra_lightweight_ca(RestClient):
)
try:
return json.loads(resp_body)
- except:
- raise errors.RemoteRetrieveError(reason=_("Response from CA was not valid JSON"))
+ except Exception as e:
+ self.log.debug(e, exc_info=True)
+ raise errors.RemoteRetrieveError(
+ reason=_("Response from CA was not valid JSON"))
def read_ca(self, ca_id):
_status, _resp_headers, resp_body = self._ssldo(
'GET', ca_id, headers={'Accept': 'application/json'})
try:
return json.loads(resp_body)
- except:
- raise errors.RemoteRetrieveError(reason=_("Response from CA was not valid JSON"))
+ except Exception as e:
+ self.log.debug(e, exc_info=True)
+ raise errors.RemoteRetrieveError(
+ reason=_("Response from CA was not valid JSON"))
def read_ca_cert(self, ca_id):
_status, _resp_headers, resp_body = self._ssldo(