From: Nathan Cutler Date: Mon, 23 Mar 2020 14:41:16 +0000 (+0100) Subject: pybind/mgr/*: fix config_notify handling of default values X-Git-Tag: v14.2.10~163^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb64df156092d0c277604faac2a37a8141db12d4;p=ceph.git pybind/mgr/*: fix config_notify handling of default values 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 (cherry picked from commit 30585f44de6147c824ed2df1a477ad17f7b51fff) Conflicts: src/pybind/mgr/osd_support/module.py - file does not exist in nautilus --- diff --git a/src/pybind/mgr/diskprediction_cloud/module.py b/src/pybind/mgr/diskprediction_cloud/module.py index 503d8a88bc26..5052d55e32ba 100644 --- a/src/pybind/mgr/diskprediction_cloud/module.py +++ b/src/pybind/mgr/diskprediction_cloud/module.py @@ -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): diff --git a/src/pybind/mgr/diskprediction_local/module.py b/src/pybind/mgr/diskprediction_local/module.py index cb69915f5415..3f0e544d44ab 100644 --- a/src/pybind/mgr/diskprediction_local/module.py +++ b/src/pybind/mgr/diskprediction_local/module.py @@ -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):