From fb64df156092d0c277604faac2a37a8141db12d4 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Mon, 23 Mar 2020 15:41:16 +0100 Subject: [PATCH] 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 --- src/pybind/mgr/diskprediction_cloud/module.py | 2 +- src/pybind/mgr/diskprediction_local/module.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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): -- 2.47.3