Merge "Support specifying virtualenv path with or without activate_this.py"

This commit is contained in:
Zuul 2018-06-01 21:09:25 +00:00 committed by Gerrit Code Review
commit 96eef8bc67
2 changed files with 8 additions and 0 deletions

View File

@ -36,7 +36,11 @@ import six
if (int(os.getenv('ARA_WSGI_USE_VIRTUALENV', 0)) == 1 and
os.getenv('ARA_WSGI_VIRTUALENV_PATH')):
# Backwards compatibility, we did not always suffix activate_this.py
activate_this = os.getenv('ARA_WSGI_VIRTUALENV_PATH')
if 'activate_this.py' not in activate_this:
activate_this = os.path.join(activate_this, 'bin/activate_this.py')
if six.PY2:
execfile(activate_this, dict(__file__=activate_this)) # nosec
else:

View File

@ -53,7 +53,11 @@ import time
if (int(os.getenv('ARA_WSGI_USE_VIRTUALENV', 0)) == 1 and
os.getenv('ARA_WSGI_VIRTUALENV_PATH')):
# Backwards compatibility, we did not always suffix activate_this.py
activate_this = os.getenv('ARA_WSGI_VIRTUALENV_PATH')
if 'activate_this.py' not in activate_this:
activate_this = os.path.join(activate_this, 'bin/activate_this.py')
if six.PY2:
execfile(activate_this, dict(__file__=activate_this)) # nosec
else: