From: Casey Bodley Date: Tue, 19 Oct 2021 17:06:42 +0000 (-0400) Subject: radosgw-admin: don't duplicate bucket name in bucket_id X-Git-Tag: v16.2.15~113^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b8fa7fa2f3c72770f0f77fd16b051d0836723c2;p=ceph.git radosgw-admin: don't duplicate bucket name in bucket_id Fixes: https://tracker.ceph.com/issues/52976 Signed-off-by: Casey Bodley (cherry picked from commit f61215d85766efc649319fdcca505d5e3e347b3e) Conflicts: - path: src/rgw/rgw_admin.cc comment: manually resolve conflicts --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 0c0bd3405553..96bbd3d12362 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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;