Skip to content

Commit

Permalink
Update PKIConfigParser.read_pki_configuration_file()
Browse files Browse the repository at this point in the history
The PKIConfigParser.read_pki_configuration_file() 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 76fc0be commit 7141dd7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions base/server/python/pki/server/deployment/pkiparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ def read_password(self, message, section=None, key=None, # noqa: N803

return password

def read_pki_configuration_file(self):
def read_pki_configuration_file(self, user_deployment_cfg):
"""Read configuration file sections into dictionaries"""
rv = 0
try:
if config.user_deployment_cfg:
if user_deployment_cfg:
# We don't allow interpolation in password settings, which
# means that we need to deal with escaping '%' characters
# that might be present.
Expand All @@ -525,12 +525,12 @@ def read_pki_configuration_file(self):
'pki_token_password')

print('Loading deployment configuration from ' +
config.user_deployment_cfg + '.')
user_deployment_cfg + '.')

self.validate_user_config(config.user_deployment_cfg)
self.validate_user_config(user_deployment_cfg)

self.deployer.main_config.read([config.user_deployment_cfg])
self.deployer.user_config.read([config.user_deployment_cfg])
self.deployer.main_config.read([user_deployment_cfg])
self.deployer.user_config.read([user_deployment_cfg])

# Look through each section and see if any password settings
# are present. If so, escape any '%' characters.
Expand Down Expand Up @@ -564,7 +564,7 @@ def read_pki_configuration_file(self):
except configparser.NoOptionError:
continue
except configparser.ParsingError:
logger.exception(log.PKI_UNABLE_TO_PARSE_1, config.user_deployment_cfg)
logger.exception(log.PKI_UNABLE_TO_PARSE_1, user_deployment_cfg)
rv = 1
return rv

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 @@ -219,7 +219,7 @@ def main(argv):
'v' * args.pki_verbosity)

# Read the specified PKI configuration file.
rv = parser.read_pki_configuration_file()
rv = parser.read_pki_configuration_file(config.user_deployment_cfg)
if rv != 0:
sys.exit(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 @@ -531,7 +531,7 @@ def main(argv):
'v' * args.pki_verbosity)

# Read the specified PKI configuration file.
rv = parser.read_pki_configuration_file()
rv = parser.read_pki_configuration_file(config.user_deployment_cfg)
if rv != 0:
sys.exit(1)

Expand Down

0 comments on commit 7141dd7

Please sign in to comment.