]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Make 3rd parameter optional in ceph_get_module_option 26986/head
authorVolker Theile <vtheile@suse.com>
Fri, 15 Mar 2019 14:42:44 +0000 (15:42 +0100)
committerVolker Theile <vtheile@suse.com>
Fri, 15 Mar 2019 14:45:39 +0000 (15:45 +0100)
Fixes: https://tracker.ceph.com/issues/38766
File "/usr/share/ceph/mgr/mgr_module.py", line 863, in _handle_command
2019-03-15T11:28:31.324 INFO:tasks.ceph.mgr.x.mira117.stderr:    return self.handle_command(inbuf, cmd)
2019-03-15T11:28:31.324 INFO:tasks.ceph.mgr.x.mira117.stderr:  File "/usr/share/ceph/mgr/selftest/module.py", line 114, in handle_command
2019-03-15T11:28:31.324 INFO:tasks.ceph.mgr.x.mira117.stderr:    self._self_test()
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:  File "/usr/share/ceph/mgr/selftest/module.py", line 213, in _self_test
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:    self._self_test_config()
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:  File "/usr/share/ceph/mgr/selftest/module.py", line 313, in _self_test_config
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:    assert self.get_module_option_ex("foo", "bar") is None
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:  File "/usr/share/ceph/mgr/mgr_module.py", line 942, in get_module_option_ex
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:    r = self._ceph_get_module_option(module, key)
2019-03-15T11:28:31.325 INFO:tasks.ceph.mgr.x.mira117.stderr:TypeError: ceph_get_module_option() takes exactly 3 arguments (2 given)

Signed-off-by: Volker Theile <vtheile@suse.com>
src/mgr/BaseMgrModule.cc
src/mgr/BaseMgrStandbyModule.cc

index cd3ed56ee732b7821c3996897bb3d9c5c95ab6e4..9f650dda6ee3bfc9b62a1964d346ccdea3313495 100644 (file)
@@ -401,7 +401,7 @@ ceph_get_module_option(BaseMgrModule *self, PyObject *args)
   char *module = nullptr;
   char *key = nullptr;
   char *prefix = nullptr;
-  if (!PyArg_ParseTuple(args, "ssz:ceph_get_module_option", &module, &key,
+  if (!PyArg_ParseTuple(args, "ss|s:ceph_get_module_option", &module, &key,
                        &prefix)) {
     derr << "Invalid args!" << dendl;
     return nullptr;
index 1f587349be2a058ebe73d84192965ad88070a991..b445f8dce3a19185102807098b73356b25ec8fab 100644 (file)
@@ -65,7 +65,7 @@ ceph_get_module_option(BaseMgrStandbyModule *self, PyObject *args)
 {
   char *what = nullptr;
   char *prefix = nullptr;
-  if (!PyArg_ParseTuple(args, "sz:ceph_get_module_option", &what, &prefix)) {
+  if (!PyArg_ParseTuple(args, "s|s:ceph_get_module_option", &what, &prefix)) {
     derr << "Invalid args!" << dendl;
     return nullptr;
   }