Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical name #58

Merged
merged 3 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fixtures/asrr/e3c246d4i-nl.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ var E3C246D4INL = &common.Device{
Model: "INTEL SSDSC2KB48",
Serial: "PHYF001300HB480BGN",
ProductName: "INTEL SSDSC2KB48",
LogicalName: "/dev/sda",
Firmware: nil,
Status: nil,
},
Expand All @@ -212,6 +213,7 @@ var E3C246D4INL = &common.Device{
Model: "INTEL SSDSC2KB48",
Serial: "PHYF001209KL480BGN",
ProductName: "INTEL SSDSC2KB48",
LogicalName: "/dev/sdb",
Firmware: nil,
Status: nil,
},
Expand Down
8 changes: 8 additions & 0 deletions fixtures/dell/r6515.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ var (
Model: "Micron_9300_MTFDHAL3T8TDP",
Serial: "202728F691F5",
ProductName: "Micron_9300_MTFDHAL3T8TDP",
LogicalName: "/dev/nvme0",
Firmware: nil,
Status: nil,
},
Expand All @@ -708,6 +709,7 @@ var (
Model: "Micron_9300_MTFDHAL3T8TDP",
Serial: "202728F691C6",
ProductName: "Micron_9300_MTFDHAL3T8TDP",
LogicalName: "/dev/nvme1",
Firmware: nil,
Status: nil,
},
Expand All @@ -733,6 +735,7 @@ var (
Model: "MTFDDAV240TDU",
Serial: "203329F89392",
ProductName: "MTFDDAV240TDU",
LogicalName: "/dev/sda",
Firmware: nil,
Status: nil,
},
Expand All @@ -758,6 +761,7 @@ var (
Model: "MTFDDAV240TDU",
Serial: "203329F89796",
ProductName: "MTFDDAV240TDU",
LogicalName: "/dev/sdb",
Firmware: nil,
Status: nil,
},
Expand Down Expand Up @@ -1305,6 +1309,7 @@ var (
Model: "Micron_9300_MTFDHAL3T8TDP",
Serial: "202728F691F5",
ProductName: "Micron_9300_MTFDHAL3T8TDP",
LogicalName: "/dev/nvme0",
Firmware: &common.Firmware{
Installed: "11300DN0",
Available: "",
Expand Down Expand Up @@ -1335,6 +1340,7 @@ var (
Model: "Micron_9300_MTFDHAL3T8TDP",
Serial: "202728F691C6",
ProductName: "Micron_9300_MTFDHAL3T8TDP",
LogicalName: "/dev/nvme1",
Firmware: &common.Firmware{
Installed: "11300DN0",
Available: "",
Expand Down Expand Up @@ -1365,6 +1371,7 @@ var (
Model: "MTFDDAV240TDU",
Serial: "203329F89392",
ProductName: "MTFDDAV240TDU",
LogicalName: "/dev/sda",
Firmware: &common.Firmware{
Installed: "D3DJ004",
Available: "",
Expand Down Expand Up @@ -1395,6 +1402,7 @@ var (
Model: "MTFDDAV240TDU",
Serial: "203329F89796",
ProductName: "MTFDDAV240TDU",
LogicalName: "/dev/sdb",
Firmware: &common.Firmware{
Installed: "D3DJ004",
Available: "",
Expand Down
16 changes: 16 additions & 0 deletions fixtures/supermicro/x11dph-t.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ var (
Model: "Micron_5200_MTFDDAK960TDN",
Serial: "20032613EE70",
ProductName: "Micron_5200_MTFD",
LogicalName: "/dev/sda",
Firmware: &common.Firmware{
Installed: "D1MU020",
Available: "",
Expand Down Expand Up @@ -743,6 +744,7 @@ var (
Model: "Micron_5200_MTFDDAK960TDN",
Serial: "20032613D813",
ProductName: "Micron_5200_MTFD",
LogicalName: "/dev/sdb",
Firmware: &common.Firmware{
Installed: "D1MU020",
Available: "",
Expand Down Expand Up @@ -773,6 +775,7 @@ var (
Model: "KXG60ZNV256G TOSHIBA",
Serial: "Z9DF71TJFY3L",
ProductName: "KXG60ZNV256G TOSHIBA",
LogicalName: "/dev/nvme0",
Firmware: &common.Firmware{
Installed: "AGGA4104",
Available: "",
Expand Down Expand Up @@ -803,6 +806,7 @@ var (
Model: "KXG60ZNV256G TOSHIBA",
Serial: "Z9DF71YGFY3L",
ProductName: "KXG60ZNV256G TOSHIBA",
LogicalName: "/dev/nvme1",
Firmware: &common.Firmware{
Installed: "AGGA4104",
Available: "",
Expand Down Expand Up @@ -833,6 +837,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJL8MVK",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdk",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -863,6 +868,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJHR67K",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdl",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -893,6 +899,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJJ51YK",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdm",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -923,6 +930,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJLNERD",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdn",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -953,6 +961,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJKG9LK",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdc",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -983,6 +992,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJBVPXD",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdd",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1013,6 +1023,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJJ7T3K",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sde",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1043,6 +1054,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJL8U5K",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdf",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1073,6 +1085,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJBP7SD",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdg",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1103,6 +1116,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJKVBKK",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdh",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1133,6 +1147,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJK7E2K",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdi",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down Expand Up @@ -1163,6 +1178,7 @@ var (
Model: "HGST HUS728T8TALE6L4",
Serial: "VDJL2NUK",
ProductName: "HGST HUS728T8TAL",
LogicalName: "/dev/sdj",
Firmware: &common.Firmware{
Installed: "V8GNW460",
Available: "",
Expand Down
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
module github.com/metal-toolbox/ironlib

go 1.17
go 1.18

require (
github.com/beevik/etree v1.1.0
github.com/bmc-toolbox/common v0.0.0-20220808122349-335517678873
github.com/bmc-toolbox/common v0.0.0-20221018131042-912666fb3ebc
github.com/dselans/dmidecode v0.0.0-20180814053009-65c3f9d81910
github.com/pkg/errors v0.9.1
github.com/r3labs/diff/v2 v2.15.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0
github.com/tidwall/gjson v1.14.3
golang.org/x/net v0.0.0-20221002022538-bcab6841153b
golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193
gotest.tools v2.2.0+incompatible
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
28 changes: 11 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
github.com/bmc-toolbox/common v0.0.0-20220808122349-335517678873 h1:aHFMwerTuTpn38Q5LlqkP53RC4V6VYUL7nLa6E3EUT4=
github.com/bmc-toolbox/common v0.0.0-20220808122349-335517678873/go.mod h1:SY//n1PJjZfbFbmAsB6GvEKbc7UXz3d30s3kWxfJQ/c=
github.com/bmc-toolbox/common v0.0.0-20221018131042-912666fb3ebc h1:NBo6wB5N203iEyfJeiRTU/UjEocsoUFUc6KQHeiaLxo=
github.com/bmc-toolbox/common v0.0.0-20221018131042-912666fb3ebc/go.mod h1:SY//n1PJjZfbFbmAsB6GvEKbc7UXz3d30s3kWxfJQ/c=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -15,10 +15,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -30,12 +29,12 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/r3labs/diff/v2 v2.15.1 h1:EOrVqPUzi+njlumoqJwiS/TgGgmZo83619FNDB9xQUg=
github.com/r3labs/diff/v2 v2.15.1/go.mod h1:I8noH9Fc2fjSaMxqF3G2lhDdC0b+JXCfyx85tWFM9kc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -53,19 +52,16 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU=
golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193 h1:3Moaxt4TfzNcQH6DWvlYKraN1ozhBXQHcgvXjRGeim0=
golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
Expand All @@ -76,10 +72,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
8 changes: 8 additions & 0 deletions utils/lshw.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type LshwNode struct {
Vendor string `json:"vendor,omitempty"`
Physid string `json:"physid,omitempty"`
Businfo string `json:"businfo,omitempty"`
LogicalName interface{} `json:"logicalname,omitempty"`
Dev string `json:"dev,omitempty"`
Slot string `json:"slot,omitempty"`
Units string `json:"units,omitempty"`
Expand Down Expand Up @@ -467,6 +468,13 @@ func (l *Lshw) xDrive(node *LshwNode) *common.Drive {
CapacityBytes: int64(node.Size),
}

// type assert LogicalName since it can also be an array - in which case we
// do not care about the data.
logicalName, isString := node.LogicalName.(string)
if isString {
drive.LogicalName = logicalName
}

if drive.Vendor == "" {
drive.Vendor = common.VendorFromString(node.Product)
}
Expand Down