More robust use of our virtualenv (#1412)

Prior to this change, the script tests if it's running inside a
virtualenv; and if it is, it assumes that it must be inside its own
virtualenv.

This change switches to testing for the activate binary in the
place we expect; and if it's found, using it directly. This avoids
false positives (running the script inside the wrong virtualenv) and
makes sure that we're running inside the right virtualenv.
pull/1553/head
James Polley 5 years ago committed by Jack Ivanov
parent 211d1b2cab
commit 2909107554

@ -2,8 +2,6 @@
set -e
if [ -z ${VIRTUAL_ENV+x} ]
then
ACTIVATE_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/env/bin/activate"
if [ -f "$ACTIVATE_SCRIPT" ]
then
@ -13,7 +11,7 @@ then
echo "$ACTIVATE_SCRIPT not found. Did you follow documentation to install dependencies?"
exit 1
fi
fi
case "$1" in
update-users) PLAYBOOK=users.yml; ARGS=( "${@:2}" -t update-users ) ;;

Loading…
Cancel
Save