Skip to content

Commit

Permalink
Update pkidestroy to ignore missing deployment.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Sep 12, 2024
1 parent a72c3f6 commit e984ab7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions base/server/python/pki/server/pkidestroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,28 @@ def main(argv):
config.USER_DEPLOYMENT_CONFIGURATION
)

if deployer.force and not os.path.exists(config.user_deployment_cfg):
# During force destroy, try to load the file. If file doesn't exist, we ignore it
if not os.path.exists(config.user_deployment_cfg):
# if file doesn't exist, we ignore it
config.user_deployment_cfg = None

parser.validate(config.user_deployment_cfg)
if config.user_deployment_cfg:
parser.validate(config.user_deployment_cfg)

parser.init_config(pki_instance_name=config.pki_deployed_instance_name)

if args.pki_verbosity > 1:
logger.warning('The -%s option has been deprecated. Use --debug instead.',
'v' * args.pki_verbosity)

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

# Combine the various sectional dictionaries into a PKI master dictionary
parser.compose_pki_master_dictionary(config.user_deployment_cfg)

deployer.init()

if args.log_file:
Expand Down

0 comments on commit e984ab7

Please sign in to comment.