From bf77934fdb0aa2f30e4deb6086085e39ab854f2d Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 5 Apr 2022 11:04:16 +0200 Subject: [PATCH] fix uuid --- ereuse_devicehub/parser/parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/parser/parser.py b/ereuse_devicehub/parser/parser.py index e104be6d..357a7098 100644 --- a/ereuse_devicehub/parser/parser.py +++ b/ereuse_devicehub/parser/parser.py @@ -435,7 +435,10 @@ class ParseSnapshotLsHw: return 'SODIMM' if 'SODIMM' in channel else 'DIMM' def get_uuid(self): - dmi_uuid = self.dmi.get("System")[0].get("UUID") + dmi_uuid = 'undefined' + if self.dmi.get("System"): + dmi_uuid = self.dmi.get("System")[0].get("UUID") + try: uuid.UUID(dmi_uuid) except (ValueError, AttributeError) as err: