|
18 | 18 | # limitations under the License.
|
19 | 19 | #
|
20 | 20 |
|
21 |
| -# COOK-1016 Handle RHEL/CentOS namings of python packages, by installing EPEL repo & package |
22 |
| -# This implementation was determined a stopgap measure until CHEF-2410 is implemented and widespread. |
23 |
| -if node['platform'] == 'centos' || node['platform'] == 'redhat' |
24 |
| - major_version = node['platform_version'].split('.').first.to_i |
25 |
| - if major_version == 5 |
26 |
| - include_recipe 'yum::epel' |
27 |
| - else |
28 |
| - # Do nothing. |
29 |
| - end |
30 |
| -end |
| 21 | +major_version = node['platform_version'].split('.').first.to_i |
31 | 22 |
|
32 |
| -python_pkgs = if node['platform'] == 'centos' || node['platform'] == 'redhat' |
33 |
| - major_version = node['platform_version'].split('.').first.to_i |
34 |
| - if major_version == 6 |
35 |
| - ["python", "python-devel"] |
36 |
| - else |
37 |
| - ["python26", "python26-devel"] |
38 |
| - end |
39 |
| - else |
40 |
| - value_for_platform( |
41 |
| - ["debian","ubuntu"] => { |
42 |
| - "default" => ["python","python-dev"] |
43 |
| - }, |
44 |
| - ["fedora","amazon"] => { |
45 |
| - "default" => ["python","python-devel"] |
46 |
| - }, |
47 |
| - ["freebsd"] => { |
48 |
| - "default" => ["python"] |
49 |
| - }, |
50 |
| - "default" => ["python","python-dev"] |
51 |
| - ) |
52 |
| - end |
| 23 | +# COOK-1016 Handle RHEL/CentOS namings of python packages, by installing EPEL |
| 24 | +# repo & package |
| 25 | +if platform_family?('rhel') && major_version < 6 |
| 26 | + include_recipe 'yum::epel' |
| 27 | + python_pkgs = ["python26", "python26-devel"] |
| 28 | + node['python']['binary'] = "/usr/bin/python26" |
| 29 | +else |
| 30 | + python_pkgs = value_for_platform_family( |
| 31 | + "debian" => ["python","python-dev"], |
| 32 | + "rhel" => ["python","python-devel"], |
| 33 | + "freebsd" => ["python"], |
| 34 | + "default" => ["python","python-dev"] |
| 35 | + ) |
| 36 | +end |
53 | 37 |
|
54 | 38 | python_pkgs.each do |pkg|
|
55 | 39 | package pkg do
|
|
0 commit comments