fix uuid in device not computer

This commit is contained in:
Cayo Puigdefabregas 2022-06-14 10:46:21 +02:00
parent 309b0f9354
commit 86446a268c
1 changed files with 4 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class SnapshotMixin:
return snapshot
def get_uuid(self, debug):
if not debug:
if not debug or not isinstance(debug, dict):
self.errors(txt="There is not uuid")
return
@ -167,7 +167,9 @@ class SnapshotView(SnapshotMixin):
self.version = snapshot_json.get('version')
self.uuid = snapshot_json.get('uuid')
self.sid = None
self.get_uuid(snapshot_json.pop('debug', None))
system_uuid = self.get_uuid(snapshot_json.pop('debug', None))
if system_uuid:
snapshot_json['device']['uuid'] = system_uuid
try:
self.snapshot_json = resource_def.schema.load(snapshot_json)