From: Casey Bodley Date: Sun, 4 Feb 2024 16:37:57 +0000 (-0500) Subject: radosgw-admin: make SiteConfig available to commands X-Git-Tag: testing/wip-root-testing-20240411.174241^2~32 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=82c50f4e4db2e32bece24ada46e2d12216891e42;p=ceph-ci.git radosgw-admin: make SiteConfig available to commands Signed-off-by: Casey Bodley (cherry picked from commit 0f333f1cc5a265015d4d436e1275ffadc2d0d8d4) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index eae3736bb7d..886e4bc005b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -4093,6 +4093,7 @@ int main(int argc, const char **argv) common_init_finish(g_ceph_context); std::unique_ptr cfgstore; + std::unique_ptr site; if (args.empty()) { usage(); @@ -4279,8 +4280,6 @@ int main(int argc, const char **argv) return EIO; } - std::unique_ptr site; - if (raw_storage_op) { site = rgw::SiteConfig::make_fake(); driver = DriverManager::get_raw_storage(dpp(), g_ceph_context, @@ -10656,12 +10655,6 @@ next: } if (opt_cmd == OPT::PUBSUB_TOPIC_LIST) { - auto site = std::make_unique(); - ret = site->load(dpp(), null_yield, cfgstore.get()); - if (ret < 0) { - std::cerr << "Unable to initialize site config." << std::endl; - exit(1); - } RGWPubSub ps(driver, tenant, &site->get_period()->get_map().zonegroups); rgw_pubsub_topics result; ret = ps.get_topics(dpp(), result, null_yield); @@ -10705,12 +10698,6 @@ next: cerr << "ERROR: topic name was not provided (via --topic)" << std::endl; return EINVAL; } - auto site = std::make_unique(); - ret = site->load(dpp(), null_yield, cfgstore.get()); - if (ret < 0) { - std::cerr << "Unable to initialize site config." << std::endl; - exit(1); - } RGWPubSub ps(driver, tenant, &site->get_period()->get_map().zonegroups); rgw_pubsub_topic topic; @@ -10788,12 +10775,6 @@ next: return -ret; } - auto site = std::make_unique(); - ret = site->load(dpp(), null_yield, cfgstore.get()); - if (ret < 0) { - std::cerr << "Unable to initialize site config." << std::endl; - exit(1); - } RGWPubSub ps(driver, tenant, &site->get_period()->get_map().zonegroups); ret = ps.remove_topic(dpp(), topic_name, null_yield);