Skip to content

Commit

Permalink
Simplify PKIDeployer.setup_security_domain()
Browse files Browse the repository at this point in the history
The code in PKISubsystem.configure_security_domain() has been
merged into PKIDeployer.setup_security_domain().
  • Loading branch information
edewata committed Dec 4, 2023
1 parent f55ce44 commit d2e6edf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
23 changes: 6 additions & 17 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2497,35 +2497,24 @@ def setup_security_domain(self, subsystem):

self.join_security_domain()

sd_hostname = self.sd_host.Hostname
sd_port = self.sd_host.Port
sd_secure_port = self.sd_host.SecurePort
subsystem.config['securitydomain.host'] = self.sd_host.Hostname
subsystem.config['securitydomain.httpport'] = self.sd_host.Port
subsystem.config['securitydomain.httpsadminport'] = self.sd_host.SecurePort

else: # self.mdict['pki_security_domain_type'] == 'new'

if config.str2bool(self.mdict['pki_subordinate']) and \
config.str2bool(self.mdict['pki_subordinate_create_new_security_domain']):

logger.info('Creating new subordinate security domain')

self.join_security_domain()

sd_hostname = self.mdict['pki_hostname']
sd_port = unsecurePort
sd_secure_port = securePort

else:

logger.info('Creating new security domain')

sd_hostname = self.mdict['pki_hostname']
sd_port = unsecurePort
sd_secure_port = securePort

subsystem.configure_security_domain(
sd_hostname,
sd_port,
sd_secure_port)
subsystem.config['securitydomain.host'] = self.mdict['pki_hostname']
subsystem.config['securitydomain.httpport'] = unsecurePort
subsystem.config['securitydomain.httpsadminport'] = securePort

def setup_security_domain_manager(self, subsystem):

Expand Down
10 changes: 0 additions & 10 deletions base/server/python/pki/server/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,16 +1472,6 @@ def import_master_config(self, properties):

self.save()

def configure_security_domain(
self,
hostname,
port,
secure_port):

self.config['securitydomain.host'] = hostname
self.config['securitydomain.httpport'] = port
self.config['securitydomain.httpsadminport'] = secure_port

def create_security_domain(self, name=None, as_current_user=False):

cmd = [self.name + '-sd-create']
Expand Down

0 comments on commit d2e6edf

Please sign in to comment.