]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_frontend.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / rgw / rgw_frontend.cc
index f22ec12454c1085acc02bf6aca32ee3a92457960..fbde27ae6cf25a0f81f0bcf25e0827f354faefe6 100644 (file)
@@ -1,5 +1,5 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
+// vim: ts=8 sw=2 smarttab ft=cpp
 
 #include <signal.h>
 
@@ -45,6 +45,27 @@ int RGWFrontendConfig::parse_config(const string& config,
   return 0;
 }
 
+void RGWFrontendConfig::set_default_config(RGWFrontendConfig& def_conf)
+{
+  const auto& def_conf_map = def_conf.get_config_map();
+
+  for (auto& entry : def_conf_map) {
+    if (config_map.find(entry.first) == config_map.end()) {
+      config_map.emplace(entry.first, entry.second);
+    }
+  }
+}
+
+std::optional<string> RGWFrontendConfig::get_val(const std::string& key)
+{
+ auto iter = config_map.find(key);
+ if (iter == config_map.end()) {
+   return std::nullopt;
+ }
+
+ return iter->second;
+}
+
 bool RGWFrontendConfig::get_val(const string& key, const string& def_val,
                                string *out)
 {