Skip to content

Commit

Permalink
Update PKIConfigParser.validate()
Browse files Browse the repository at this point in the history
The PKIConfigParser.validate() has been updated to take
a user_deployment_cfg param instead of using the global
config.user_deployment_cfg.
  • Loading branch information
edewata committed May 30, 2024
1 parent 6014e59 commit 76fc0be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions base/server/python/pki/server/deployment/pkiparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def process_command_line_arguments(self):

return args

def validate(self):
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):
Expand All @@ -333,13 +333,13 @@ def validate(self):
self.arg_parser.print_help()
self.arg_parser.exit(-1)

if config.user_deployment_cfg:
if user_deployment_cfg:
# verify user configuration file exists
if not os.path.exists(config.user_deployment_cfg) or \
not os.path.isfile(config.user_deployment_cfg):
if not os.path.exists(user_deployment_cfg) or \
not os.path.isfile(user_deployment_cfg):
logger.error(
log.PKI_FILE_MISSING_OR_NOT_A_FILE_1,
config.user_deployment_cfg)
user_deployment_cfg)
self.arg_parser.print_help()
self.arg_parser.exit(-1)

Expand Down
2 changes: 1 addition & 1 deletion base/server/python/pki/server/pkidestroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def main(argv):
# During force destroy, try to load the file. If file doesn't exist, we ignore it
config.user_deployment_cfg = None

parser.validate()
parser.validate(config.user_deployment_cfg)
parser.init_config(pki_instance_name=config.pki_deployed_instance_name)

if args.pki_verbosity > 1:
Expand Down
2 changes: 1 addition & 1 deletion base/server/python/pki/server/pkispawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def main(argv):
config.user_deployment_cfg = str(
args.user_deployment_cfg).strip('[\']')

parser.validate()
parser.validate(config.user_deployment_cfg)

# Currently the only logic in deployer's validation is the
# hostname check; at some point this might need to be updated.
Expand Down

0 comments on commit 76fc0be

Please sign in to comment.