From 0f333f1cc5a265015d4d436e1275ffadc2d0d8d4 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Sun, 4 Feb 2024 11:37:57 -0500 Subject: [PATCH] radosgw-admin: make SiteConfig available to commands Signed-off-by: Casey Bodley --- src/rgw/rgw_admin.cc | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index bbd9231893fb1..be91c66e9ff87 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, @@ -10651,12 +10650,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); @@ -10700,12 +10693,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; @@ -10783,12 +10770,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); -- 2.39.5