From: Kefu Chai Date: Tue, 1 Jan 2019 15:39:57 +0000 (+0800) Subject: mgr: define option defaults for MgrStandbyModule as well X-Git-Tag: v14.1.0~516^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25734%2Fhead;p=ceph.git 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 --- 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)