#undef dout_prefix
#define dout_prefix *_dout << "mgr[py] "
+// definition for non-const static member
+std::string PyModules::config_prefix;
+
namespace {
PyObject* log_write(PyObject*, PyObject* args) {
char* m = nullptr;
Mutex::Locker locker(lock);
global_handle = this;
+ // namespace in config-key prefixed by "mgr/<id>/"
+ config_prefix = std::string(g_conf->name.get_type_str()) + "/" +
+ g_conf->name.get_id() + "/";
// Set up global python interpreter
Py_SetProgramName(const_cast<char*>(PYTHON_EXECUTABLE));
Mutex::Locker l(lock);
PyEval_RestoreThread(tstate);
- const std::string global_key = config_prefix + handle + "." + key;
+ const std::string global_key = config_prefix + handle + "/" + key;
dout(4) << __func__ << "key: " << global_key << dendl;
void PyModules::set_config(const std::string &handle,
const std::string &key, const std::string &val)
{
- const std::string global_key = config_prefix + handle + "." + key;
+ const std::string global_key = config_prefix + handle + "/" + key;
Command set_cmd;
{
std::string get_site_packages();
public:
- static constexpr auto config_prefix = "mgr.";
+ static std::string config_prefix;
PyModules(DaemonStateIndex &ds, ClusterState &cs, MonClient &mc,
Objecter &objecter_, Client &client_,