]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/*: fix config_notify handling of default values 34116/head
authorNathan Cutler <ncutler@suse.com>
Mon, 23 Mar 2020 14:41:16 +0000 (15:41 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 25 Mar 2020 14:40:41 +0000 (15:40 +0100)
After 5ace82e65c72847fb875fc01c419937a26a59d70 was merged, I found
three more instances of the code being patched.

The commit message of 5ace82e65c72847fb875fc01c419937a26a59d70 was/is:

"The default values are handled by mgr_module.py's _get_module_option();
the or here means that we break any non-true (0, false, none) value and
override it with the default."

Fixes: 5ace82e65c72847fb875fc01c419937a26a59d70
Fixes: https://tracker.ceph.com/issues/43746
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 30585f44de6147c824ed2df1a477ad17f7b51fff)

Conflicts:
src/pybind/mgr/osd_support/module.py
- file does not exist in nautilus

src/pybind/mgr/diskprediction_cloud/module.py
src/pybind/mgr/diskprediction_local/module.py

index 503d8a88bc26176a92226b25c219cd04d5e8f1f9..5052d55e32baa197b6855e3f3b65f06e960687a5 100644 (file)
@@ -246,7 +246,7 @@ class Module(MgrModule):
         for opt in self.MODULE_OPTIONS:
             setattr(self,
                     opt['name'],
-                    self.get_module_option(opt['name']) or opt['default'])
+                    self.get_module_option(opt['name']))
             self.log.debug(' %s = %s', opt['name'], getattr(self, opt['name']))
 
     def _status(self,  cmd):
index cb69915f541579fe6c646d36a04688383eed913e..3f0e544d44abb7e00e5e7346cc148e5884de83ac 100644 (file)
@@ -51,7 +51,7 @@ class Module(MgrModule):
         for opt in self.MODULE_OPTIONS:
             setattr(self,
                     opt['name'],
-                    self.get_module_option(opt['name']) or opt['default'])
+                    self.get_module_option(opt['name']))
             self.log.debug(' %s = %s', opt['name'], getattr(self, opt['name']))
 
     def handle_command(self, _, cmd):