]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: sync modules: adapt to formattable based config
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 13 Dec 2017 11:43:21 +0000 (03:43 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 12 Apr 2018 22:38:36 +0000 (15:38 -0700)
still need to fix rgw-admin

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_sync_module_aws.cc
src/rgw/rgw_sync_module_es.cc
src/rgw/rgw_sync_module_log.cc

index 7b97e77a18a017ff73a13672bfd1f35db8766aab..943ca93525a715ea720d3834edc76077492c8eb7 100644 (file)
@@ -3645,7 +3645,9 @@ int main(int argc, const char **argv)
         }
 
         string *ptier_type = (tier_type_specified ? &tier_type : nullptr);
-        zone.tier_config = tier_config_add;
+        for (auto a : tier_config_add) {
+          zone.tier_config.set(a.first, a.second);
+        }
 
         bool *psync_from_all = (sync_from_all_specified ? &sync_from_all : nullptr);
         string *predirect_zone = (redirect_zone_set ? &redirect_zone : nullptr);
index cf611c91710ffe72650e2491aaa1d993ec29552e..30d3aa74d9526c98c089af95b7313025b8434d85 100644 (file)
@@ -969,10 +969,10 @@ static int conf_to_uint64(CephContext *cct, const JSONFormattable& config, const
 int RGWAWSSyncModule::create_instance(CephContext *cct, const JSONFormattable& config,  RGWSyncModuleInstanceRef *instance){
   AWSSyncConfig conf;
 
-  conf.s3_endpoint = config["s3_endpoint"]("");
+  conf.s3_endpoint = config["s3_endpoint"];
 
-  string access_key = config["access_key"]("");
-  string secret = config["secret"]("");
+  string access_key = config["access_key"];
+  string secret = config["secret"];
 
   conf.key = RGWAccessKey(access_key, secret);
 
index 2ef7aab0425e56385e178a705a308e22cdc61e7e..b7cefdf5f0dde641935754a6ed7dee374e3510bd 100644 (file)
@@ -117,18 +117,18 @@ struct ElasticConfig {
   uint32_t num_replicas{0};
 
   void init(CephContext *cct, const JSONFormattable& config) {
-    string elastic_endpoint = config.get("endpoint", "");
+    string elastic_endpoint = config["endpoint"];
     id = string("elastic:") + elastic_endpoint;
     conn.reset(new RGWRESTConn(cct, nullptr, id, { elastic_endpoint }));
-    explicit_custom_meta = config.get_bool("explicit_custom_meta", true);
-    index_buckets.init(config.get("index_buckets_list", ""), true); /* approve all buckets by default */
-    allow_owners.init(config.get("approved_owners_list", ""), true); /* approve all bucket owners by default */
-    override_index_path = config.get("override_index_path", "");
-    num_shards = config.get_int("num_shards", ES_NUM_SHARDS_DEFAULT);
+    explicit_custom_meta = config["explicit_custom_meta"](true);
+    index_buckets.init(config["index_buckets_list"], true); /* approve all buckets by default */
+    allow_owners.init(config["approved_owners_list"], true); /* approve all bucket owners by default */
+    override_index_path = config["override_index_path"];
+    num_shards = config["num_shards"](ES_NUM_SHARDS_DEFAULT);
     if (num_shards < ES_NUM_SHARDS_MIN) {
       num_shards = ES_NUM_SHARDS_MIN;
     }
-    num_replicas = config.get_int("num_replicas", ES_NUM_REPLICAS_DEFAULT);
+    num_replicas = config["num_replicas"](ES_NUM_REPLICAS_DEFAULT);
   }
 
   void init_instance(RGWRealm& realm, uint64_t instance_id) {
@@ -609,7 +609,7 @@ RGWRESTMgr *RGWElasticSyncModuleInstance::get_rest_filter(int dialect, RGWRESTMg
 }
 
 int RGWElasticSyncModule::create_instance(CephContext *cct, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) {
-  string endpoint = config["endpoint"]("");
+  string endpoint = config["endpoint"];
   instance->reset(new RGWElasticSyncModuleInstance(cct, config));
   return 0;
 }
index 5e0f8d9e2ee0d3716b32efaf4aa793d9f81a2889..0378c040b6affea5b8ebff6e75c44e83d015c7a7 100644 (file)
@@ -64,7 +64,7 @@ public:
 };
 
 int RGWLogSyncModule::create_instance(CephContext *cct, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) {
-  string prefix = config["prefix"]("");
+  string prefix = config["prefix"];
   instance->reset(new RGWLogSyncModuleInstance(prefix));
   return 0;
 }