From 85f814eb44ed4260daa1737ad286f0df83e694e6 Mon Sep 17 00:00:00 2001 From: ebozduman Date: Wed, 11 Dec 2019 20:46:30 -0800 Subject: [PATCH] Stops showing usage info if Bucket#=0 (#3007) --- cmd/admin-info.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/admin-info.go b/cmd/admin-info.go index ee6785cb..8cc5b704 100644 --- a/cmd/admin-info.go +++ b/cmd/admin-info.go @@ -172,10 +172,11 @@ func (u clusterStruct) String() (msg string) { // Summary on used space, total no of buckets and // total no of objects at the Cluster level usedTotal := humanize.IBytes(uint64(u.Info.Usage.Size)) - msg += fmt.Sprintf("%s Used, %s, %s", usedTotal, - english.Plural(u.Info.Buckets.Count, "Bucket", ""), - english.Plural(u.Info.Objects.Count, "Object", "")) - + if u.Info.Buckets.Count > 0 { + msg += fmt.Sprintf("%s Used, %s, %s", usedTotal, + english.Plural(u.Info.Buckets.Count, "Bucket", ""), + english.Plural(u.Info.Objects.Count, "Object", "")) + } if backendType != "FS" { // Summary on total no of online and total // number of offline disks at the Cluster level