From: Yehuda Sadeh Date: Wed, 3 Feb 2016 20:29:08 +0000 (-0800) Subject: rgw: fail when trying to commit period if no master zone configured X-Git-Tag: v10.1.0~354^2~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a0d437b96f152e1f4baaac0b9c52b2f0f65ccaa;p=ceph.git rgw: fail when trying to commit period if no master zone configured Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index ce9711c016a2..97a564c66695 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1367,8 +1367,13 @@ static int commit_period(RGWRealm& realm, RGWPeriod& period, const string& remote, const string& url, const string& access, const string& secret) { + const string& master_zone = period.get_master_zone(); + if (master_zone.empty()) { + cerr << "cannot commit period: period does not have a master zone of a master zonegroup" << std::endl; + return -EINVAL; + } // are we the period's master zone? - if (store->get_zone_params().get_id() == period.get_master_zone()) { + if (store->get_zone_params().get_id() == master_zone) { // read the current period RGWPeriod current_period; int ret = current_period.init(g_ceph_context, store, realm.get_id());