From 9440776f0625451a535d87749d65c8835a76e261 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Fri, 2 Nov 2018 13:10:40 +0100 Subject: [PATCH] rgw: Return tenant field in bucket_stats function Fixes: https://tracker.ceph.com/issues/36681 Signed-off-by: Volker Theile --- qa/tasks/radosgw_admin_rest.py | 1 + src/rgw/rgw_bucket.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/qa/tasks/radosgw_admin_rest.py b/qa/tasks/radosgw_admin_rest.py index 8a4bf3c0fee..28e47e53b7d 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 fc44adeac66..006b1d62493 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); -- 2.39.5