]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: systemmetaobj::create don't generate random id if id is provided
authorOrit Wasserman <owasserm@redhat.com>
Wed, 23 Sep 2015 15:09:55 +0000 (17:09 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:06 +0000 (16:13 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index 4e75da6ed24147ef73230c39da22236f988f9489..57ace72e87c5dd8f25ca06f8446874a27c6e1af8 100644 (file)
@@ -520,13 +520,15 @@ int RGWSystemMetaObj::create()
     return ret;
   }
 
-  /* create unique id */
-  uuid_d new_uuid;
-  char uuid_str[37];
-  new_uuid.generate_random();
-  new_uuid.print(uuid_str);
-  id = uuid_str;
-
+  if (id.empty()) {
+    /* create unique id */
+    uuid_d new_uuid;
+    char uuid_str[37];
+    new_uuid.generate_random();
+    new_uuid.print(uuid_str);
+    id = uuid_str;
+  }
+  
   ret = store_info(true);
   if (ret < 0) {
     ldout(cct, 0) << "ERROR:  storing info for " << id << ": " << cpp_strerror(-ret) << dendl;