summaryrefslogtreecommitdiffstats
path: root/base/deploy/src/scriptlets/pkiparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'base/deploy/src/scriptlets/pkiparser.py')
-rw-r--r--base/deploy/src/scriptlets/pkiparser.py59
1 files changed, 16 insertions, 43 deletions
diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py
index a994259..520aabe 100644
--- a/base/deploy/src/scriptlets/pkiparser.py
+++ b/base/deploy/src/scriptlets/pkiparser.py
@@ -219,7 +219,22 @@ class PKIConfigParser:
"Read configuration file sections into dictionaries"
rv = 0
try:
- self.pki_config = ConfigParser.ConfigParser()
+ if config.pki_subsystem in config.PKI_TOMCAT_SUBSYSTEMS:
+ default_instance_name = 'pki-tomcat'
+ default_http_port = '8080'
+ default_https_port = '8443'
+ else:
+ default_instance_name = 'pki-apache'
+ default_http_port = '80'
+ default_https_port = '443'
+
+ predefined_dict = {'default_instance_name': default_instance_name,
+ 'default_http_port': default_http_port,
+ 'default_https_port': default_https_port,
+ 'subsystem_type' : config.pki_subsystem,
+ 'hostname': config.pki_hostname}
+
+ self.pki_config = ConfigParser.SafeConfigParser(predefined_dict)
# Make keys case-sensitive!
self.pki_config.optionxform = str
self.pki_config.read([
@@ -227,7 +242,6 @@ class PKIConfigParser:
config.pkideployment_cfg])
config.pki_default_dict = self.pki_config.defaults()
pkilogging.sensitive_parameters = config.pki_default_dict['sensitive_parameters'].split()
- config.pki_common_dict = dict(self.pki_config._sections['Common'])
if config.pki_subsystem == "CA":
config.pki_web_server_dict = dict(self.pki_config._sections['Tomcat'])
config.pki_subsystem_dict = dict(self.pki_config._sections['CA'])
@@ -249,7 +263,6 @@ class PKIConfigParser:
# Insert empty record into dictionaries for "pretty print" statements
# NEVER print "sensitive" key value pairs!!!
config.pki_default_dict[0] = None
- config.pki_common_dict[0] = None
config.pki_web_server_dict[0] = None
config.pki_subsystem_dict[0] = None
except ConfigParser.ParsingError, err:
@@ -296,7 +309,6 @@ class PKIConfigParser:
# Configuration file name/value pairs
# NEVER add "sensitive" key value pairs to the master dictionary!!!
config.pki_master_dict.update(config.pki_default_dict)
- config.pki_master_dict.update(config.pki_common_dict)
config.pki_master_dict.update(config.pki_web_server_dict)
config.pki_master_dict.update(config.pki_subsystem_dict)
config.pki_master_dict.update(__name__="PKI Master Dictionary")
@@ -1466,7 +1478,6 @@ class PKIConfigParser:
# config.pki_master_dict['pki_issuing_ca']
# config.pki_master_dict['pki_security_domain_hostname']
# config.pki_master_dict['pki_security_domain_name']
- # config.pki_master_dict['pki_subsystem_name']
#
# if security domain user is not defined
@@ -1488,34 +1499,6 @@ class PKIConfigParser:
else:
config.pki_master_dict['pki_security_domain_user'] = "caadmin"
- if not len(config.pki_master_dict['pki_subsystem_name']):
- if config.pki_master_dict['pki_subsystem'] in\
- config.PKI_TOMCAT_SUBSYSTEMS and \
- config.str2bool(config.pki_master_dict['pki_clone']):
- config.pki_master_dict['pki_subsystem_name'] =\
- config.PKI_DEPLOYMENT_CLONED_PKI_SUBSYSTEM + " " +\
- config.pki_subsystem + " " +\
- config.pki_master_dict['pki_hostname'] + " " +\
- config.pki_master_dict['pki_https_port']
- elif config.pki_subsystem == "CA" and \
- config.str2bool(config.pki_master_dict['pki_external']):
- config.pki_master_dict['pki_subsystem_name'] =\
- config.PKI_DEPLOYMENT_EXTERNAL_CA + " " +\
- config.pki_subsystem + " " +\
- config.pki_master_dict['pki_hostname'] + " " +\
- config.pki_master_dict['pki_https_port']
- elif config.pki_subsystem == "CA" and \
- config.str2bool(config.pki_master_dict['pki_subordinate']):
- config.pki_master_dict['pki_subsystem_name'] =\
- config.PKI_DEPLOYMENT_SUBORDINATE_CA + " " +\
- config.pki_subsystem + " " +\
- config.pki_master_dict['pki_hostname'] + " " +\
- config.pki_master_dict['pki_https_port']
- else:
- config.pki_master_dict['pki_subsystem_name'] =\
- config.pki_subsystem + " " +\
- config.pki_master_dict['pki_hostname'] + " " +\
- config.pki_master_dict['pki_https_port']
if config.pki_subsystem != "CA" or\
config.str2bool(config.pki_master_dict['pki_clone']) or\
config.str2bool(config.pki_master_dict['pki_subordinate']):
@@ -1581,8 +1564,6 @@ class PKIConfigParser:
# deployment configuration file and potentially overridden below:
#
# config.pki_master_dict['pki_ds_base_dn']
- # config.pki_master_dict['pki_ds_database']
- # config.pki_master_dict['pki_ds_hostname']
#
if not config.str2bool(config.pki_master_dict['pki_clone']):
if not len(config.pki_master_dict['pki_ds_base_dn']):
@@ -1596,14 +1577,6 @@ class PKIConfigParser:
config.pki_master_dict['pki_ds_base_dn'] =\
"o=" + config.pki_master_dict['pki_instance_id'] +\
"-" + config.pki_subsystem
- if not len(config.pki_master_dict['pki_ds_database']):
- config.pki_master_dict['pki_ds_database'] =\
- config.pki_master_dict['pki_instance_id'] +\
- "-" + config.pki_subsystem
- if not len(config.pki_master_dict['pki_ds_hostname']):
- # Guess that the Directory Server resides on the local host
- config.pki_master_dict['pki_ds_hostname'] =\
- config.pki_master_dict['pki_hostname']
# Jython scriptlet
# 'External CA' Configuration name/value pairs
#