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

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'COOK-650'
  • Loading branch information
jtimberman committed Jan 19, 2012
2 parents 67dd0f0 + b40e01d commit d1c047f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions python/README.md
Expand Up @@ -20,9 +20,12 @@ Cookbooks
Attributes
==========

* `node["python"]["install_method"]` = method to install python with, default `package`.
See `attributes/default.rb` for default values.

The file also contains the following attribute types:
* `node["python"]["install_method"]` - method to install python with, default `package`.
* `node["python"]["distribute_install_py_version"]` - version of python to use when installing distribute. default '', specify version like '2.6' (uses python2.6 binary).

The file also contains the following attributes:

* platform specific locations and settings.
* source installation settings
Expand Down
2 changes: 2 additions & 0 deletions python/attributes/default.rb
Expand Up @@ -18,6 +18,8 @@
# limitations under the License.
#

default['python']['distribute_install_py_version'] = ''

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

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

use_version = node['python']['distribute_install_py_version']

bash "install-pip" do
cwd Chef::Config[:file_cache_path]
code <<-EOF
python distribute_setup.py
python#{use_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 d1c047f

Please sign in to comment.