summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorAshley Penney <apenney@edx.org>2012-10-17 20:31:43 +0000
committerAshley Penney <apenney@edx.org>2012-10-17 20:31:43 +0000
commit11666f9b9ebf04cffd19ad49f57e3fb879876d76 (patch)
treed258a210eb7bc7a136638ffead581284a289d68b /manifests
parented137893babebabdfdb5adf44d1a52272093ce8b (diff)
If the proxy is unset then you cannot set http_proxy in the environment
or it breaks pip completely and the virtualenv fails.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/virtualenv.pp7
1 files changed, 6 insertions, 1 deletions
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index a5cf12b..f22f4e1 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -50,9 +50,14 @@ define python::virtualenv (
default => "--proxy=${proxy}",
}
+ $proxy_command = $proxy ? {
+ false => '',
+ default => "&& export http_proxy=${proxy}",
+ }
+
exec { "python_virtualenv_${venv_dir}":
command => "mkdir -p ${venv_dir} \
- && export http_proxy=${proxy} \
+ ${proxy_command} \
&& virtualenv -p `which ${python}` ${venv_dir} \
&& ${venv_dir}/bin/pip install ${proxy_flag} --upgrade distribute pip",
creates => $venv_dir,