diff --git a/manifests/init.pp b/manifests/init.pp index 99b1b891..2df35aff 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -390,21 +390,14 @@ class horizon( order => '50', } - # debian/ubuntu do not use collect static as the packaging already handles - # this as part of the packages. This was put in as a work around for Debian - # who has since fixed their packaging. - # See I813b5f6067bb6ecce279cab7278d9227c4d31d28 for the original history - # behind this section. - if $::os_package_type == 'rpm' { - exec { 'refresh_horizon_django_cache': - command => "${::horizon::params::manage_py} collectstatic --noinput --clear && ${::horizon::params::manage_py} compress --force", - refreshonly => true, - require => Package['horizon'], - } + exec { 'refresh_horizon_django_cache': + command => "${::horizon::params::manage_py} collectstatic --noinput --clear && ${::horizon::params::manage_py} compress --force", + refreshonly => true, + require => Package['horizon'], + } - if $compress_offline { - Concat[$::horizon::params::config_file] ~> Exec['refresh_horizon_django_cache'] - } + if $::os_package_type == 'rpm' and $compress_offline { + Concat[$::horizon::params::config_file] ~> Exec['refresh_horizon_django_cache'] } if $configure_apache { diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 462fc5a7..7811142e 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -30,16 +30,10 @@ describe 'horizon' do :tag => ['openstack', 'horizon-package'], ) } - it { - if facts[:os_package_type] == 'rpm' - is_expected.to contain_exec('refresh_horizon_django_cache').with({ + it { is_expected.to contain_exec('refresh_horizon_django_cache').with({ :command => '/usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear && /usr/share/openstack-dashboard/manage.py compress --force', :refreshonly => true, - }) - else - is_expected.to_not contain_exec('refresh_horizon_django_cache') - end - } + })} it { if facts[:os_package_type] == 'rpm' is_expected.to contain_concat(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_cache]') @@ -187,13 +181,7 @@ describe 'horizon' do ]) end - it { - if facts[:os_package_type] == 'rpm' - is_expected.to contain_exec('refresh_horizon_django_cache') - else - is_expected.to_not contain_exec('refresh_horizon_django_cache') - end - } + it { is_expected.to contain_exec('refresh_horizon_django_cache') } end context 'with tuskar-ui enabled' do @@ -414,7 +402,8 @@ describe 'horizon' do before do facts.merge!({ :osfamily => 'RedHat', - :operatingsystemrelease => '6.0' + :operatingsystemrelease => '6.0', + :os_package_type => 'rpm' }) end @@ -437,8 +426,8 @@ describe 'horizon' do before do facts.merge!({ :osfamily => 'Debian', - :operatingsystem => 'Debian', :operatingsystemrelease => '6.0', + :operatingsystem => 'Debian', :os_package_type => 'debian' }) end @@ -482,5 +471,4 @@ describe 'horizon' do ]) end end - end diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index a0d70066..e6a67e16 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -292,5 +292,4 @@ describe 'horizon::wsgi::apache' do end end end - end