check for "unknown" wwn value.

fix #113
pull/132/head
Jason Kulatunga 4 years ago
parent 9898ff1a33
commit 58eaa29e4d

@ -92,7 +92,7 @@ func (d *Detect) wwnFallback(detectedDevice *models.Device) {
block, err := ghw.Block()
if err == nil {
for _, disk := range block.Disks {
if disk.Name == detectedDevice.DeviceName {
if disk.Name == detectedDevice.DeviceName && strings.ToLower(disk.WWN) != "unknown" {
d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN
break

@ -30,7 +30,7 @@ func (d *Detect) wwnFallback(detectedDevice *models.Device) {
block, err := ghw.Block()
if err == nil {
for _, disk := range block.Disks {
if disk.Name == detectedDevice.DeviceName {
if disk.Name == detectedDevice.DeviceName && strings.ToLower(disk.WWN) != "unknown" {
d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN
break

@ -30,7 +30,7 @@ func (d *Detect) wwnFallback(detectedDevice *models.Device) {
block, err := ghw.Block()
if err == nil {
for _, disk := range block.Disks {
if disk.Name == detectedDevice.DeviceName {
if disk.Name == detectedDevice.DeviceName && strings.ToLower(disk.WWN) != "unknown" {
d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN
break

Loading…
Cancel
Save