mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
fix: drive hw info incomplete when smartinfo fails (#11509)
Collection of SMART information doesn't work in certain scenarios e.g. in a container based setup. In such cases, instead of returning an error (without any data), we should only set the error on the smartinfo struct, so that other important drive hw info like device, mountpoint, etc is retained in the output.
This commit is contained in:
parent
93eb549a83
commit
5a18d437ce
@ -24,7 +24,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/minio/minio/pkg/madmin"
|
||||
"github.com/minio/minio/pkg/smart"
|
||||
@ -99,14 +98,7 @@ func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskH
|
||||
paths = append(paths, path)
|
||||
smartInfo, err := smart.GetInfo(device)
|
||||
if err != nil {
|
||||
if syscall.EACCES == err {
|
||||
smartInfo.Error = fmt.Sprintf("smart: %v", err)
|
||||
} else {
|
||||
return madmin.ServerDiskHwInfo{
|
||||
Addr: addr,
|
||||
Error: fmt.Sprintf("smart: %v", err),
|
||||
}
|
||||
}
|
||||
smartInfo.Error = fmt.Sprintf("smart: %v", err)
|
||||
}
|
||||
partition := madmin.PartitionStat{
|
||||
Device: part.Device,
|
||||
|
Loading…
x
Reference in New Issue
Block a user