summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-05-08 01:09:47 -0400
committerEndi S. Dewata <edewata@redhat.com>2015-05-08 14:59:02 -0400
commit2db074c39334a6ec48a6fac52722f684a14bb00a (patch)
treec2b713cc88a458c0b1a5b37819e64eabf214b93d
parent398aa8aca0505ce3d310c621661907693fd76e6d (diff)
downloadpki-2db074c39334a6ec48a6fac52722f684a14bb00a.tar.gz
pki-2db074c39334a6ec48a6fac52722f684a14bb00a.tar.xz
pki-2db074c39334a6ec48a6fac52722f684a14bb00a.zip
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.
-rw-r--r--base/server/python/pki/server/deployment/pkihelper.py19
1 files changed, 13 insertions, 6 deletions
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(