From 6271c717a3a98ee5a9b171aa3852936b9bb83d15 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 31 Mar 2022 19:44:06 +0200 Subject: [PATCH] pass lshw and smart loadeds instead of raw data --- ereuse_devicehub/parser/parser.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/parser/parser.py b/ereuse_devicehub/parser/parser.py index bb31edc4..99aa7aa8 100644 --- a/ereuse_devicehub/parser/parser.py +++ b/ereuse_devicehub/parser/parser.py @@ -316,17 +316,15 @@ class ParseSnapshotLsHw: def __init__(self, snapshot, default="n/a"): self.default = default self.dmidecode_raw = snapshot["data"]["dmidecode"] - self.smart_raw = snapshot["data"]["smart"] + self.smart = snapshot["data"]["smart"] self.hwinfo_raw = snapshot["data"]["hwinfo"] - self.lshw_raw = snapshot["data"]["lshw"] + self.lshw = snapshot["data"]["lshw"] self.device = {"actions": []} self.components = [] self.components_obj = [] self.dmi = DMIParse(self.dmidecode_raw) - self.smart = self.loads(self.smart_raw) self.hwinfo = self.parse_hwinfo() - self.lshw = self.loads(self.lshw_raw) self.set_basic_datas() self.set_components() @@ -353,7 +351,7 @@ class ParseSnapshotLsHw: return x def set_basic_datas(self): - pc, self.components_obj = Computer.run(self.lshw_raw, self.hwinfo_raw) + pc, self.components_obj = Computer.run(self.lshw, self.hwinfo_raw) self.device = pc.dump() self.device['uuid'] = self.dmi.get("System")[0].get("UUID")