Merge "Add support for WEBROOT in local_settings"
This commit is contained in:
commit
ef68ba0a60
@ -170,8 +170,8 @@ class horizon::wsgi::apache (
|
|||||||
error_log_file => 'horizon_error.log',
|
error_log_file => 'horizon_error.log',
|
||||||
priority => $priority,
|
priority => $priority,
|
||||||
aliases => [{
|
aliases => [{
|
||||||
alias => '/static',
|
alias => "${$::horizon::params::root_url}/static",
|
||||||
path => '/usr/share/openstack-dashboard/static',
|
path => '/usr/share/openstack-dashboard/static',
|
||||||
}],
|
}],
|
||||||
port => 80,
|
port => 80,
|
||||||
ssl_cert => $horizon_cert,
|
ssl_cert => $horizon_cert,
|
||||||
|
@ -327,6 +327,12 @@ describe 'horizon' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'horizon'
|
it_behaves_like 'horizon'
|
||||||
|
|
||||||
|
it 'sets WEBROOT in local_settings.py' do
|
||||||
|
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||||
|
"WEBROOT = '/dashboard/'",
|
||||||
|
])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
@ -344,5 +350,11 @@ describe 'horizon' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'horizon'
|
it_behaves_like 'horizon'
|
||||||
|
|
||||||
|
it 'sets WEBROOT in local_settings.py' do
|
||||||
|
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||||
|
"WEBROOT = '/horizon/'",
|
||||||
|
])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -203,6 +203,17 @@ describe 'horizon::wsgi::apache' do
|
|||||||
it {
|
it {
|
||||||
is_expected.to contain_class('apache::mod::wsgi').with(:wsgi_socket_prefix => '/var/run/wsgi')
|
is_expected.to contain_class('apache::mod::wsgi').with(:wsgi_socket_prefix => '/var/run/wsgi')
|
||||||
}
|
}
|
||||||
|
it 'configures webroot alias' do
|
||||||
|
if (Gem::Version.new(Puppet.version) >= Gem::Version.new('4.0'))
|
||||||
|
is_expected.to contain_apache__vhost('horizon_vhost').with(
|
||||||
|
'aliases' => [{'alias' => '/dashboard/static', 'path' => '/usr/share/openstack-dashboard/static'}],
|
||||||
|
)
|
||||||
|
else
|
||||||
|
is_expected.to contain_apache__vhost('horizon_vhost').with(
|
||||||
|
'aliases' => [['alias', '/dashboard/static'], ['path', '/usr/share/openstack-dashboard/static']],
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
@ -226,5 +237,16 @@ describe 'horizon::wsgi::apache' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'apache for horizon'
|
it_behaves_like 'apache for horizon'
|
||||||
|
it 'configures webroot alias' do
|
||||||
|
if (Gem::Version.new(Puppet.version) >= Gem::Version.new('4.0'))
|
||||||
|
is_expected.to contain_apache__vhost('horizon_vhost').with(
|
||||||
|
'aliases' => [{'alias' => '/horizon/static', 'path' => '/usr/share/openstack-dashboard/static'}],
|
||||||
|
)
|
||||||
|
else
|
||||||
|
is_expected.to contain_apache__vhost('horizon_vhost').with(
|
||||||
|
'aliases' => [['alias', '/horizon/static'], ['path', '/usr/share/openstack-dashboard/static']],
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,6 +7,10 @@ from openstack_dashboard import exceptions
|
|||||||
DEBUG = <%= @django_debug.to_s.capitalize %>
|
DEBUG = <%= @django_debug.to_s.capitalize %>
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
|
# WEBROOT is the location relative to Webserver root
|
||||||
|
# should end with a slash.
|
||||||
|
WEBROOT = '<%= scope.lookupvar("horizon::params::root_url") %>/'
|
||||||
|
|
||||||
# Required for Django 1.5.
|
# Required for Django 1.5.
|
||||||
# If horizon is running in production (DEBUG is False), set this
|
# If horizon is running in production (DEBUG is False), set this
|
||||||
# with the list of host/domain names that the application can serve.
|
# with the list of host/domain names that the application can serve.
|
||||||
|
Loading…
Reference in New Issue
Block a user