diff --git a/Containerfile.admin b/Containerfile.admin index 5512c4c..8701e2a 100644 --- a/Containerfile.admin +++ b/Containerfile.admin @@ -22,15 +22,23 @@ RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x postgresql \ python39 \ python39-pip \ + python39-requests \ rsync \ tar \ unzip \ vim \ wget \ - && dnf clean all \ && VERSION=4.1.0 \ && curl --silent --location https://github.com/Orange-OpenSource/hurl/releases/download/$VERSION/hurl-$VERSION-x86_64-unknown-linux-gnu.tar.gz \ - | tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/hurl' '*/hurlfmt' + | tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/hurl' '*/hurlfmt' \ +############################## +# Python +############################## + && alternatives --set python /usr/bin/python3.9 \ + && alternatives --set python3 /usr/bin/python3.9 \ + && alternatives --install /usr/bin/pip pip /usr/bin/pip3.9 1 \ + && alternatives --list \ + && dnf clean all && rm -rf /tmp/* COPY --from=docker.io/migrate/migrate /usr/local/bin/migrate /usr/local/bin/migrate WORKDIR /sandbox/ diff --git a/tools/sandbox_api_close_and_delete_AwsSandbox.py b/tools/sandbox_api_close_and_delete_AwsSandbox.py index c5f55a8..7a641ac 100755 --- a/tools/sandbox_api_close_and_delete_AwsSandbox.py +++ b/tools/sandbox_api_close_and_delete_AwsSandbox.py @@ -26,7 +26,11 @@ def main(): sandbox = sys.argv[1] - answer = input(f"Are you sure you want to permanently delete the sandbox {sandbox}? [y/N] ") + # Detect if it's a tty + if sys.stdin.isatty(): + answer = input(f"Are you sure you want to permanently delete the sandbox {sandbox}? [y/N] ") + else: + answer = 'y' if answer.lower() != 'y': print("Aborted.") sys.exit(1) diff --git a/tools/sandbox_api_delete_placement.py b/tools/sandbox_api_delete_placement.py index 8955917..f9ceece 100755 --- a/tools/sandbox_api_delete_placement.py +++ b/tools/sandbox_api_delete_placement.py @@ -26,7 +26,11 @@ def main(): uuid = sys.argv[1] - answer = input(f"Are you sure you want to delete the placement {uuid}? [y/N] ") + # Detect if it's a tty + if sys.stdin.isatty(): + answer = input(f"Are you sure you want to delete the placement {uuid}? [y/N] ") + else: + answer = 'y' if answer.lower() != 'y': print("Aborted.") sys.exit(1) diff --git a/tools/sandbox_api_mark_AwsSandbox_for_cleanup.py b/tools/sandbox_api_mark_AwsSandbox_for_cleanup.py index 816a54b..6e05b82 100755 --- a/tools/sandbox_api_mark_AwsSandbox_for_cleanup.py +++ b/tools/sandbox_api_mark_AwsSandbox_for_cleanup.py @@ -26,7 +26,11 @@ def main(): sandbox = sys.argv[1] - answer = input(f"Are you sure you want to mark the sandbox {sandbox} for cleanup? [y/N] ") + # Detect if it's a tty + if sys.stdin.isatty(): + answer = input(f"Are you sure you want to mark the sandbox {sandbox} for cleanup? [y/N] ") + else: + answer = 'y' if answer.lower() != 'y': print("Aborted.") sys.exit(1)