Skip to content

Commit

Permalink
Update PKISubsystem.create_conf()
Browse files Browse the repository at this point in the history
The PKISubsystem.create_conf() has been modified to preserve
the params in the current CS.cfg if it exists.
  • Loading branch information
edewata committed Dec 4, 2023
1 parent ef66910 commit d829573
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions base/server/python/pki/server/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,20 @@ def create_conf(self, exist_ok=False):
conf_link,
exist_ok=exist_ok)

self.config['cs.type'] = self.type
self.config['instanceId'] = self.instance.name
self.config['passwordClass'] = 'com.netscape.cmsutil.password.PlainPasswordFile'
self.config['passwordFile'] = self.instance.password_conf
if os.path.exists(self.cs_conf):
pki.util.load_properties(self.cs_conf, self.config)

if 'cs.type' not in self.config:
self.config['cs.type'] = self.type

if 'instanceId' not in self.config:
self.config['instanceId'] = self.instance.name

if 'passwordClass' not in self.config:
self.config['passwordClass'] = 'com.netscape.cmsutil.password.PlainPasswordFile'

if 'passwordFile' not in self.config:
self.config['passwordFile'] = self.instance.password_conf

logger.info('Storing subsystem config: %s', self.cs_conf)
self.instance.store_properties(self.cs_conf, self.config)
Expand Down

0 comments on commit d829573

Please sign in to comment.