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() block, err := ghw.Block()
if err == nil { if err == nil {
for _, disk := range block.Disks { 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) d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN detectedDevice.WWN = disk.WWN
break break

@ -30,7 +30,7 @@ func (d *Detect) wwnFallback(detectedDevice *models.Device) {
block, err := ghw.Block() block, err := ghw.Block()
if err == nil { if err == nil {
for _, disk := range block.Disks { 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) d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN detectedDevice.WWN = disk.WWN
break break

@ -30,7 +30,7 @@ func (d *Detect) wwnFallback(detectedDevice *models.Device) {
block, err := ghw.Block() block, err := ghw.Block()
if err == nil { if err == nil {
for _, disk := range block.Disks { 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) d.Logger.Debugf("Found matching block device. WWN: %s", disk.WWN)
detectedDevice.WWN = disk.WWN detectedDevice.WWN = disk.WWN
break break

Loading…
Cancel
Save