mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Fix storage info message on startup (#9177)
This commit is contained in:
parent
bf545dc320
commit
27b8f18cce
@ -253,11 +253,14 @@ func getStorageInfoMsgSafeMode(storageInfo StorageInfo) string {
|
||||
var mcMessage string
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||
mcMessage = "Run `mc admin info` to look for server/disk info`"
|
||||
mcMessage = "Use `mc admin info` to look for latest server/disk info`"
|
||||
}
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline.%s ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum(), mcMessage)
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||
msg += color.Red("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||
}
|
||||
if len(mcMessage) > 0 {
|
||||
msg = fmt.Sprintf("%s %s", mcMessage, msg)
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
@ -267,10 +270,14 @@ func getStorageInfoMsg(storageInfo StorageInfo) string {
|
||||
var mcMessage string
|
||||
if storageInfo.Backend.Type == BackendErasure {
|
||||
if storageInfo.Backend.OfflineDisks.Sum() > 0 {
|
||||
mcMessage = "Use `mc admin info` to look for server/disk info"
|
||||
mcMessage = "Use `mc admin info` to look for latest server/disk info"
|
||||
}
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline.%s ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum(), mcMessage)
|
||||
|
||||
diskInfo := fmt.Sprintf(" %d Online, %d Offline. ", storageInfo.Backend.OnlineDisks.Sum(), storageInfo.Backend.OfflineDisks.Sum())
|
||||
msg += color.Blue("Status:") + fmt.Sprintf(getFormatStr(len(diskInfo), 8), diskInfo)
|
||||
if len(mcMessage) > 0 {
|
||||
msg = fmt.Sprintf("%s %s", mcMessage, msg)
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user