]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: backward compatibility when loading global schedule 37864/head
authorMykola Golub <mgolub@suse.com>
Wed, 28 Oct 2020 09:20:27 +0000 (09:20 +0000)
committerMykola Golub <mgolub@suse.com>
Wed, 28 Oct 2020 09:22:00 +0000 (09:22 +0000)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/pybind/mgr/rbd_support/schedule.py

index d07b028259218ebf7e680d2ffa978ed18d037436..09e9a26a9ea79e45b81d0f50a48a05cd2fc83b30 100644 (file)
@@ -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()