From 23e74c8925cccad1b651415d8d7f166a9632d8ab Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 22 Feb 2014 11:00:19 -0600 Subject: [PATCH] Allow OS package names (generally determined by platform family) to be overrided by an attribute --- attributes/default.rb | 1 + recipes/package.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index d0a32c4..b6df012 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -19,6 +19,7 @@ # default['python']['install_method'] = 'package' +default['python']['package_names'] = nil # see package recipe for platform-specific defaults if python['install_method'] == 'package' case platform diff --git a/recipes/package.rb b/recipes/package.rb index 115b53b..a03443f 100644 --- a/recipes/package.rb +++ b/recipes/package.rb @@ -20,9 +20,11 @@ major_version = node['platform_version'].split('.').first.to_i +if node['python']['package_names'] + python_pkgs = node['python']['package_names'] # COOK-1016 Handle RHEL/CentOS namings of python packages, by installing EPEL # repo & package -if platform_family?('rhel') && major_version < 6 +elsif platform_family?('rhel') && major_version < 6 include_recipe 'yum-epel' python_pkgs = ["python26", "python26-devel"] node.default['python']['binary'] = "/usr/bin/python26"