Fix sensor read error stops reporting of all sensors in temp input (#5941)

This commit is contained in:
Marc Venturini
2019-06-15 02:27:24 +08:00
committed by Daniel Nelson
parent d260437318
commit 4b6e791908
8 changed files with 18 additions and 14 deletions

View File

@@ -171,7 +171,14 @@ func (s *SystemPS) SwapStat() (*mem.SwapMemoryStat, error) {
}
func (s *SystemPS) Temperature() ([]host.TemperatureStat, error) {
return host.SensorsTemperatures()
temp, err := host.SensorsTemperatures()
if err != nil {
_, ok := err.(*host.Warnings)
if !ok {
return temp, err
}
}
return temp, nil
}
func (s *SystemPSDisk) Partitions(all bool) ([]disk.PartitionStat, error) {