From: Mykola Golub Date: Wed, 28 Oct 2020 09:20:27 +0000 (+0000) Subject: mgr/rbd_support: backward compatibility when loading global schedule X-Git-Tag: v16.1.0~729^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37864%2Fhead;p=ceph.git mgr/rbd_support: backward compatibility when loading global schedule Signed-off-by: Mykola Golub --- 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()