summaryrefslogtreecommitdiff
path: root/web_infrastructure
diff options
context:
space:
mode:
authorRoger López <roger.lopez@warbyparker.com>2013-12-17 14:45:42 -0500
committerRoger López <roger.lopez@warbyparker.com>2013-12-17 14:45:42 -0500
commit5e77eb70e4fb510f57be551d17edb873fc6a4cc3 (patch)
tree913f0e5b189a1a899e04d872701e54bf6a022e1f /web_infrastructure
parent621ce3097900a1f51d331c1cd0eb9d29c0161be7 (diff)
downloadansible-modules-core-5e77eb70e4fb510f57be551d17edb873fc6a4cc3.tar.gz
django_manage need not require virtualenv in PATH
The virtualenv parameter to the django_manage command is used to locate the virtualenv and build it if necessary. Access to the virtualenv executable is only needed if the virtualenv directory doesn't exist and needs to be built. This patch allows for the situation where a virtualenv that is not in the PATH was used to create a virtualenv prior to running the django_manage module.
Diffstat (limited to 'web_infrastructure')
-rw-r--r--web_infrastructure/django_manage3
1 files changed, 1 insertions, 2 deletions
diff --git a/web_infrastructure/django_manage b/web_infrastructure/django_manage
index f6ea9c49..68eb92c1 100644
--- a/web_infrastructure/django_manage
+++ b/web_infrastructure/django_manage
@@ -129,12 +129,11 @@ def _ensure_virtualenv(module):
if venv_param is None:
return
- virtualenv = module.get_bin_path('virtualenv', True)
-
vbin = os.path.join(os.path.expanduser(venv_param), 'bin')
activate = os.path.join(vbin, 'activate')
if not os.path.exists(activate):
+ virtualenv = module.get_bin_path('virtualenv', True)
vcmd = '%s %s' % (virtualenv, venv_param)
vcmd = [virtualenv, venv_param]
rc, out_venv, err_venv = module.run_command(vcmd)