]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: define option defaults for MgrStandbyModule as well 25734/head
authorKefu Chai <kchai@redhat.com>
Tue, 1 Jan 2019 15:39:57 +0000 (23:39 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 2 Jan 2019 14:19:50 +0000 (22:19 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/mgr_module.py

index aa954853af895390b9674933a9e8f291f0654321..7ad331b0242452e1076791304a355e804f84070a 100644 (file)
@@ -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)