]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: don't duplicate bucket name in bucket_id
authorCasey Bodley <cbodley@redhat.com>
Tue, 19 Oct 2021 17:06:42 +0000 (13:06 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 14 Oct 2023 09:17:59 +0000 (16:17 +0700)
Fixes: https://tracker.ceph.com/issues/52976
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit f61215d85766efc649319fdcca505d5e3e347b3e)

Conflicts:
  - path: src/rgw/rgw_admin.cc
    comment: manually resolve conflicts

src/rgw/rgw_admin.cc

index 0c0bd340555347fd1cfd3bd6788b6a1c11dedb82..96bbd3d1236211912f83325103f550a554129703 100644 (file)
@@ -6675,12 +6675,13 @@ next:
     RGWBucketInfo cur_bucket_info;
     rgw_bucket cur_bucket;
     ret = init_bucket(tenant, bucket_name, string(), cur_bucket_info, cur_bucket);
-    if (ret < 0) {
+    if (ret == -ENOENT) {
+      // no bucket entrypoint
+    } else if (ret < 0) {
       cerr << "ERROR: could not init current bucket info for bucket_name=" << bucket_name << ": " << cpp_strerror(-ret) << std::endl;
       return -ret;
-    }
-
-    if (cur_bucket_info.bucket.bucket_id == bucket_info.bucket.bucket_id && !yes_i_really_mean_it) {
+    } else if (cur_bucket_info.bucket.bucket_id == bucket_info.bucket.bucket_id &&
+               !yes_i_really_mean_it) {
       cerr << "specified bucket instance points to a current bucket instance" << std::endl;
       cerr << "do you really mean it? (requires --yes-i-really-mean-it)" << std::endl;
       return EINVAL;