From 253c1db393532a987f74905905fc19a997a540d9 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 1 Jan 2019 23:39:57 +0800 Subject: [PATCH] mgr: define option defaults for MgrStandbyModule as well in 0f814f38, we are using self.MODULE_OPTION_DEFAULTS as a fallback, but the MgrStandbyModule does not have it defined. in this change, * apply 0f814f38 to MgrStandbyModule * apply 0228bd79 to MgrStandbyModule Signed-off-by: Kefu Chai --- src/pybind/mgr/mgr_module.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index aa954853af89..7ad331b02424 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -300,10 +300,20 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule): from their active peer), and to configuration settings (read only). """ + MODULE_OPTIONS = [] + MODULE_OPTION_DEFAULTS = {} + def __init__(self, module_name, capsule): super(MgrStandbyModule, self).__init__(capsule) self.module_name = module_name self._logger = configure_logger(self, module_name) + # see also MgrModule.__init__() + for o in self.MODULE_OPTIONS: + if 'default' in o: + if 'type' in o: + self.MODULE_OPTION_DEFAULTS[o['name']] = o['default'] + else: + self.MODULE_OPTION_DEFAULTS[o['name']] = str(o['default']) def __del__(self): unconfigure_logger(self, self.module_name) -- 2.47.3