]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: avoid showing payer when payer == owner 7918/head
authorJavier M. Mellid <jmunhoz@igalia.com>
Wed, 2 Mar 2016 17:43:24 +0000 (18:43 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 4 Mar 2016 00:07:39 +0000 (16:07 -0800)
If the payer matches the owner it shows the owner only.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
src/rgw/rgw_usage.cc

index 82ab5ae584bfbd88935b7cd67c585767d7890bf1..03a4ab4de0881f08da048d44e279e5458aa6400e 100644 (file)
@@ -88,9 +88,10 @@ int RGWUsage::show(RGWRados *store, rgw_user& uid, uint64_t start_epoch,
         utime_t ut(entry.epoch, 0);
         ut.gmtime(formatter->dump_stream("time"));
         formatter->dump_int("epoch", entry.epoch);
-        formatter->dump_string("owner", entry.owner.to_str());
+        string owner = entry.owner.to_str();
         string payer = entry.payer.to_str();
-        if (!payer.empty()) {
+        formatter->dump_string("owner", owner);
+        if (!payer.empty() && payer != owner) {
           formatter->dump_string("payer", payer);
         }
         dump_usage_categories_info(formatter, entry, categories);