From a755c95262e10fac774716e460e2ba2eaee9df70 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 14 Mar 2017 14:18:15 -0400 Subject: [PATCH] rgw-admin: remove deprecated regionmap commands Fixes: http://tracker.ceph.com/issues/18725 Signed-off-by: Casey Bodley (cherry picked from commit 5830c1849a0c0110d17c37784808e456e6dcb7b3) Conflicts: src/rgw/rgw_admin.cc (trivial resolution) --- src/rgw/rgw_admin.cc | 108 ++---------------------------- src/test/cli/radosgw-admin/help.t | 3 - 2 files changed, 4 insertions(+), 107 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a242d3df4bed1..b0055ab6663c4 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -116,8 +116,6 @@ void _usage() cout << " zonegroup placement modify modify a placement target of a specific zonegroup\n"; cout << " zonegroup placement rm remove a placement target from a zonegroup\n"; cout << " zonegroup placement default set a zonegroup's default placement target\n"; - cout << " zonegroup-map get show zonegroup-map\n"; - cout << " zonegroup-map set set zonegroup-map (requires infile)\n"; cout << " zone create create a new zone\n"; cout << " zone delete delete a zone\n"; cout << " zone get show zone cluster params\n"; @@ -250,7 +248,6 @@ void _usage() cout << " --categories= comma separated list of categories, used in usage show\n"; cout << " --caps= list of caps (e.g., \"usage=read, write; user=read\"\n"; cout << " --yes-i-really-mean-it required for certain operations\n"; - cout << " --reset-regions reset regionmap when regionmap update\n"; cout << " --bypass-gc when specified with bucket deletion, triggers\n"; cout << " object deletions by not involving GC\n"; cout << " --inconsistent-index when specified with bucket deletion and bypass-gc set to true,\n"; @@ -346,10 +343,7 @@ enum { OPT_ZONEGROUP_PLACEMENT_RM, OPT_ZONEGROUP_PLACEMENT_LIST, OPT_ZONEGROUP_PLACEMENT_DEFAULT, - OPT_ZONEGROUPMAP_GET, - OPT_ZONEGROUPMAP_SET, - OPT_ZONEGROUPMAP_UPDATE, - OPT_ZONE_CREATE, + OPT_ZONE_CREATE, OPT_ZONE_DELETE, OPT_ZONE_GET, OPT_ZONE_MODIFY, @@ -441,9 +435,6 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_ strcmp(cmd, "pools") == 0 || strcmp(cmd, "quota") == 0 || strcmp(cmd, "realm") == 0 || - strcmp(cmd, "region") == 0 || - strcmp(cmd, "region-map") == 0 || - strcmp(cmd, "regionmap") == 0 || strcmp(cmd, "replicalog") == 0 || strcmp(cmd, "subuser") == 0 || strcmp(cmd, "sync") == 0 || @@ -451,9 +442,7 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_ strcmp(cmd, "user") == 0 || strcmp(cmd, "zone") == 0 || strcmp(cmd, "zonegroup") == 0 || - strcmp(cmd, "zonegroups") == 0 || - strcmp(cmd, "zonegroup-map") == 0 || - strcmp(cmd, "zonegroupmap") == 0 ) + strcmp(cmd, "zonegroups") == 0) { *need_more = true; return 0; @@ -631,8 +620,7 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_ return OPT_ZONEGROUP_PLACEMENT_LIST; if (strcmp(cmd, "default") == 0) return OPT_ZONEGROUP_PLACEMENT_DEFAULT; - } else if (strcmp(prev_cmd, "zonegroup") == 0 || - strcmp(prev_cmd, "region") == 0) { + } else if (strcmp(prev_cmd, "zonegroup") == 0) { if (strcmp(cmd, "add") == 0) return OPT_ZONEGROUP_ADD; if (strcmp(cmd, "create")== 0) @@ -660,20 +648,9 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_ return OPT_QUOTA_ENABLE; if (strcmp(cmd, "disable") == 0) return OPT_QUOTA_DISABLE; - } else if (strcmp(prev_cmd, "zonegroups") == 0 || - strcmp(prev_cmd, "regions") == 0) { + } else if (strcmp(prev_cmd, "zonegroups") == 0) { if (strcmp(cmd, "list") == 0) return OPT_ZONEGROUP_LIST; - } else if (strcmp(prev_cmd, "zonegroup-map") == 0 || - strcmp(prev_cmd, "zonegroupmap") == 0 || - strcmp(prev_cmd, "region-map") == 0 || - strcmp(prev_cmd, "regionmap") == 0) { - if (strcmp(cmd, "get") == 0) - return OPT_ZONEGROUPMAP_GET; - if (strcmp(cmd, "set") == 0) - return OPT_ZONEGROUPMAP_SET; - if (strcmp(cmd, "update") == 0) - return OPT_ZONEGROUPMAP_UPDATE; } else if ((prev_prev_cmd && strcmp(prev_prev_cmd, "zone") == 0) && (strcmp(prev_cmd, "placement") == 0)) { if (strcmp(cmd, "add") == 0) @@ -2285,7 +2262,6 @@ int main(int argc, char **argv) int include_all = false; int sync_stats = false; - int reset_regions = false; int bypass_gc = false; int inconsistent_index = false; @@ -2509,8 +2485,6 @@ int main(int argc, char **argv) // do nothing } else if (ceph_argparse_binary_flag(args, i, &include_all, NULL, "--include-all", (char*)NULL)) { // do nothing - } else if (ceph_argparse_binary_flag(args, i, &reset_regions, NULL, "--reset-regions", (char*)NULL)) { - // do nothing } else if (ceph_argparse_binary_flag(args, i, &extra_info, NULL, "--extra-info", (char*)NULL)) { // do nothing } else if (ceph_argparse_binary_flag(args, i, &bypass_gc, NULL, "--bypass-gc", (char*)NULL)) { @@ -2712,8 +2686,6 @@ int main(int argc, char **argv) OPT_ZONEGROUP_PLACEMENT_ADD, OPT_ZONEGROUP_PLACEMENT_RM, OPT_ZONEGROUP_PLACEMENT_MODIFY, OPT_ZONEGROUP_PLACEMENT_LIST, OPT_ZONEGROUP_PLACEMENT_DEFAULT, - OPT_ZONEGROUPMAP_GET, OPT_ZONEGROUPMAP_SET, - OPT_ZONEGROUPMAP_UPDATE, OPT_ZONE_CREATE, OPT_ZONE_DELETE, OPT_ZONE_GET, OPT_ZONE_SET, OPT_ZONE_RENAME, OPT_ZONE_LIST, OPT_ZONE_MODIFY, OPT_ZONE_DEFAULT, @@ -3551,78 +3523,6 @@ int main(int argc, char **argv) formatter->flush(cout); } break; - case OPT_ZONEGROUPMAP_GET: - { - RGWZoneGroupMap zonegroupmap; - - int ret = zonegroupmap.read(g_ceph_context, store); - if (ret < 0 && ret != -ENOENT) { - cerr << "failed to read zonegroupmap info: " << cpp_strerror(ret); - return ret; - } - - encode_json("zonegroup-map", zonegroupmap, formatter); - formatter->flush(cout); - } - break; - case OPT_ZONEGROUPMAP_SET: - { - RGWZoneGroupMap zonegroupmap; - int ret = read_decode_json(infile, zonegroupmap); - if (ret < 0) { - cerr << "ERROR: failed to read map json: " << cpp_strerror(-ret) << std::endl; - return ret; - } - - RGWPeriod period; - ret = period.init(g_ceph_context, store); - if (ret < 0) { - cerr << "ERROR: failed to read current period info: " << cpp_strerror(-ret) << std::endl; - return ret; - } - - period.fork(); - period.update(zonegroupmap); - period.store_info(false); - - encode_json("zonegroup-map", zonegroupmap, formatter); - formatter->flush(cout); - } - break; - case OPT_ZONEGROUPMAP_UPDATE: - { - RGWZoneGroupMap zonegroupmap; - int ret = zonegroupmap.read(g_ceph_context, store); - if (ret < 0 && ret != -ENOENT) { - cerr << "failed to read zonegroup map: " << cpp_strerror(-ret) << std::endl; - return -ret; - } - - if (reset_regions) { - zonegroupmap.zonegroups.clear(); - } - - list realms; - ret = store->list_realms(realms); - if (ret < 0) { - cerr << "failed to list realms: " << cpp_strerror(-ret) << std::endl; - return -ret; - } - - for (list::iterator iter = realms.begin(); iter != realms.end(); ++iter) - { - RGWRealm realm("", *iter); - ret = realm.init(g_ceph_context, store); - if (ret < 0) { - cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl; - return -ret; - } - } - - encode_json("zonegroup-map", zonegroupmap, formatter); - formatter->flush(cout); - } - break; case OPT_ZONE_CREATE: { if (zone_name.empty()) { diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index 4c2109a885622..010eacaefbdd0 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -67,8 +67,6 @@ zonegroup placement modify modify a placement target of a specific zonegroup zonegroup placement rm remove a placement target from a zonegroup zonegroup placement default set a zonegroup's default placement target - zonegroup-map get show zonegroup-map - zonegroup-map set set zonegroup-map (requires infile) zone create create a new zone zone delete delete a zone zone get show zone cluster params @@ -201,7 +199,6 @@ --categories= comma separated list of categories, used in usage show --caps= list of caps (e.g., "usage=read, write; user=read" --yes-i-really-mean-it required for certain operations - --reset-regions reset regionmap when regionmap update --bypass-gc when specified with bucket deletion, triggers object deletions by not involving GC --inconsistent-index when specified with bucket deletion and bypass-gc set to true, -- 2.39.5