Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a3677e

Browse files
committed
retrieve ez_setup.py only if import setuptools is failed.
1 parent 8e5de71 commit 2a3677e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

recipes/pip.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,10 @@
3333
pip_binary = "/usr/local/bin/pip"
3434
end
3535

36-
if node['python']['install_method'] == 'source'
37-
ez_binary = "#{node['python']['prefix_dir']}/bin/easy_install"
38-
elsif platform_family?("rhel")
39-
ez_binary = "/usr/bin/easy_install"
40-
elsif platform_family?("smartos")
41-
ez_binary = "/opt/local/bin/easy_install"
42-
else
43-
ez_binary = "/usr/local/bin/easy_install"
44-
end
45-
4636
remote_file "#{Chef::Config[:file_cache_path]}/ez_setup.py" do
4737
source node['python']['setuptools_script_url']
4838
mode "0644"
49-
not_if { ::File.exists?(ez_binary) }
39+
not_if "#{node['python']['binary']} -c 'import setuptools'"
5040
end
5141

5242
remote_file "#{Chef::Config[:file_cache_path]}/get-pip.py" do

0 commit comments

Comments
 (0)