]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: allow --remote to specify zone or zonegroup id
authorCasey Bodley <cbodley@redhat.com>
Tue, 10 May 2016 19:48:33 +0000 (15:48 -0400)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 May 2016 21:18:40 +0000 (14:18 -0700)
--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>
(cherry picked from commit 9fcff89ee1e60009fa367e33c915a90354c9a9cc)

src/rgw/rgw_admin.cc
src/test/cli/radosgw-admin/help.t

index 3e4bcba2790b6dbbbaf9402271ffb9c4e780e805..c54093fa612597926f901aebf60d705cb4000b24 100644 (file)
@@ -183,7 +183,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";
@@ -1315,10 +1315,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;
   }
index 5867f00c6349cc0ffbdfe70bcf66c726ef9af1ee..1d7c1b8fd07e69556ca070f34c0eae64bdfa3339 100644 (file)
                                  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'