Skip to content

Commit

Permalink
mgr/rbd_support: backward compatibility when loading global schedule
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Golub <mgolub@suse.com>
  • Loading branch information
trociny committed Oct 28, 2020
1 parent e46e804 commit 8e9e2a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pybind/mgr/rbd_support/schedule.py
Expand Up @@ -345,6 +345,18 @@ def load(self, namespace_validator=None, image_validator=None):

schedule_cfg = self.handler.module.get_module_option(
self.handler.MODULE_OPTION_NAME, '')

# Previous versions incorrectly stored the global config in
# the localized module option. Check the config is here and fix it.
if not schedule_cfg:
schedule_cfg = self.handler.module.get_localized_module_option(
self.handler.MODULE_OPTION_NAME, '')
if schedule_cfg:
self.handler.module.set_module_option(
self.handler.MODULE_OPTION_NAME, schedule_cfg)
self.handler.module.set_localized_module_option(
self.handler.MODULE_OPTION_NAME, None)

if schedule_cfg:
try:
level_spec = LevelSpec.make_global()
Expand Down

0 comments on commit 8e9e2a7

Please sign in to comment.