fix duplicity snapshotErrors

This commit is contained in:
Cayo Puigdefabregas 2022-04-22 09:51:17 +02:00
parent 9f948df209
commit 85d580c094
1 changed files with 1 additions and 12 deletions

View File

@ -3,7 +3,6 @@ import logging
import uuid import uuid
from dmidecode import DMIParse from dmidecode import DMIParse
from marshmallow import ValidationError
from ereuse_devicehub.parser import base2 from ereuse_devicehub.parser import base2
from ereuse_devicehub.parser.computer import Computer from ereuse_devicehub.parser.computer import Computer
@ -347,17 +346,7 @@ class ParseSnapshotLsHw:
} }
def get_snapshot(self): def get_snapshot(self):
try: return Snapshot().load(self.snapshot_json)
return Snapshot().load(self.snapshot_json)
except ValidationError as err:
txt = "{}".format(err)
uuid = self.snapshot_json.get('uuid')
wbid = self.snapshot_json.get('wbid')
error = SnapshotErrors(
description=txt, snapshot_uuid=uuid, severity=Severity.Error, wbid=wbid
)
error.save(commit=True)
raise err
def parse_hwinfo(self): def parse_hwinfo(self):
hw_blocks = self.hwinfo_raw.split("\n\n") hw_blocks = self.hwinfo_raw.split("\n\n")