mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
More tests for web handlers (#2755)
* Return negative values of Total and Free in StorageInfo() when we fail to get disk info * Return consistent messages in web handlers when the server is not initialized
This commit is contained in:
committed by
Harshavardhana
parent
79e0c52fc2
commit
fc783f8407
@@ -224,6 +224,12 @@ func (xl xlObjects) StorageInfo() StorageInfo {
|
||||
// Sort so that the first element is the smallest.
|
||||
sort.Sort(byDiskTotal(disksInfo))
|
||||
|
||||
if len(disksInfo) == 0 {
|
||||
return StorageInfo{
|
||||
Total: -1,
|
||||
Free: -1,
|
||||
}
|
||||
}
|
||||
// Return calculated storage info, choose the lowest Total and
|
||||
// Free as the total aggregated values. Total capacity is always
|
||||
// the multiple of smallest disk among the disk list.
|
||||
|
||||
Reference in New Issue
Block a user