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 <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2016-05-10 15:48:33 -04:00
parent c431924742
commit 9fcff89ee1
2 changed files with 10 additions and 4 deletions

View File

@ -184,7 +184,7 @@ void _usage()
cout << " replica mdlog get/delete\n";
cout << " replica datalog get/delete\n";
cout << " --metadata-key=<key> key to retrieve metadata from with metadata get\n";
cout << " --remote=<remote> remote to pull period\n";
cout << " --remote=<remote> zone or zonegroup id of remote gateway\n";
cout << " --period=<id> period id\n";
cout << " --epoch=<number> 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;
}

View File

@ -136,7 +136,7 @@
replica mdlog get/delete
replica datalog get/delete
--metadata-key=<key> key to retrieve metadata from with metadata get
--remote=<remote> remote to pull period
--remote=<remote> zone or zonegroup id of remote gateway
--period=<id> period id
--epoch=<number> period epoch
--commit commit the period during 'period update'