From a808013629d4b4de886ec1563daebf6ea5138f0c Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 8 Aug 2016 19:19:16 +0200 Subject: 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 --- .../python/pki/server/deployment/pkihelper.py | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'base/server/python') 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 -- cgit