NVME inventory fix.

The inventory crash with default nvme-cli version 1.8.1 on Centos7.
This commit is contained in:
Cyril Levis 2021-06-16 14:04:57 +02:00 committed by Guillaume Gelin
parent 51efa8edba
commit 794f9787f0

View file

@ -104,7 +104,10 @@ class LSHW():
d['product'] = device["ModelNumber"]
d['serial'] = device["SerialNumber"]
d["version"] = device["Firmware"]
d['size'] = device["UsedSize"]
if "UsedSize" in device:
d['size'] = device["UsedSize"]
if "UsedBytes" in device:
d['size'] = device["UsedBytes"]
d['description'] = "NVME Disk"
self.disks.append(d)