From edc8ab6d3a7fd061362cc8a3509261cfc79c9da2 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Wed, 20 Nov 2024 01:15:31 -0300 Subject: [PATCH 1/4] 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) -- 2.30.2 From 91e6d63fd4515ce71171cb76308576678204c6b3 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Wed, 20 Nov 2024 01:16:18 -0300 Subject: [PATCH 2/4] fixed typo --- workbench-script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workbench-script.py b/workbench-script.py index 464f1a7..fa36f7d 100755 --- a/workbench-script.py +++ b/workbench-script.py @@ -314,7 +314,7 @@ def send_snapshot_to_devicehub(snapshot, token, url): snapshot = json.loads(snapshot) 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) # apt install qrencode qr = "echo {} | qrencode -t ANSI".format(ev_url) -- 2.30.2 From ae73292ffcbfca578616458f60ccdfa027cb69e0 Mon Sep 17 00:00:00 2001 From: thomas rusiecki Date: Wed, 20 Nov 2024 11:11:39 -0300 Subject: [PATCH 3/4] added inxi dependency --- install-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dependencies.sh b/install-dependencies.sh index bb97b97..6188fc9 100755 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -9,7 +9,7 @@ set -u set -x main() { - sudo apt install smartmontools lshw hwinfo dmidecode + sudo apt install smartmontools lshw hwinfo dmidecode inxi } main "${@}" -- 2.30.2 From 8dfdabdac2010cc8c8dbc75e76a5d748c1217593 Mon Sep 17 00:00:00 2001 From: thomas rusiecki Date: Wed, 20 Nov 2024 11:35:18 -0300 Subject: [PATCH 4/4] added dependencies --- deploy-workbench.sh | 2 +- install-dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy-workbench.sh b/deploy-workbench.sh index d0884bc..3effbef 100755 --- a/deploy-workbench.sh +++ b/deploy-workbench.sh @@ -327,7 +327,7 @@ echo 'Install requirements' apt-get install -y --no-install-recommends \ sudo locales keyboard-configuration console-setup qrencode \ python-is-python3 python3 python3-dev python3-pip pipenv \ - dmidecode smartmontools hwinfo pciutils lshw nfs-common < /dev/null + dmidecode smartmontools hwinfo pciutils lshw nfs-common inxi < /dev/null # Install lshw B02.19 utility using backports (DEPRECATED in Debian 12) #apt install -y -t ${VERSION_CODENAME}-backports lshw < /dev/null diff --git a/install-dependencies.sh b/install-dependencies.sh index 6188fc9..e1f7345 100755 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -9,7 +9,7 @@ set -u set -x main() { - sudo apt install smartmontools lshw hwinfo dmidecode inxi + sudo apt install qrencode smartmontools lshw hwinfo dmidecode inxi } main "${@}" -- 2.30.2