#include "mgr/MgrContext.h"
// For ::config_prefix
-#include "PyModuleRegistry.h"
#include "PyModule.h"
#include "ActivePyModules.h"
}
}
-PyObject *ActivePyModules::get_config_prefix(const std::string &module_name,
+PyObject *ActivePyModules::get_store_prefix(const std::string &module_name,
const std::string &prefix) const
{
PyThreadState *tstate = PyEval_SaveThread();
Mutex::Locker lock(module_config.lock);
- for (auto p = module_config.config.lower_bound(global_prefix);
- p != module_config.config.end() && p->first.find(global_prefix) == 0;
+ for (auto p = store_cache.lower_bound(global_prefix);
+ p != store_cache.end() && p->first.find(global_prefix) == 0;
++p) {
f.dump_string(p->first.c_str() + base_prefix.size(), p->second);
}
bool get_store(const std::string &module_name,
const std::string &key, std::string *val) const;
- PyObject *get_config_prefix(const std::string &module_name,
+ PyObject *get_store_prefix(const std::string &module_name,
const std::string &prefix) const;
void set_store(const std::string &module_name,
const std::string &key, const boost::optional<std::string> &val);
}
static PyObject*
-ceph_config_get_prefix(BaseMgrModule *self, PyObject *args)
+ceph_store_get_prefix(BaseMgrModule *self, PyObject *args)
{
char *prefix = nullptr;
- if (!PyArg_ParseTuple(args, "s:ceph_config_get", &prefix)) {
+ if (!PyArg_ParseTuple(args, "s:ceph_store_get_prefix", &prefix)) {
derr << "Invalid args!" << dendl;
return nullptr;
}
- return self->py_modules->get_config_prefix(self->this_module->get_name(),
+ return self->py_modules->get_store_prefix(self->this_module->get_name(),
prefix);
}
{"_ceph_get_config", (PyCFunction)ceph_config_get, METH_VARARGS,
"Get a configuration value"},
- {"_ceph_get_config_prefix", (PyCFunction)ceph_config_get_prefix, METH_VARARGS,
- "Get all configuration values with a given prefix"},
+ {"_ceph_get_store_prefix", (PyCFunction)ceph_store_get_prefix, METH_VARARGS,
+ "Get all KV store values with a given prefix"},
{"_ceph_set_config", (PyCFunction)ceph_config_set, METH_VARARGS,
"Set a configuration value"},