Skip to content

Commit

Permalink
Replace pki_instance_path param with PKIServer.base_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jul 18, 2023
1 parent 372fd6e commit eb581e1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2566,8 +2566,8 @@ def create_admin_cert(self, subsystem, csr):
request.systemCert.adjustValidity = False

profile_filename = os.path.join(
self.mdict['pki_instance_path'],
'ca/profiles/ca/%s.cfg' % self.mdict['pki_admin_profile_id'])
subsystem.conf_dir,
'profiles/ca/%s.cfg' % self.mdict['pki_admin_profile_id'])
logger.info('Loading %s', profile_filename)

profile = {}
Expand Down
10 changes: 5 additions & 5 deletions base/server/python/pki/server/deployment/pkihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,17 @@ def collision_detection(self, instance):
instance.base_dir,
self.mdict['pki_subsystem_type'])

if os.path.exists(self.mdict['pki_instance_path']):
if os.path.exists(instance.base_dir):
if os.path.exists(subsystem_path):
# Top-Level PKI base path collision
logger.error(
log.PKIHELPER_NAMESPACE_COLLISION_2,
self.mdict['pki_instance_name'],
self.mdict['pki_instance_path'])
instance.base_dir)
raise Exception(
log.PKIHELPER_NAMESPACE_COLLISION_2 % (
self.mdict['pki_instance_name'],
self.mdict['pki_instance_path']))
instance.base_dir))
else:
if os.path.exists(instance.service_conf):
# Top-Level "/etc/sysconfig" path collision
Expand Down Expand Up @@ -399,11 +399,11 @@ def collision_detection(self, instance):
logger.error(
log.PKIHELPER_NAMESPACE_RESERVED_NAME_2,
self.mdict['pki_instance_name'],
self.mdict['pki_instance_path'])
instance.base_dir)
raise Exception(
log.PKIHELPER_NAMESPACE_RESERVED_NAME_2 % (
self.mdict['pki_instance_name'],
self.mdict['pki_instance_path']))
instance.base_dir))
# No need to check for reserved name under Top-Level PKI log path
if self.mdict['pki_instance_name'] in \
config.PKI_CONFIGURATION_RESERVED_NAMES:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def spawn(self, deployer):
instance.load()

# Create /var/lib/pki/<instance>
instance.makedirs(deployer.mdict['pki_instance_path'], exist_ok=True)
instance.makedirs(instance.base_dir, exist_ok=True)

instance_conf_path = deployer.mdict['pki_instance_configuration_path']

Expand Down Expand Up @@ -305,8 +305,8 @@ def destroy(self, deployer):
if config.str2bool(deployer.mdict['pki_registry_enable']):
instance.remove_registry(force=deployer.force)

logger.info('Removing %s', deployer.mdict['pki_instance_path'])
pki.util.rmtree(path=deployer.mdict['pki_instance_path'],
logger.info('Removing %s', instance.base_dir)
pki.util.rmtree(path=instance.base_dir,
force=deployer.force)

if deployer.remove_logs:
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 @@ -563,7 +563,7 @@ def main(argv):
sys.exit(0)

print("Installing " + deployer.subsystem_name + " into " +
parser.mdict['pki_instance_path'] + ".")
instance.base_dir + ".")

# Process the various "scriptlets" to create the specified PKI subsystem.
pki_subsystem_scriptlets = parser.mdict['spawn_scriplets'].split()
Expand Down

0 comments on commit eb581e1

Please sign in to comment.