Reuse looked up path

This commit is contained in:
Thomas Roehl 2022-03-04 14:01:35 +01:00
parent 5b951fcfe8
commit bdb16090d7

@ -73,10 +73,11 @@ func (m *GpfsCollector) Init(config json.RawMessage) error {
}
// Check if mmpmon is in executable search path
_, err = exec.LookPath(m.config.Mmpmon)
p, err := exec.LookPath(m.config.Mmpmon)
if err != nil {
return fmt.Errorf("failed to find mmpmon binary '%s': %v", m.config.Mmpmon, err)
}
m.config.Mmpmon = p
m.init = true
return nil