From 8e9e2a73f5b8abd743933e59a3b986598765a681 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 28 Oct 2020 09:20:27 +0000 Subject: [PATCH] mgr/rbd_support: backward compatibility when loading global schedule Signed-off-by: Mykola Golub --- src/pybind/mgr/rbd_support/schedule.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pybind/mgr/rbd_support/schedule.py b/src/pybind/mgr/rbd_support/schedule.py index d07b02825921..09e9a26a9ea7 100644 --- a/src/pybind/mgr/rbd_support/schedule.py +++ b/src/pybind/mgr/rbd_support/schedule.py @@ -345,6 +345,18 @@ class Schedules: 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() -- 2.47.3