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

Skip to content

Commit d5abbaa

Browse files
committed
Trying a better fix for poise#49.
1 parent f0a37e1 commit d5abbaa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
default['python']['binary'] = "#{node['python']['prefix_dir']}/bin/python"
3535

3636
default['python']['url'] = 'http://www.python.org/ftp/python'
37-
default['python']['version'] = '2.7.5'
37+
default['python']['install_version'] = '2.7.5'
3838
default['python']['checksum'] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059'
3939
default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}}
4040
default['python']['make_options'] = %W{install}

recipes/source.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
package dev_pkg
3333
end
3434

35-
version = node['python']['version']
35+
version = node.default['python']['version'] ||
36+
node.set['python']['version'] ||
37+
node.override['python']['version'] ||
38+
node['python']['install_version']
3639
install_path = "#{node['python']['prefix_dir']}/bin/python#{version.split(/(^\d+\.\d+)/)[1]}"
3740

3841
remote_file "#{Chef::Config[:file_cache_path]}/Python-#{version}.tgz" do
@@ -65,4 +68,10 @@
6568
not_if { ::File.exists?(node['python']['binary']) }
6669
end
6770

71+
ruby_block 'set-python-version' do
72+
block do
73+
node.default['python']['version'] = version
74+
end
75+
end
76+
6877

0 commit comments

Comments
 (0)