Compare commits

..

2 Commits

Author SHA1 Message Date
Thomas Nahuel Rusiecki 91e6d63fd4 fixed typo 2024-11-20 01:16:18 -03:00
Thomas Nahuel Rusiecki edc8ab6d3a parse snapshot as dict 2024-11-20 01:15:31 -03:00
1 changed files with 5 additions and 1 deletions

6
workbench-script.py Normal file → Executable file
View File

@ -309,8 +309,12 @@ def save_snapshot_in_disk(snapshot, path, snap_uuid):
# url = 'http://127.0.0.1:8000/api/snapshot/' # url = 'http://127.0.0.1:8000/api/snapshot/'
def send_snapshot_to_devicehub(snapshot, token, url): def send_snapshot_to_devicehub(snapshot, token, url):
url_components = urllib.parse.urlparse(url) url_components = urllib.parse.urlparse(url)
if isinstance(snapshot, str):
snapshot = json.loads(snapshot)
ev_path = "evidence/{}".format(snapshot["uuid"]) ev_path = "evidence/{}".format(snapshot["uuid"])
components = (url_components.schema, url_components.netloc, ev_path, '', '', '') components = (url_components.scheme, url_components.netloc, ev_path, '', '', '')
ev_url = urllib.parse.urlunparse(components) ev_url = urllib.parse.urlunparse(components)
# apt install qrencode # apt install qrencode
qr = "echo {} | qrencode -t ANSI".format(ev_url) qr = "echo {} | qrencode -t ANSI".format(ev_url)