diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-08-08 19:19:16 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-08-08 21:48:14 +0200 |
commit | a808013629d4b4de886ec1563daebf6ea5138f0c (patch) | |
tree | 40154b474e1439630c433bb7497d18a1f97aef85 /base/server/python/pki/server | |
parent | a38b8b875e40d0d8551752af7aa2567d2891384a (diff) | |
download | pki-a808013629d4b4de886ec1563daebf6ea5138f0c.tar.gz pki-a808013629d4b4de886ec1563daebf6ea5138f0c.tar.xz pki-a808013629d4b4de886ec1563daebf6ea5138f0c.zip |
Improved SystemConfigService.configure() error message.
The pkispawn has been modified to improve the way it displays the
error message returned by SystemConfigService.configure(). If the
method throws a PKIException, the response is returned as a JSON
message, so pkispawn will parse it and display the actual error
message. For other exceptions pkispawn will display the entire
HTML message returned by Tomcat.
https://fedorahosted.org/pki/ticket/2399
Diffstat (limited to 'base/server/python/pki/server')
-rw-r--r-- | base/server/python/pki/server/deployment/pkihelper.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py index 8a1dbddb5..b6eacf1ce 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -3959,28 +3959,7 @@ class ConfigClient: admin_cert = response['adminCert']['cert'] self.process_admin_cert(admin_cert) - except Exception as e: - config.pki_log.error( - log.PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION + " " + str(e), - extra=config.PKI_INDENTATION_LEVEL_2) - - if hasattr(e, 'response'): - text = e.response.text # pylint: disable=E1101 - try: - root = ET.fromstring(text) - except ET.ParseError as pe: - config.pki_log.error( - "ParseError: %s: %s " % (pe, text), - extra=config.PKI_INDENTATION_LEVEL_2) - raise - - if root.tag == 'PKIException': - message = root.findall('.//Message')[0].text - if message is not None: - config.pki_log.error( - log.PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION + " " + - message, - extra=config.PKI_INDENTATION_LEVEL_2) + except: raise |