From 2db074c39334a6ec48a6fac52722f684a14bb00a Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 8 May 2015 01:09:47 -0400 Subject: Fixed installation logs. To help troubleshooting installation failures the pkihelper.py has been modified to display the error code returned by the server before parsing the error message. If there is a parsing error, the unparsed message will now be displayed. The redundant 'raise' and 'return' statements have been removed. --- base/server/python/pki/server/deployment/pkihelper.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 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 4a8398afc..1521ef339 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -3693,8 +3693,19 @@ class ConfigClient: self.process_admin_cert(admin_cert) except Exception, e: + config.pki_log.error( + log.PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION + " " + str(e), + extra=config.PKI_INDENTATION_LEVEL_2) + if hasattr(e, 'response'): - root = ET.fromstring(e.response.text) + try: + root = ET.fromstring(e.response.text) + except ET.ParseError, pe: + config.pki_log.error( + "ParseError: %s: %s " % (pe, e.response.text), + extra=config.PKI_INDENTATION_LEVEL_2) + raise + if root.tag == 'PKIException': message = root.findall('.//Message')[0].text if message is not None: @@ -3702,12 +3713,8 @@ class ConfigClient: log.PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION + " " + message, extra=config.PKI_INDENTATION_LEVEL_2) - raise - config.pki_log.error( - log.PKI_CONFIG_JAVA_CONFIGURATION_EXCEPTION + " " + str(e), - extra=config.PKI_INDENTATION_LEVEL_2) + raise - return def process_admin_cert(self, admin_cert): config.pki_log.debug( -- cgit