Add missing error check in InfiniBandPerfQueryMetric

This commit is contained in:
Thomas Roehl 2022-02-08 13:46:19 +01:00
parent 8c744617be
commit cc86fc00a0

View File

@ -50,6 +50,9 @@ func (m *InfinibandPerfQueryCollector) Init(config json.RawMessage) error {
m.lids = make(map[string]map[string]string) m.lids = make(map[string]map[string]string)
p := fmt.Sprintf("%s/*/ports/*/lid", string(IB_BASEPATH)) p := fmt.Sprintf("%s/*/ports/*/lid", string(IB_BASEPATH))
files, err := filepath.Glob(p) files, err := filepath.Glob(p)
if err != nil {
return err
}
for _, f := range files { for _, f := range files {
lid, err := ioutil.ReadFile(f) lid, err := ioutil.ReadFile(f)
if err == nil { if err == nil {