Skip to content

Commit

Permalink
Clean up PKIDeployer.init_server_nssdb()
Browse files Browse the repository at this point in the history
The PKIDeployer.init_server_nssdb() has been renamed to
create_server_nssdb(). The code that calls this method has
been moved into instance_layout.py. The code that creates
the link in the subsystem folder has been moved into
subsystem_layout.py.
  • Loading branch information
edewata committed Jan 12, 2024
1 parent 6a4648b commit 043b1d3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
12 changes: 1 addition & 11 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def update_external_certs_conf(self, external_path):
for cert in external_certs:
self.instance.add_external_cert(cert.nickname, cert.token)

def init_server_nssdb(self, subsystem):
def create_server_nssdb(self):

# Since 'certutil' does NOT strip the 'token=' portion of
# the 'token=password' entries, create a temporary server 'pfile'
Expand Down Expand Up @@ -566,16 +566,6 @@ def init_server_nssdb(self, subsystem):
self.instance.nssdb_link,
exist_ok=True)

# Link /var/lib/pki/<instance>/<subsystem>/alias
# to /var/lib/pki/<instance>/alias

subsystem_nssdb_link = os.path.join(subsystem.base_dir, 'alias')

self.instance.symlink(
self.instance.nssdb_link,
subsystem_nssdb_link,
exist_ok=True)

if config.str2bool(self.mdict['pki_hsm_enable']) and \
self.mdict['pki_hsm_modulename'] and \
self.mdict['pki_hsm_libfile'] and \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def spawn(self, deployer):
logger.info('Creating %s', instance.password_conf)
instance.store_passwords()

deployer.create_server_nssdb()

deployer.configure_server_xml()

# Copy /usr/share/pki/server/conf/tomcat.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def spawn(self, deployer):
if config.str2bool(deployer.mdict['pki_use_pss_rsa_signing_algorithm']):
deployer.update_rsa_pss_algorithms(subsystem)

deployer.init_server_nssdb(subsystem)
deployer.import_server_pkcs12()
deployer.import_clone_pkcs12()
deployer.install_cert_chain()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ def spawn(self, deployer):
subsystem.create_conf(exist_ok=True)
subsystem.create_logs(exist_ok=True)

# Link /var/lib/pki/<instance>/<subsystem>/alias
# to /var/lib/pki/<instance>/alias

nssdb_link = os.path.join(subsystem.base_dir, 'alias')

instance.symlink(
instance.nssdb_link,
nssdb_link,
exist_ok=True)

if config.str2bool(deployer.mdict['pki_registry_enable']):
subsystem.create_registry(exist_ok=True)

Expand Down

0 comments on commit 043b1d3

Please sign in to comment.