diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-13 23:00:07 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-14 12:47:40 -0500 |
commit | 65bbd0047143141b8d2d031dcf452aaeded8e8cf (patch) | |
tree | 4985285548ac390f9966a948fea63fd0948933e6 /base/deploy/src/scriptlets/pkiparser.py | |
parent | d5bc2ead8c73943c0053198fb3ba9959a78b2b41 (diff) | |
download | pki-65bbd0047143141b8d2d031dcf452aaeded8e8cf.tar.gz pki-65bbd0047143141b8d2d031dcf452aaeded8e8cf.tar.xz pki-65bbd0047143141b8d2d031dcf452aaeded8e8cf.zip |
Refactored log variables in pkiconfig.py.
The log variables in pkiconfig.py have been moved into pkilogging.py
for better clarity.
Ticket #380
Diffstat (limited to 'base/deploy/src/scriptlets/pkiparser.py')
-rw-r--r-- | base/deploy/src/scriptlets/pkiparser.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index 971c64040..9ac4be2ae 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -33,6 +33,7 @@ import time # PKI Deployment Imports import pkiconfig as config from pkiconfig import PKIConfig +import pkilogging import pkimessages as log @@ -111,17 +112,17 @@ class PKIConfigParser: # Process 'Optional' command-line options # '-v' if args.pki_verbosity == 1: - config.pki_jython_log_level = PKIConfig.PKI_JYTHON_INFO_LOG_LEVEL - config.pki_console_log_level = logging.INFO - config.pki_log_level = logging.INFO + pkilogging.pki_jython_log_level = PKIConfig.PKI_JYTHON_INFO_LOG_LEVEL + pkilogging.pki_console_log_level = logging.INFO + pkilogging.pki_log_level = logging.INFO elif args.pki_verbosity == 2: - config.pki_jython_log_level = PKIConfig.PKI_JYTHON_INFO_LOG_LEVEL - config.pki_console_log_level = logging.INFO - config.pki_log_level = logging.DEBUG + pkilogging.pki_jython_log_level = PKIConfig.PKI_JYTHON_INFO_LOG_LEVEL + pkilogging.pki_console_log_level = logging.INFO + pkilogging.pki_log_level = logging.DEBUG elif args.pki_verbosity == 3: - config.pki_jython_log_level = PKIConfig.PKI_JYTHON_DEBUG_LOG_LEVEL - config.pki_console_log_level = logging.DEBUG - config.pki_log_level = logging.DEBUG + pkilogging.pki_jython_log_level = PKIConfig.PKI_JYTHON_DEBUG_LOG_LEVEL + pkilogging.pki_console_log_level = logging.DEBUG + pkilogging.pki_log_level = logging.DEBUG elif args.pki_verbosity > 3: print "ERROR: " + log.PKI_VERBOSITY_LEVELS_MESSAGE print @@ -129,9 +130,9 @@ class PKIConfigParser: parser.exit(-1); else: # Set default log levels - config.pki_jython_log_level = PKIConfig.PKI_JYTHON_WARNING_LOG_LEVEL - config.pki_console_log_level = logging.WARNING - config.pki_log_level = logging.INFO + pkilogging.pki_jython_log_level = PKIConfig.PKI_JYTHON_WARNING_LOG_LEVEL + pkilogging.pki_console_log_level = logging.WARNING + pkilogging.pki_log_level = logging.INFO # Process 'Test' command-line options # '-p' if not args.pki_root_prefix is None: @@ -262,7 +263,7 @@ class PKIConfigParser: config.pki_master_dict['pki_dns_domainname'] =\ config.pki_dns_domainname config.pki_master_dict['pki_jython_log_level'] =\ - config.pki_jython_log_level + pkilogging.pki_jython_log_level config.pki_master_dict['pki_deployment_cfg'] = config.pkideployment_cfg config.pki_master_dict['pki_deployed_instance_name'] =\ config.pki_deployed_instance_name @@ -2342,11 +2343,11 @@ class PKIConfigParser: "pki-tomcatd" + "@" +\ config.pki_master_dict['pki_instance_id'] + "." + "service" except OSError as exc: - config.pki_log.error(log.PKI_OSERROR_1, exc, + pkilogging.pki_log.error(log.PKI_OSERROR_1, exc, extra=PKIConfig.PKI_INDENTATION_LEVEL_2) sys.exit(1) except KeyError as err: - config.pki_log.error(log.PKIHELPER_DICTIONARY_MASTER_MISSING_KEY_1, + pkilogging.pki_log.error(log.PKIHELPER_DICTIONARY_MASTER_MISSING_KEY_1, err, extra=PKIConfig.PKI_INDENTATION_LEVEL_2) sys.exit(1) return |