]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge PR #25597 into master
authorSage Weil <sage@redhat.com>
Tue, 1 Jan 2019 04:31:18 +0000 (22:31 -0600)
committerSage Weil <sage@redhat.com>
Tue, 1 Jan 2019 04:31:18 +0000 (22:31 -0600)
* refs/pull/25597/head:
mgr/hello: define some module options
pybind/mgr/mgr_module: normalize defaults to str when type is missing
mgr/telegraf: specify option types
mgr/telemetry: specify option types
mgr/zabbix: specify option types
mgr/localpool: document options and specify in native types
mgr/devicehealth: document options and specify in native types
mgr/balancer: document and specify options
common/options: make runtime vs not runtime explicit, not type-dependent
mon/MgrMonitor: mark module options with FLAG_MGR
mon/MgrMonitor: make find_module_option handle localized option names
pybind/mgr/mgr_module: set values as string
mgr: return options as appropriate python type
mgr/PythonCompat: python 3 cludges
pybind/mgr/mgr_module: make use of defined default value
mgr/PyModule: populate ModuleOptions and expose to mon
mon/ConfigMonitor: unify module options with built-in options
mon/MgrMonitor: populate options
mon/MgrMap: define ModuleOptions and include in map
common/options: expand type helpers and make them static
common/options: pin enums to values

Reviewed-by: Tim Serong <tserong@suse.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
1  2 
src/mgr/BaseMgrModule.cc
src/mon/MgrMonitor.cc
src/pybind/mgr/balancer/module.py
src/pybind/mgr/devicehealth/module.py
src/pybind/mgr/hello/module.py
src/pybind/mgr/mgr_module.py

index c60b9d9228566744da7f84135b59b889289d4f85,d9e7a33ca0e51e0935a1829c50da1afd158193c8..31a22665bf687e9210d9c7b90468e33f429bd35e
@@@ -398,12 -397,9 +398,12 @@@ ceph_get_module_option(BaseMgrModule *s
    std::string value;
    bool found = self->py_modules->get_config(self->this_module->get_name(),
        what, &value);
 +
 +  PyEval_RestoreThread(tstate);
 +
    if (found) {
      dout(10) << __func__ << " " << what << " found: " << value.c_str() << dendl;
-     return PyString_FromString(value.c_str());
+     return self->this_module->py_module->get_typed_option_value(what, value);
    } else {
      dout(4) << __func__ << " " << what << " not found " << dendl;
      Py_RETURN_NONE;
Simple merge
Simple merge
Simple merge
index d56f4653dc810510956a13a5e487a53af7dd020d,08d0bf4802cada109ab88a997ddaf32a2d90ff64..e8a3aebbe62c01395bbf84d2b27a620977a15e50
@@@ -34,14 -50,14 +50,16 @@@ class Hello(MgrModule)
          status_code = 0
          output_buffer = "Output buffer is for data results"
          output_string = "Output string is for informative text"
-         message = "hello world!"
          if 'person_name' in cmd:
-             message = "hello, " + cmd['person_name'] + "!"
+             message = "Hello, " + cmd['person_name']
+         else:
+             message = "Hello " + self.get_module_option('place');
+         if self.get_module_option('emphatic'):
+             message += '!'
  
 -        return status_code, output_buffer, message + "\n" + output_string
 +        return HandleCommandResult(retval=status_code, stdout=output_buffer,
 +                                   stderr=message + "\n" + output_string)
 +
  
      def serve(self):
          """
Simple merge