]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: 'period commit' sends to new master zone by default 9055/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 10 May 2016 19:51:27 +0000 (15:51 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 10 May 2016 20:09:23 +0000 (16:09 -0400)
if no --remote or --url is given, set --remote = master_zone_id to
override the rest_master_conn (which refers to the old master zone)

Fixes: http://tracker.ceph.com/issues/15828
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc

index 3efe18dc418b2c44d75eeae1132c420744996a8a..05f6f2318746fb5e14e7195744f4585e435426e3 100644 (file)
@@ -1384,7 +1384,7 @@ static int send_to_remote_or_url(const string& remote, const string& url,
 }
 
 static int commit_period(RGWRealm& realm, RGWPeriod& period,
-                         const string& remote, const string& url,
+                         string remote, const string& url,
                          const string& access, const string& secret)
 {
   const string& master_zone = period.get_master_zone();
@@ -1410,6 +1410,12 @@ static int commit_period(RGWRealm& realm, RGWPeriod& period,
     return ret;
   }
 
+  if (remote.empty() && url.empty()) {
+    // use the new master zone's connection
+    remote = master_zone;
+    cout << "Sending period to new master zone " << remote << std::endl;
+  }
+
   // push period to the master with an empty period id
   period.set_id("");