diff --git a/base/server/upgrade/10.13.2/01-FixSSKDirUserCertProfileAuth.py b/base/server/upgrade/10.13.2/01-FixSSKDirUserCertProfileAuth.py index 3792cd3fbe1..0b1033f9946 100644 --- a/base/server/upgrade/10.13.2/01-FixSSKDirUserCertProfileAuth.py +++ b/base/server/upgrade/10.13.2/01-FixSSKDirUserCertProfileAuth.py @@ -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)