mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Print node status even in --quiet mode (#9149)
This commit is contained in:
parent
496f4a7dc7
commit
59dced8237
@ -25,6 +25,7 @@ import (
|
||||
"strings"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
color "github.com/minio/minio/pkg/color"
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
)
|
||||
@ -249,8 +250,12 @@ func printObjectAPIMsg() {
|
||||
// Get formatted disk/storage info message.
|
||||
func getStorageInfoMsgSafeMode(storageInfo StorageInfo) string {
|
||||
var msg string
|
||||
var mcMessage string
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||
mcMessage = "Run `mc admin info` to look for server/disk info`"
|
||||
}
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline.%s ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum(), mcMessage)
|
||||
msg += color.Red("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||
}
|
||||
return msg
|
||||
@ -259,8 +264,12 @@ func getStorageInfoMsgSafeMode(storageInfo StorageInfo) string {
|
||||
// Get formatted disk/storage info message.
|
||||
func getStorageInfoMsg(storageInfo StorageInfo) string {
|
||||
var msg string
|
||||
var mcMessage string
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||
mcMessage = "Use `mc admin info` to look for server/disk info"
|
||||
}
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline.%s ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum(), mcMessage)
|
||||
msg += color.Blue("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||
}
|
||||
return msg
|
||||
@ -269,6 +278,9 @@ func getStorageInfoMsg(storageInfo StorageInfo) string {
|
||||
// Prints startup message of storage capacity and erasure information.
|
||||
func printStorageInfo(storageInfo StorageInfo) {
|
||||
if msg := getStorageInfoMsg(storageInfo); msg != "" {
|
||||
if globalCLIContext.Quiet {
|
||||
logger.Info(msg)
|
||||
}
|
||||
logStartupMessage(msg)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user