Browse Source

Fix DuplicateOptError in fixed_key migration code

Fix how the key migration code loads the fixed_key config option so that
it handles DuplicateOptError.

Closes-Bug: #1747021
Change-Id: I119a12c8e80ad991f5a2916fec2ef4421039b9e9
changes/27/540427/1
Alan Bishop 4 years ago
parent
commit
167dc4e1bd
  1. 9
      cinder/keymgr/migration.py

9
cinder/keymgr/migration.py

@ -44,9 +44,12 @@ class KeyMigrator(object):
def handle_key_migration(self, volumes):
castellan_options.set_defaults(self.conf)
self.conf.import_opt(name='fixed_key',
module_str='cinder.keymgr.conf_key_mgr',
group='key_manager')
try:
self.conf.import_opt(name='fixed_key',
module_str='cinder.keymgr.conf_key_mgr',
group='key_manager')
except cfg.DuplicateOptError:
pass
fixed_key = self.conf.key_manager.fixed_key
backend = self.conf.key_manager.backend or ''

Loading…
Cancel
Save