From bdf5268523f996d3fee5aa2930b208adc653049b Mon Sep 17 00:00:00 2001 From: Lin Liu Date: Tue, 20 Aug 2024 02:29:26 +0000 Subject: [PATCH] CP-49148: More clean python2 code - Update following embeded shellbang to python3 * generate-iscsi-iqn * xe-backup-metadata * xe-restore-metadata - Remove interop-test.sh as not used Signed-off-by: Lin Liu --- ocaml/message-switch/core_test/interop-test.sh | 9 --------- scripts/generate-iscsi-iqn | 2 +- scripts/xe-backup-metadata | 2 +- scripts/xe-restore-metadata | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100755 ocaml/message-switch/core_test/interop-test.sh diff --git a/ocaml/message-switch/core_test/interop-test.sh b/ocaml/message-switch/core_test/interop-test.sh deleted file mode 100755 index 912d47f2349..00000000000 --- a/ocaml/message-switch/core_test/interop-test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -ex - -LINKPATH="${TMPDIR:-/tmp}/link_test" - -rm -rf ${LINKPATH} && mkdir -p ${LINKPATH} - -lwt/link_test_main.exe -PYTHONPATH=core python message_switch_test.py diff --git a/scripts/generate-iscsi-iqn b/scripts/generate-iscsi-iqn index 882a4c7f6fd..9550435716d 100755 --- a/scripts/generate-iscsi-iqn +++ b/scripts/generate-iscsi-iqn @@ -36,7 +36,7 @@ geniqn() { domain=${defaultdomain} fi - revdomain=$(python -c "${REVERSE_PY}" $domain) + revdomain=$(python3 -c "${REVERSE_PY}" $domain) uuid=$(uuidgen | cut -d- -f1) date=$(date +"%Y-%m") diff --git a/scripts/xe-backup-metadata b/scripts/xe-backup-metadata index 43c4617ec3b..19f0cf0e4a9 100755 --- a/scripts/xe-backup-metadata +++ b/scripts/xe-backup-metadata @@ -51,7 +51,7 @@ function usage { function uuid5 { # could use a modern uuidgen but it's not on XS 8 # should work with Python 2 and 3 - python -c "import uuid; print (uuid.uuid5(uuid.UUID('$1'), '$2'))" + python3 -c "import uuid; print (uuid.uuid5(uuid.UUID('$1'), '$2'))" } function test_sr { diff --git a/scripts/xe-restore-metadata b/scripts/xe-restore-metadata index 5968dc102e8..ca7029d7c07 100755 --- a/scripts/xe-restore-metadata +++ b/scripts/xe-restore-metadata @@ -65,7 +65,7 @@ function test_sr { NS="e93e0639-2bdb-4a59-8b46-352b3f408c19" function uuid5 { # could use a modern uuidgen but it's not on XS 8 - python -c "import uuid; print (uuid.uuid5(uuid.UUID('$1'), '$2'))" + python3 -c "import uuid; print (uuid.uuid5(uuid.UUID('$1'), '$2'))" } dry_run=0