From 5c377c88571ca6879380ef44461761d99a4045b3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 16 Feb 2021 18:27:08 -0500 Subject: [PATCH] mgr: rename config_prefix -> mgr_store_prefix The prefix for module kv store is "mgr/", but it is not *config* (which lives under /config/mgr/...). Rename the constant. Signed-off-by: Sage Weil (cherry picked from commit 3bafb5e571681dd71df35bf1863a95d69142d02d) --- src/mgr/ActivePyModules.cc | 8 ++++---- src/mgr/Mgr.cc | 2 +- src/mgr/PyModule.cc | 2 +- src/mgr/PyModule.h | 2 +- src/mgr/StandbyPyModules.cc | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 57c0e45de8dcd..8fcb114efaafd 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -24,7 +24,7 @@ #include "mgr/MgrContext.h" -// For ::config_prefix +// For ::mgr_store_prefix #include "PyModule.h" #include "PyModuleRegistry.h" #include "PyUtil.h" @@ -556,7 +556,7 @@ bool ActivePyModules::get_store(const std::string &module_name, std::lock_guard l(lock); PyEval_RestoreThread(tstate); - const std::string global_key = PyModule::config_prefix + const std::string global_key = PyModule::mgr_store_prefix + module_name + "/" + key; dout(4) << __func__ << " key: " << global_key << dendl; @@ -649,7 +649,7 @@ PyObject *ActivePyModules::get_store_prefix(const std::string &module_name, std::lock_guard lock(module_config.lock); PyEval_RestoreThread(tstate); - const std::string base_prefix = PyModule::config_prefix + const std::string base_prefix = PyModule::mgr_store_prefix + module_name + "/"; const std::string global_prefix = base_prefix + prefix; dout(4) << __func__ << " prefix: " << global_prefix << dendl; @@ -667,7 +667,7 @@ PyObject *ActivePyModules::get_store_prefix(const std::string &module_name, void ActivePyModules::set_store(const std::string &module_name, const std::string &key, const boost::optional& val) { - const std::string global_key = PyModule::config_prefix + const std::string global_key = PyModule::mgr_store_prefix + module_name + "/" + key; Command set_cmd; diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index 26422e150e797..91e5ed482698d 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -179,7 +179,7 @@ std::map Mgr::load_store() dout(20) << "saw key '" << key << "'" << dendl; - const std::string store_prefix = PyModule::config_prefix; + const std::string store_prefix = PyModule::mgr_store_prefix; const std::string device_prefix = "device/"; if (key.substr(0, device_prefix.size()) == device_prefix || diff --git a/src/mgr/PyModule.cc b/src/mgr/PyModule.cc index 6595f4426c257..60c18eb3773a1 100644 --- a/src/mgr/PyModule.cc +++ b/src/mgr/PyModule.cc @@ -28,7 +28,7 @@ #define dout_prefix *_dout << "mgr[py] " // definition for non-const static member -std::string PyModule::config_prefix = "mgr/"; +std::string PyModule::mgr_store_prefix = "mgr/"; // Courtesy of http://stackoverflow.com/questions/1418015/how-to-get-python-exception-text #define BOOST_BIND_GLOBAL_PLACEHOLDERS diff --git a/src/mgr/PyModule.h b/src/mgr/PyModule.h index 72a3ef491fa27..6df3ee5860f4c 100644 --- a/src/mgr/PyModule.h +++ b/src/mgr/PyModule.h @@ -86,7 +86,7 @@ private: std::map options; public: - static std::string config_prefix; + static std::string mgr_store_prefix; SafeThreadState pMyThreadState; PyObject *pClass = nullptr; diff --git a/src/mgr/StandbyPyModules.cc b/src/mgr/StandbyPyModules.cc index 3579ae68acee6..86ee8550cadd5 100644 --- a/src/mgr/StandbyPyModules.cc +++ b/src/mgr/StandbyPyModules.cc @@ -20,7 +20,7 @@ #include "mgr/MgrContext.h" #include "mgr/Gil.h" -// For ::config_prefix +// For ::mgr_store_prefix #include "PyModuleRegistry.h" #define dout_context g_ceph_context @@ -143,7 +143,7 @@ bool StandbyPyModule::get_store(const std::string &key, std::string *value) const { - const std::string global_key = PyModule::config_prefix + const std::string global_key = PyModule::mgr_store_prefix + get_name() + "/" + key; dout(4) << __func__ << " key: " << global_key << dendl; -- 2.39.5