summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <stankevich@users.noreply.github.com>2014-01-07 17:35:22 -0800
committerSergey Stankevich <stankevich@users.noreply.github.com>2014-01-07 17:35:22 -0800
commit1f28e67b1754f11406a6b704005559d17b845b62 (patch)
tree7042612efa2d05e277bd5a8575bc70d44817031a
parent042f4eed2e15834a3c49abab485e5037ab805ca3 (diff)
parent25d7203f8c7c152dcc4ecd75569effebee9ba25a (diff)
Merge pull request #51 from jalli/master
Fix secondary version detection for python and revert back to using /tmp for current working dir during virtualenv install.
-rw-r--r--lib/facter/python_version.rb2
-rw-r--r--manifests/virtualenv.pp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb
index a2bdb26..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'))[1]
+ /^.*(\d+\.\d+\.\d+)$/.match(Facter::Util::Resolution.exec('python -V 2>&1'))[1]
end
end
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
}