From 0cf84e165da049f3da2fb26d8d282f5a407e0535 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 5 Jan 2022 22:19:29 +0900 Subject: [PATCH] Remove usage of custom os_package_type fact Currently we support usage of distro packages only, and this custom fact can be simply replaced by the default fact. Change-Id: Ie5516c8aab24fa32a0490bdfd116ce46bcc48c70 --- manifests/init.pp | 2 +- manifests/params.pp | 4 ++-- spec/classes/horizon_init_spec.rb | 4 ++-- spec/classes/horizon_wsgi_apache_spec.rb | 4 ---- spec/defines/horizon_dashboard_spec.rb | 4 ---- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index be4918f3..b947da15 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -760,7 +760,7 @@ and usage of a quoted value is deprecated.') if $compress_offline { Concat<| tag == 'django-config' |> ~> Exec['refresh_horizon_django_compress'] - if $::os_package_type == 'rpm' { + if $::osfamily == 'RedHat' { Concat<| tag == 'django-config' |> ~> Exec['refresh_horizon_django_cache'] -> Exec['refresh_horizon_django_compress'] } } diff --git a/manifests/params.pp b/manifests/params.pp index a484a2c2..937aec87 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -38,8 +38,8 @@ class horizon::params { $heat_dashboard_package_name = 'python3-heat-dashboard' $manila_dashboard_package_name = 'python3-manila-dashboard' $octavia_dashboard_package_name = 'python3-octavia-dashboard' - case $::os_package_type { - 'debian': { + case $::operatingsystem { + 'Debian': { $package_name = 'openstack-dashboard-apache' $httpd_config_file = '/etc/apache2/sites-available/openstack-dashboard-alias-only.conf' } diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 2e8acc2f..bbe8c332 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -32,7 +32,7 @@ describe 'horizon' do :refreshonly => true, })} it { - if facts[:os_package_type] == 'rpm' + if facts[:osfamily] == 'RedHat' is_expected.to contain_concat(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_cache]') is_expected.to contain_concat(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_compress]') else @@ -767,7 +767,7 @@ describe 'horizon' do let(:platforms_params) do case facts[:osfamily] when 'Debian' - if facts[:os_package_type] == 'debian' + if facts[:operatingsystem] == 'Debian' { :config_file => '/etc/openstack-dashboard/local_settings.py', :conf_d_dir => '/etc/openstack-dashboard/local_settings.d', :package_name => 'openstack-dashboard-apache', diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index 49f0fc57..785626d5 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -520,10 +520,6 @@ describe 'horizon::wsgi::apache' do }).each do |os,facts| context "on #{os}" do let (:facts) do - if facts[:operatingsystem] == 'Debian' - facts.merge!( :os_package_type => 'debian' ) - end - facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld', :concat_basedir => '/var/lib/puppet/concat', diff --git a/spec/defines/horizon_dashboard_spec.rb b/spec/defines/horizon_dashboard_spec.rb index 9032db54..deb73639 100644 --- a/spec/defines/horizon_dashboard_spec.rb +++ b/spec/defines/horizon_dashboard_spec.rb @@ -45,10 +45,6 @@ describe 'horizon::dashboard' do end shared_examples 'horizon::dashboard on Debian' do - before do - facts.merge!({:os_package_type => 'debian'}) - end - context 'with default' do it { should contain_package('python3-heat-dashboard').with( :ensure => 'installed',