Switching to use VIRTUAL_ENV env variable

Attempts to use VIRTUAL_ENV by default. If it's not available then
the script attempts to use pyenv's prefix to retrieve the python
environment path.

Change-Id: I45597a8736ca70ae935da59b24eac4e5ff7d6091
This commit is contained in:
John Vrbanac 2014-01-12 20:46:01 -06:00
parent 95a335d98d
commit 276c91e7e8
1 changed files with 4 additions and 1 deletions

View File

@ -2,7 +2,10 @@
CONFIG_DIR=/etc/barbican
DB_DIR=/var/lib/barbican
VENV_DIR=${BARBICAN_VENV:-~/.pyenv/versions/$PYENV_VERSION}
# VIRTUAL_ENV is set by virtualenv on activate. If VIRTUAL_ENV is not,
# available, it attempts to fallback on pyenv for the python environment path.
VENV_DIR=${VIRTUAL_ENV:-`pyenv prefix`}
LOCAL_CONFIG_DIR=./etc/barbican
if [ ! -d $LOCAL_CONFIG_DIR ];