Merge "Horizon django cache compress on ubuntu"
This commit is contained in:
commit
8c593974bf
@ -433,13 +433,22 @@ class horizon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec { 'refresh_horizon_django_cache':
|
exec { 'refresh_horizon_django_cache':
|
||||||
command => "${::horizon::params::manage_py} collectstatic --noinput --clear && ${::horizon::params::manage_py} compress --force",
|
command => "${::horizon::params::manage_py} collectstatic --noinput --clear",
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
require => Package['horizon'],
|
require => Package['horizon'],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $::os_package_type == 'rpm' and $compress_offline {
|
exec { 'refresh_horizon_django_compress':
|
||||||
Concat[$::horizon::params::config_file] ~> Exec['refresh_horizon_django_cache']
|
command => "${::horizon::params::manage_py} compress --force",
|
||||||
|
refreshonly => true,
|
||||||
|
require => Package['horizon'],
|
||||||
|
}
|
||||||
|
|
||||||
|
if $compress_offline {
|
||||||
|
Concat[$::horizon::params::config_file] ~> Exec['refresh_horizon_django_compress']
|
||||||
|
if $::os_package_type == 'rpm' {
|
||||||
|
Concat[$::horizon::params::config_file] ~> Exec['refresh_horizon_django_cache'] -> Exec['refresh_horizon_django_compress']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $configure_apache {
|
if $configure_apache {
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Horizon Offline Generation Error on ubuntu systems. Previously, the 'manage.py compress' only ran on redhat. This change
|
||||||
|
allows the command to be executed on ubuntu also.
|
@ -25,14 +25,20 @@ describe 'horizon' do
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
it { 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',
|
:command => '/usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear',
|
||||||
|
:refreshonly => true,
|
||||||
|
})}
|
||||||
|
it { is_expected.to contain_exec('refresh_horizon_django_compress').with({
|
||||||
|
:command => '/usr/share/openstack-dashboard/manage.py compress --force',
|
||||||
:refreshonly => true,
|
:refreshonly => true,
|
||||||
})}
|
})}
|
||||||
it {
|
it {
|
||||||
if facts[:os_package_type] == 'rpm'
|
if facts[:os_package_type] == 'rpm'
|
||||||
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_cache]')
|
||||||
|
is_expected.to contain_concat(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_compress]')
|
||||||
else
|
else
|
||||||
is_expected.to_not contain_concat(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_cache]')
|
is_expected.to_not 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]')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,6 +175,7 @@ describe 'horizon' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.not_to contain_file(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_cache]') }
|
it { is_expected.not_to contain_file(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_cache]') }
|
||||||
|
it { is_expected.not_to contain_file(platforms_params[:config_file]).that_notifies('Exec[refresh_horizon_django_compress]') }
|
||||||
|
|
||||||
it { is_expected.to contain_file(params[:file_upload_temp_dir]) }
|
it { is_expected.to contain_file(params[:file_upload_temp_dir]) }
|
||||||
end
|
end
|
||||||
@ -187,6 +194,7 @@ describe 'horizon' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_exec('refresh_horizon_django_cache') }
|
it { is_expected.to contain_exec('refresh_horizon_django_cache') }
|
||||||
|
it { is_expected.to contain_exec('refresh_horizon_django_compress') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'installs python memcache library when cache_backend is set to memcache' do
|
context 'installs python memcache library when cache_backend is set to memcache' do
|
||||||
|
Loading…
Reference in New Issue
Block a user