From e6b4b9417139c97414f940dd4450fce21cf9af24 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 7 Jan 2014 13:20:27 -0500 Subject: Revert to using /tmp fir for cwd for virte inst. If the virtualenv target directory does not exist before running the virtualenv command the puppet command will fail if the cwd does not exist, hence revert back to using the /tmp directory for current working directory. --- manifests/virtualenv.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index 7f7fbb4..fc540a8 100644 --- a/manifests/virtualenv.pp +++ b/manifests/virtualenv.pp @@ -130,7 +130,7 @@ define python::virtualenv ( command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip wheel --help > /dev/null 2>&1 && { ${venv_dir}/bin/pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} \$wheel_support_flag --upgrade pip ${distribute_pkg}", user => $owner, path => $path, - cwd => $venv_dir, + cwd => "/tmp", environment => $environment, unless => "grep '^[\\t ]*VIRTUAL_ENV=[\\\\'\\\"]*${venv_dir}[\\\"\\\\'][\\t ]*$' ${venv_dir}/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv } -- cgit v1.2.3 From fae8ae4476142112db877470fe6d374c0e63acc9 Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 7 Jan 2014 13:29:00 -0500 Subject: Silence facter by redirecting python -V stderr --- lib/facter/python_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index a2bdb26..6b88ee9 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -14,7 +14,7 @@ end Facter.add("python_version") do has_weight 100 setcode do - /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V'))[1] + /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>/dev/null'))[1] end end -- cgit v1.2.3 From 25d7203f8c7c152dcc4ecd75569effebee9ba25a Mon Sep 17 00:00:00 2001 From: Jarl Stefansson Date: Tue, 7 Jan 2014 14:25:42 -0500 Subject: Fix Python version detection, stderr to stdout --- lib/facter/python_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index 6b88ee9..50fef72 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -14,7 +14,7 @@ end Facter.add("python_version") do has_weight 100 setcode do - /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>/dev/null'))[1] + /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>&1'))[1] end end -- cgit v1.2.3