]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/*: fix config_notify handling of default values 34178/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:43:13 +0000 (15:43 +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)

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

index 9edfe9c54802c668387bdab60fa3921a4be9ffac..50b88e89667ecf655cc2c8907382131b06cfec47 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 146c27def8c347a2456a201109ec94c444adc42a..61f3cc1f6dcc72f9145bdf2ee77f26d6d844ac82 100644 (file)
@@ -63,7 +63,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):
index 14779d3f324ece2d9bfcb576d17c21ac20dbd9ad..5b743200e003e779d8387e097d566d1d671d1332 100644 (file)
@@ -55,7 +55,7 @@ class OSDSupport(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(' mgr option %s = %s',
                            opt['name'], getattr(self, opt['name']))
         # Do the same for the native options.