Skip to content

Commit

Permalink
Update 01-FixSSKDirUserCertProfileAuth.py
Browse files Browse the repository at this point in the history
Only update profile if exists.  Currently if the file does not exist CA fails to start
  • Loading branch information
parrjd authored and ckelleyRH committed Sep 18, 2023
1 parent 783c341 commit d53cc2c
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions base/server/upgrade/11.3.0/01-FixSSKDirUserCertProfileAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ def upgrade_subsystem(self, instance, subsystem):
return

path = os.path.join(subsystem.base_dir, 'profiles', 'ca', 'caServerKeygen_UserCert.cfg')
self.backup(path)
if os.path.exists(path):
self.backup(path)

config = {}
config = {}

logger.info('Loading %s', path)
pki.util.load_properties(path, config)
logger.info('Loading %s', path)
pki.util.load_properties(path, config)

config['input.list'] = 'i1'
config.pop('input.i2.class_id', None)
config.pop('input.i3.class_id', None)
config['policyset.userCertSet.1.default.class_id'] = 'authTokenSubjectNameDefaultImpl'
config['policyset.userCertSet.8.default.params.subjAltExtPattern_0'] = \
'$request.auth_token.mail[0]$'
config['input.list'] = 'i1'
config.pop('input.i2.class_id', None)
config.pop('input.i3.class_id', None)
config['policyset.userCertSet.1.default.class_id'] = 'authTokenSubjectNameDefaultImpl'
config['policyset.userCertSet.8.default.params.subjAltExtPattern_0'] = \
'$request.auth_token.mail[0]$'

logger.info('Storing %s', path)
pki.util.store_properties(path, config)
logger.info('Storing %s', path)
pki.util.store_properties(path, config)

0 comments on commit d53cc2c

Please sign in to comment.