bucket_id = val;
opt_bucket_id = val;
if (bucket_id.empty()) {
- cerr << "bad bucket-id" << std::endl;
+ cerr << "no value for bucket-id" << std::endl;
exit(1);
}
} else if (ceph_argparse_witharg(args, i, &val, "--bucket-new-name", (char*)NULL)) {
} /* OPT::BUCKETS_LIST */
if (opt_cmd == OPT::BUCKET_STATS) {
+ if (bucket_name.empty() && !bucket_id.empty()) {
+ rgw_bucket bucket;
+ if (!rgw_find_bucket_by_id(store->ctx(), store->ctl()->meta.mgr, marker, bucket_id, &bucket)) {
+ cerr << "failure: no such bucket id" << std::endl;
+ return -ENOENT;
+ }
+ bucket_op.set_tenant(bucket.tenant);
+ bucket_op.set_bucket_name(bucket.name);
+ }
bucket_op.set_fetch_stats(true);
int r = RGWBucketAdminOp::info(store, bucket_op, f);