From a2d2d2ebf9c97486577069c8abb1bf44d400fcbb Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 15 Aug 2013 11:00:05 -0700 Subject: rgw: create conf file hierarchy 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 Signed-off-by: Yehuda Sadeh --- src/common/config.cc | 9 +++++++-- 1 file 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 §ions) const void md_config_t::_get_my_sections(std::vector §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"); } -- cgit v1.2.1