When nvme binary absent or too old and no json output, this crash the inventory, i prefer just pass nvme inventory and continue

This commit is contained in:
Cyril Levis 2020-09-30 14:12:48 +02:00
parent 137728be1f
commit 749cb381e3
No known key found for this signature in database
GPG key ID: 8538D68543979A20

View file

@ -88,6 +88,7 @@ class LSHW():
self.disks.append(d)
elif "nvme" in obj["configuration"]["driver"]:
try:
nvme = json.loads(
subprocess.check_output(
["nvme", '-list', '-o', 'json'],
@ -104,6 +105,8 @@ class LSHW():
d['description'] = "NVME Disk"
self.disks.append(d)
except Exception:
pass
def find_cpus(self, obj):
if "product" in obj: