From: Casey Bodley Date: Tue, 10 May 2016 19:48:33 +0000 (-0400) Subject: radosgw-admin: allow --remote to specify zone or zonegroup id X-Git-Tag: v11.0.0~592^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9fcff89ee1e60009fa367e33c915a90354c9a9cc;p=ceph.git radosgw-admin: allow --remote to specify zone or zonegroup id --remote was only looking for zonegroup connections. extended to check for zone connections as well updated the usage to clarify that it expects zone/zonegroup ids Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 689b59d972bd..3efe18dc418b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -184,7 +184,7 @@ void _usage() cout << " replica mdlog get/delete\n"; cout << " replica datalog get/delete\n"; cout << " --metadata-key= key to retrieve metadata from with metadata get\n"; - cout << " --remote= remote to pull period\n"; + cout << " --remote= zone or zonegroup id of remote gateway\n"; cout << " --period= period id\n"; cout << " --epoch= period epoch\n"; cout << " --commit commit the period during 'period update'\n"; @@ -1322,10 +1322,16 @@ static int send_to_remote_gateway(const string& remote, req_info& info, } conn = store->rest_master_conn; } else { + // check zonegroups auto iter = store->zonegroup_conn_map.find(remote); if (iter == store->zonegroup_conn_map.end()) { - cerr << "could not find connection to: " << remote << std::endl; - return -ENOENT; + // check zones + iter = store->zone_conn_map.find(remote); + if (iter == store->zone_conn_map.end()) { + cerr << "could not find connection for zone or zonegroup id: " + << remote << std::endl; + return -ENOENT; + } } conn = iter->second; } diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index 1fbaee2ec5f6..e660bbb68b2f 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -136,7 +136,7 @@ replica mdlog get/delete replica datalog get/delete --metadata-key= key to retrieve metadata from with metadata get - --remote= remote to pull period + --remote= zone or zonegroup id of remote gateway --period= period id --epoch= period epoch --commit commit the period during 'period update'