From c726c9f7c6e3c541bd18f3ea820f4654ef413fb0 Mon Sep 17 00:00:00 2001 From: "Luis A. Garcia" Date: Tue, 8 Apr 2014 13:08:33 -0700 Subject: [PATCH] Use platform_family instead of platform As agreed on the mailing list: https://groups.google.com/forum/#!topic/opscode-chef-openstack/HEL3KqBQIUM This will allow the ibm_powerkvm platform to be recognized and will simplify uses of multiple platforms from the same family. Change-Id: Iebf2aad9f3b4649fb5c27d2fc93ee60c67e42737 Partially-Implements: blueprint add-ibm-powerkvm-enablement Implements: blueprint platform-family --- attributes/default.rb | 6 +++--- recipes/scheduler.rb | 2 +- templates/default/cinder-group-active.erb | 6 +++--- templates/default/targets.conf.erb | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 55b82c6..22433f7 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -209,8 +209,8 @@ default['openstack']['block-storage']['policy']['default'] = '["rule:admin_or_ow default['openstack']['block-storage']['policy']['admin_or_owner'] = '["is_admin:True"], ["project_id:%(project_id)s"]' default['openstack']['block-storage']['policy']['admin_api'] = '["is_admin:True"]' -case platform -when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this +case platform_family +when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this # operating system user and group names default['openstack']['block-storage']['user'] = 'cinder' default['openstack']['block-storage']['group'] = 'cinder' @@ -255,7 +255,7 @@ when 'suse' 'cinder_nfs_packages' => ['nfs-utils'], 'cinder_emc_packages' => ['python-pywbem'] } -when 'ubuntu' +when 'debian' # operating system user and group names default['openstack']['block-storage']['user'] = 'cinder' default['openstack']['block-storage']['group'] = 'cinder' diff --git a/recipes/scheduler.rb b/recipes/scheduler.rb index b138b4f..2e7375d 100644 --- a/recipes/scheduler.rb +++ b/recipes/scheduler.rb @@ -47,7 +47,7 @@ service 'cinder-scheduler' do subscribes :restart, 'template[/etc/cinder/cinder.conf]' end -audit_bin_dir = platform?('ubuntu') ? '/usr/bin' : '/usr/local/bin' +audit_bin_dir = platform_family?('debian') ? '/usr/bin' : '/usr/local/bin' audit_log = node['openstack']['block-storage']['cron']['audit_logfile'] if node['openstack']['telemetry'] diff --git a/templates/default/cinder-group-active.erb b/templates/default/cinder-group-active.erb index d47f15b..e2ea870 100644 --- a/templates/default/cinder-group-active.erb +++ b/templates/default/cinder-group-active.erb @@ -13,7 +13,7 @@ # Short-Description: cinder volume group active script ### END INIT INFO -<% if %w{centos redhat amazon scientific}.include? node.platform %> +<% if %w{rhel}.include? node.platform_family %> . /etc/rc.d/init.d/functions <% end %> @@ -23,10 +23,10 @@ start() if [ $? -ne 0 ]; then echo -n "Activating cinder volume group ..." vgcreate <%= @volume_name %> $(losetup --show -f <%= @volume_file %>) - <% if %w{centos redhat amazon scientific}.include? node.platform %> + <% if %w{rhel}.include? node.platform_family %> success echo - <% elsif %w{debian ubuntu}.include? node.platform %> + <% elsif %w{debian}.include? node.platform_family %> echo "SUCCESS" <% end %> fi diff --git a/templates/default/targets.conf.erb b/templates/default/targets.conf.erb index 5e017f1..bc4a01a 100644 --- a/templates/default/targets.conf.erb +++ b/templates/default/targets.conf.erb @@ -1,9 +1,9 @@ <%= node["openstack"]["block-storage"]["custom_template_banner"] %> -<% if %w{redhat centos fedora suse}.include?(node["platform"]) %> +<% if %w{rhel fedora suse}.include?(node["platform_family"]) %> include <%= node['openstack']['block-storage']['volume']['volumes_dir'] %>/* <% end %> -<% if %w{debian ubuntu}.include?(node["platform"]) %> +<% if %w{debian}.include?(node["platform_family"]) %> include /etc/tgt/conf.d/*.conf <% end %> default-driver iscsi