From 11666f9b9ebf04cffd19ad49f57e3fb879876d76 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 17 Oct 2012 20:31:43 +0000 Subject: If the proxy is unset then you cannot set http_proxy in the environment or it breaks pip completely and the virtualenv fails. --- manifests/virtualenv.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3