Skip to content

Commit

Permalink
rgw: avoid showing payer when payer == owner
Browse files Browse the repository at this point in the history
If the payer matches the owner it shows the owner only.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
  • Loading branch information
jmunhoz committed Mar 5, 2016
1 parent c007493 commit 59d098c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rgw/rgw_usage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 59d098c

Please sign in to comment.