mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
1e0f98a146
commit
0eb5a0e0ec
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user