From dabd7305f947cea78532c334012aff4a290dca7e Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 14 Feb 2025 08:54:51 +0100 Subject: [PATCH] db: refs #8140 Warn when python venv is not enabled --- run-playbook.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/run-playbook.sh b/run-playbook.sh index 23f5d6a..ea7db4e 100755 --- a/run-playbook.sh +++ b/run-playbook.sh @@ -1,5 +1,7 @@ #!/bin/bash +MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PY_VENV_DIR="$MY_DIR/venv" EXTRA_ARGS=() if [ -f .passbolt.yml ]; then @@ -9,5 +11,11 @@ if [ -f .vault-pass ]; then EXTRA_ARGS+=("--vault-password-file" ".vault-pass") fi -#export PYTHONPATH=./venv/lib/python3.12/site-packages/ +if [[ -z "$VIRTUAL_ENV" && -d "$PY_VENV_DIR" ]]; then + WARNING="\e[33m" + RESET="\e[0m" + echo -e "Warning: ${WARNING}Python virtual environment not enabled! Some tasks might fail.${RESET}" + #export PYTHONPATH=./venv/lib/python3.12/site-packages/ +fi + ansible-playbook ${EXTRA_ARGS[@]} $@