From edc8ab6d3a7fd061362cc8a3509261cfc79c9da2 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Wed, 20 Nov 2024 01:15:31 -0300 Subject: [PATCH] parse snapshot as dict --- workbench-script.py | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 workbench-script.py diff --git a/workbench-script.py b/workbench-script.py old mode 100644 new mode 100755 index 99dbc4a..464f1a7 --- a/workbench-script.py +++ b/workbench-script.py @@ -309,6 +309,10 @@ def save_snapshot_in_disk(snapshot, path, snap_uuid): # url = 'http://127.0.0.1:8000/api/snapshot/' def send_snapshot_to_devicehub(snapshot, token, url): url_components = urllib.parse.urlparse(url) + + if isinstance(snapshot, str): + snapshot = json.loads(snapshot) + ev_path = "evidence/{}".format(snapshot["uuid"]) components = (url_components.schema, url_components.netloc, ev_path, '', '', '') ev_url = urllib.parse.urlunparse(components)