Skip to content

Commit

Permalink
Update code for finalizing installation to use PKIDeployer.instance
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Aug 18, 2023
1 parent 3f07e89 commit 7495553
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3786,7 +3786,7 @@ def setup_subsystem_user(self, subsystem, cert):
logger.warning('Unable to add %s into Subsystem Group', uid)
# TODO: ignore failure only if user already exists in the group

def backup_keys(self, instance, subsystem):
def backup_keys(self, subsystem):

tmpdir = tempfile.mkdtemp()
try:
Expand All @@ -3798,7 +3798,7 @@ def backup_keys(self, instance, subsystem):
'pki-server',
'subsystem-cert-export',
subsystem.name,
'-i', instance.name,
'-i', self.instance.name,
'--pkcs12-file', self.mdict['pki_backup_file'],
'--pkcs12-password-file', password_file
]
Expand Down Expand Up @@ -4592,9 +4592,9 @@ def finalize_subsystem(self, subsystem):

subsystem.save()

def store_config(self, instance):
def store_config(self):

subsystem = instance.get_subsystem(self.mdict['pki_subsystem'].lower())
subsystem = self.instance.get_subsystem(self.mdict['pki_subsystem'].lower())

# Store user's deployment.cfg into
# /etc/sysconfig/pki/tomcat/<instance>/<subsystem>/deployment.cfg
Expand All @@ -4617,9 +4617,9 @@ def store_config(self, instance):

self.file.copy(deployment_cfg, deployment_cfg_archive)

def store_manifest(self, instance):
def store_manifest(self):

subsystem = instance.get_subsystem(self.mdict['pki_subsystem'].lower())
subsystem = self.instance.get_subsystem(self.mdict['pki_subsystem'].lower())

# Store installation manifest into
# /etc/sysconfig/pki/tomcat/<instance>/<subsystem>/manifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def spawn(self, deployer):
deployer.mdict['pki_subsystem'].lower() + '_backup_keys.p12'

logger.info('Backing up keys into %s', deployer.mdict['pki_backup_file'])
deployer.backup_keys(instance, subsystem)
deployer.backup_keys(subsystem)

if config.str2bool(deployer.mdict['pki_systemd_service_create']):

Expand Down
4 changes: 2 additions & 2 deletions base/server/python/pki/server/pkispawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ def main(argv):

# Store user config and installation manifest into
# /etc/sysconfig/pki/tomcat/<instance>/<subsystem>
deployer.store_config(deployer.instance)
deployer.store_manifest(deployer.instance)
deployer.store_config()
deployer.store_manifest()

external = deployer.configuration_file.external
standalone = deployer.configuration_file.standalone
Expand Down

0 comments on commit 7495553

Please sign in to comment.