]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr: return the error if set_config() fails
authorKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 04:38:13 +0000 (12:38 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 12:51:11 +0000 (20:51 +0800)
commit75bbe6863f5f68567b2011fdbdee1cb6ddf19b79
treec35e69e3b1d323aadd1b20b1f094f5f23ec20f39
parentcc151a74668f7dd2be79a41b6b01df373fdd3f47
mgr: return the error if set_config() fails

in general, `ActivePyModules::set_config()` is called by mgr module when
serving user commands updating module, sometimes if the option is of the
wrong type or invalid value, monitor rejects this request sent by mgr,
but the error info is only logged in the logging message on mgr, but not
returned to user. in this change, `ceph_set_module_option()` and the
underlying methods are updated to return the error to the caller as an
python exception.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/ActivePyModules.cc
src/mgr/ActivePyModules.h
src/mgr/BaseMgrModule.cc
src/mgr/PyModule.cc
src/mgr/PyModule.h
src/pybind/mgr/mgr_module.py
src/pybind/mgr/selftest/module.py