Skip to content

Commit 11666f9

Browse files
author
Ashley Penney
committed
If the proxy is unset then you cannot set http_proxy in the environment
or it breaks pip completely and the virtualenv fails.
1 parent ed13789 commit 11666f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

manifests/virtualenv.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@
5050
default => "--proxy=${proxy}",
5151
}
5252

53+
$proxy_command = $proxy ? {
54+
false => '',
55+
default => "&& export http_proxy=${proxy}",
56+
}
57+
5358
exec { "python_virtualenv_${venv_dir}":
5459
command => "mkdir -p ${venv_dir} \
55-
&& export http_proxy=${proxy} \
60+
${proxy_command} \
5661
&& virtualenv -p `which ${python}` ${venv_dir} \
5762
&& ${venv_dir}/bin/pip install ${proxy_flag} --upgrade distribute pip",
5863
creates => $venv_dir,

0 commit comments

Comments
 (0)