Compare commits
2 Commits
ae5f9c341a
...
91e6d63fd4
Author | SHA1 | Date |
---|---|---|
Thomas Nahuel Rusiecki | 91e6d63fd4 | |
Thomas Nahuel Rusiecki | edc8ab6d3a |
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue