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
This commit is contained in:
parent
eee1d29e0a
commit
167dc4e1bd
@ -44,9 +44,12 @@ class KeyMigrator(object):
|
|||||||
|
|
||||||
def handle_key_migration(self, volumes):
|
def handle_key_migration(self, volumes):
|
||||||
castellan_options.set_defaults(self.conf)
|
castellan_options.set_defaults(self.conf)
|
||||||
self.conf.import_opt(name='fixed_key',
|
try:
|
||||||
module_str='cinder.keymgr.conf_key_mgr',
|
self.conf.import_opt(name='fixed_key',
|
||||||
group='key_manager')
|
module_str='cinder.keymgr.conf_key_mgr',
|
||||||
|
group='key_manager')
|
||||||
|
except cfg.DuplicateOptError:
|
||||||
|
pass
|
||||||
fixed_key = self.conf.key_manager.fixed_key
|
fixed_key = self.conf.key_manager.fixed_key
|
||||||
backend = self.conf.key_manager.backend or ''
|
backend = self.conf.key_manager.backend or ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user