|
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 | +else |
| 29 | + python_pkgs = value_for_platform_family( |
| 30 | + "debian" => ["python","python-dev"], |
| 31 | + "rhel" => ["python","python-devel"], |
| 32 | + "freebsd" => ["python"], |
| 33 | + "default" => ["python","python-dev"] |
| 34 | + ) |
| 35 | +end |
53 | 36 |
|
54 | 37 | python_pkgs.each do |pkg| |
55 | 38 | package pkg do |
|
0 commit comments