@ -1251,35 +1251,29 @@ fi
* /
* /
func formatsToDrivesInfo ( endpoints EndpointList , formats [ ] * formatXLV3 , sErrs [ ] error ) ( beforeDrives [ ] madmin . DriveInfo ) {
func formatsToDrivesInfo ( endpoints EndpointList , formats [ ] * formatXLV3 , sErrs [ ] error ) ( beforeDrives [ ] madmin . DriveInfo ) {
beforeDrives = make ( [ ] madmin . DriveInfo , len ( endpoints ) )
// Existing formats are available (i.e. ok), so save it in
// Existing formats are available (i.e. ok), so save it in
// result, also populate disks to be healed.
// result, also populate disks to be healed.
for i , format := range formats {
for i , format := range formats {
drive := endpoints . GetString ( i )
drive := endpoints . GetString ( i )
var state = madmin . DriveStateCorrupt
switch {
switch {
case format != nil :
case format != nil :
beforeDrives = append ( beforeDrives , madmin . DriveInfo {
state = madmin . DriveStateOk
UUID : format . XL . This ,
Endpoint : drive ,
State : madmin . DriveStateOk ,
} )
case sErrs [ i ] == errUnformattedDisk :
case sErrs [ i ] == errUnformattedDisk :
beforeDrives = append ( beforeDrives , madmin . DriveInfo {
state = madmin . DriveStateMissing
UUID : "" ,
Endpoint : drive ,
State : madmin . DriveStateMissing ,
} )
case sErrs [ i ] == errDiskNotFound :
case sErrs [ i ] == errDiskNotFound :
beforeDrives = append ( beforeDrives , madmin . DriveInfo {
state = madmin . DriveStateOffline
UUID : "" ,
}
Endpoint : drive ,
beforeDrives [ i ] = madmin . DriveInfo {
State : madmin . DriveStateOffline ,
UUID : func ( ) string {
} )
if format != nil {
default :
return format . XL . This
beforeDrives = append ( beforeDrives , madmin . DriveInfo {
}
UUID : "" ,
return ""
Endpoint : drive ,
} ( ) ,
State : madmin . DriveStateCorrupt ,
Endpoint : drive ,
} )
State : state ,
}
}
}
}