diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-15 11:00:05 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-15 11:00:05 -0700 |
commit | a2d2d2ebf9c97486577069c8abb1bf44d400fcbb (patch) | |
tree | e22ef059d691ba6c41e705ecdd01357da8fea925 | |
parent | 086abe441e3bac03688dee3dffd07be87ef2802c (diff) | |
download | ceph-a2d2d2ebf9c97486577069c8abb1bf44d400fcbb.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.cc | 9 |
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> §ions) const void md_config_t::_get_my_sections(std::vector <std::string> §ions) 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"); } |