summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-08-15 11:00:05 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-08-15 11:00:05 -0700
commita2d2d2ebf9c97486577069c8abb1bf44d400fcbb (patch)
treee22ef059d691ba6c41e705ecdd01357da8fea925
parent086abe441e3bac03688dee3dffd07be87ef2802c (diff)
downloadceph-wip-5978.tar.gz
rgw: create conf file hierarchywip-5978
Fixes: #5978 Create a more flexible conf file hierarchy. E.g., for x.y.z we'd go [x.y.z] -> [x.y] -> [x] -> global Signed-off-by: Yehuda Sadeh <yehuda@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/common/config.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/config.cc b/src/common/config.cc
index 5c64f4ec151..3d25e8349d6 100644
--- a/src/common/config.cc
+++ b/src/common/config.cc
@@ -799,9 +799,14 @@ void md_config_t::get_my_sections(std::vector <std::string> &sections) const
void md_config_t::_get_my_sections(std::vector <std::string> &sections) const
{
assert(lock.is_locked());
- sections.push_back(name.to_str());
- sections.push_back(name.get_type_name());
+ string s = name.to_str();
+ sections.push_back(s);
+ size_t pos = s.rfind('.');
+ while (pos > 0 && pos != string::npos) {
+ sections.push_back(s.substr(0, pos));
+ pos = s.rfind('.', pos - 1);
+ }
sections.push_back("global");
}