issue 100 new url in qr for evidence instead of device #5

Merged
pedro merged 5 commits from issue_100 into main 2024-11-08 17:28:15 +00:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit af780b1247 - Show all commits

View File

@ -301,10 +301,6 @@ def send_snapshot_to_devicehub(snapshot, token, url, legacy):
components = (url_components.schema, url_components.netloc, ev_path, '', '', '')
ev_url = urllib.parse.urlunparse(components)
# apt install qrencode
qr = "echo {} | qrencode -t ANSI".format(ev_url)
if not legacy:
print(exec_cmd(qr))
print(f"url: {ev_url}")
headers = {
"Authorization": f"Bearer {token}",
@ -332,7 +328,11 @@ def send_snapshot_to_devicehub(snapshot, token, url, legacy):
except Exception:
logger.error(response_text)
else:
logger.error(_("Snapshot cannot sent to '%s'"), url)
qr = "echo {} | qrencode -t ANSI".format(ev_url)
print(exec_cmd(qr))
print(f"url: {ev_url}")
else:
logger.error(_("Snapshot %s, cannot sent to '%s'"), snapshot["uuid"], url)
except Exception as e:
logger.error(_("Snapshot not remotely sent to URL '%s'. Do you have internet? Is your server up & running? Is the url token authorized?\n %s"), url, e)