Skip to content

Commit

Permalink
Replace default_deployment_cfg with DEFAULT_DEPLOYMENT_CFG
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Sep 25, 2024
1 parent fe6567d commit dc14e3e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
6 changes: 1 addition & 5 deletions base/server/python/pki/server/deployment/pkiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@
# should always match the 'default' instance name specified below).
PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME = "pki-tomcat"

DEFAULT_DEPLOYMENT_CONFIGURATION = "default.cfg"
DEFAULT_DEPLOYMENT_CFG = PKI_DEPLOYMENT_SOURCE_ROOT + '/server/etc/default.cfg'
USER_DEPLOYMENT_CONFIGURATION = "deployment.cfg"

PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE = \
PKI_DEPLOYMENT_SOURCE_ROOT + "/server/etc/" + DEFAULT_DEPLOYMENT_CONFIGURATION

# subtypes of PKI subsystems
PKI_DEPLOYMENT_CLONED_PKI_SUBSYSTEM = "Cloned"
PKI_DEPLOYMENT_EXTERNAL_CA = "External"
Expand All @@ -83,7 +80,6 @@
pki_deployment_executable = None

# 'pkispawn' ONLY
default_deployment_cfg = None
user_deployment_cfg = None
# 'pkidestroy' ONLY
pki_deployed_instance_name = None
Expand Down
11 changes: 1 addition & 10 deletions base/server/python/pki/server/deployment/pkiparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,6 @@ def process_command_line_arguments(self):
return args

def validate(self, user_deployment_cfg):
# always default that configuration file exists
if not os.path.exists(config.default_deployment_cfg) or \
not os.path.isfile(config.default_deployment_cfg):
logger.error(
log.PKI_FILE_MISSING_OR_NOT_A_FILE_1,
config.default_deployment_cfg)
self.arg_parser.print_help()
self.arg_parser.exit(-1)

if user_deployment_cfg:
# verify user configuration file exists
if not os.path.exists(user_deployment_cfg) or \
Expand Down Expand Up @@ -403,7 +394,7 @@ def init_config(self, pki_instance_name=None):
self.deployer.user_config = configparser.ConfigParser()
self.deployer.user_config.optionxform = str

with open(config.default_deployment_cfg, encoding='utf-8') as f:
with open(config.DEFAULT_DEPLOYMENT_CFG, encoding='utf-8') as f:
if six.PY2:
self.deployer.main_config.readfp(f)
else:
Expand Down
3 changes: 0 additions & 3 deletions base/server/python/pki/server/pkidestroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ def main(argv):
deployer.subsystem_type, instance_name)
sys.exit(1)

config.default_deployment_cfg = \
config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE

# establish complete path to previously deployed configuration file
config.user_deployment_cfg = os.path.join(
subsystem.base_dir,
Expand Down
3 changes: 0 additions & 3 deletions base/server/python/pki/server/pkispawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ def main(argv):

args = parser.process_command_line_arguments()

config.default_deployment_cfg = \
config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE

# -f <user deployment config>
if args.user_deployment_cfg is not None:
config.user_deployment_cfg = str(
Expand Down

0 comments on commit dc14e3e

Please sign in to comment.