]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allow creating a bucket without current period
authorOrit Wasserman <owasserm@redhat.com>
Tue, 3 Nov 2015 09:09:38 +0000 (10:09 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:27 +0000 (16:13 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index 763bc9e29e2ba78c5c1a8d289b4a3ed29467c8a4..2beffd042860c0f2de75879264db9a7b2c00f99d 100644 (file)
@@ -4715,10 +4715,12 @@ int RGWRados::select_new_bucket_location(RGWUserInfo& user_info, const string& z
 {
   /* first check that rule exists within the specific zonegroup */
   RGWZoneGroup zonegroup;
-  int ret = current_period.get_zonegroup(zonegroup, zonegroup_name);
-  if (ret < 0) {
-    ldout(cct, 0) << "could not find zonegroup " << zonegroup_name << " in zonegroup map" << dendl;
-    return ret;
+  if (!current_period.get_id().empty()) {
+    int ret = current_period.get_zonegroup(zonegroup, zonegroup_name);
+    if (ret < 0) {
+      ldout(cct, 0) << "could not find zonegroup " << zonegroup_name << " in zonegroup map" << dendl;
+      return ret;
+    }
   }
 
   /* now check that tag exists within zonegroup */