handle case where WWN not detected for a device (print error messages, but skip device collection & uploading).

This commit is contained in:
Jason Kulatunga
2022-05-05 23:03:06 -07:00
parent 3dbe59781c
commit fabc629e40
3 changed files with 11 additions and 1 deletions
+6
View File
@@ -100,6 +100,12 @@ func (d *Detect) SmartCtlInfo(device *models.Device) error {
d.Logger.Info("Using WWN Fallback")
d.wwnFallback(device)
}
if len(device.WWN) == 0 {
// no WWN populated after WWN lookup and fallback. we need to throw an error
errMsg := fmt.Sprintf("no WWN (or fallback) populated for device: %s. Device will be registered, but no data will be published for this device. ", device.DeviceName)
d.Logger.Errorf(errMsg)
return fmt.Errorf(errMsg)
}
return nil
}