Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
Minor fixes in python cookbooks. 'install_path' wouldn't resolve to a…
Browse files Browse the repository at this point in the history
…n actual file, needed an index specified on version.split(). Add in a way to specify which version of python to use when installing distribute (on centos, defaults to 2.4 which virtualenv doesn't work well with).
  • Loading branch information
benjaminws authored and jtimberman committed Jan 19, 2012
1 parent 67dd0f0 commit b294961
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions python/attributes/default.rb
Expand Up @@ -18,6 +18,11 @@
# limitations under the License.
#

# Version of python to use when installing distribute/pip
# default is '', which uses the 'python' binary.
# example value = '2.6' which will use the python2.6 binary
default['python']['base_version'] = ''

default['python']['install_method'] = 'package'

default['python']['url'] = 'http://www.python.org/ftp/python'
Expand Down
3 changes: 2 additions & 1 deletion python/recipes/pip.rb
Expand Up @@ -28,10 +28,11 @@
not_if "which pip"
end

base_version = node['python']['base_version']
bash "install-pip" do
cwd Chef::Config[:file_cache_path]
code <<-EOF
python distribute_setup.py
python#{base_version} distribute_setup.py
easy_install pip
EOF
not_if "which pip"
Expand Down
2 changes: 1 addition & 1 deletion python/recipes/source.rb
Expand Up @@ -32,7 +32,7 @@
end

version = node['python']['version']
install_path = "#{node['python']['prefix_dir']}/lib/python#{version.split(/(^\d+\.\d+)/)}"
install_path = "#{node['python']['prefix_dir']}/lib/python#{version.split(/(^\d+\.\d+)/)[1]}"

remote_file "#{Chef::Config[:file_cache_path]}/Python-#{version}.tar.bz2" do
source "#{node['python']['url']}/#{version}/Python-#{version}.tar.bz2"
Expand Down

0 comments on commit b294961

Please sign in to comment.