From: Volker Theile Date: Fri, 2 Nov 2018 12:10:40 +0000 (+0100) Subject: rgw: Return tenant field in bucket_stats function X-Git-Tag: v14.1.0~1012^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24895%2Fhead;p=ceph.git rgw: Return tenant field in bucket_stats function Fixes: https://tracker.ceph.com/issues/36681 Signed-off-by: Volker Theile --- diff --git a/qa/tasks/radosgw_admin_rest.py b/qa/tasks/radosgw_admin_rest.py index 8a4bf3c0feec..28e47e53b7d9 100644 --- a/qa/tasks/radosgw_admin_rest.py +++ b/qa/tasks/radosgw_admin_rest.py @@ -382,6 +382,7 @@ def task(ctx, config): assert ret == 200 assert out['owner'] == user1 + assert out['tenant'] == '' bucket_id = out['id'] # TESTCASE 'bucket-stats4','bucket','stats','new empty bucket','succeeds, expected bucket ID' diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index fc44adeac669..006b1d62493f 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1420,6 +1420,7 @@ static int bucket_stats(RGWRados *store, const std::string& tenant_name, std::st formatter->open_object_section("stats"); formatter->dump_string("bucket", bucket.name); + formatter->dump_string("tenant", bucket.tenant); formatter->dump_string("zonegroup", bucket_info.zonegroup); formatter->dump_string("placement_rule", bucket_info.placement_rule); ::encode_json("explicit_placement", bucket.explicit_placement, formatter);