Stop replacing whole HORIZON_CONFIG dict
... so that we can leverage the default items defined in horizon. Change-Id: I6242f8cb48e51892476ead2f764d7d2c96d11448
This commit is contained in:
parent
4f3e975a9e
commit
08acafc46b
@ -525,19 +525,7 @@ describe 'horizon' do
|
|||||||
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||||
'# Custom local_settings.py',
|
'# Custom local_settings.py',
|
||||||
'DEBUG = True',
|
'DEBUG = True',
|
||||||
"HORIZON_CONFIG = {",
|
'HORIZON_CONFIG["help_url"] = "https://docs.openstack.org"',
|
||||||
" 'user_home': 'openstack_dashboard.views.get_user_home',",
|
|
||||||
" 'ajax_queue_limit': 10,",
|
|
||||||
" 'auto_fade_alerts': {",
|
|
||||||
" 'delay': 3000,",
|
|
||||||
" 'fade_duration': 1500,",
|
|
||||||
" 'types': ['alert-success', 'alert-info']",
|
|
||||||
" },",
|
|
||||||
" 'help_url': \"https://docs.openstack.org\",",
|
|
||||||
" 'exceptions': {'recoverable': exceptions.RECOVERABLE,",
|
|
||||||
" 'not_found': exceptions.NOT_FOUND,",
|
|
||||||
" 'unauthorized': exceptions.UNAUTHORIZED},",
|
|
||||||
"}",
|
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -695,61 +683,18 @@ describe 'horizon' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with customization_module provided' do
|
context 'with help_url and customization_module provided' do
|
||||||
before do
|
before do
|
||||||
params.merge!({
|
params.merge!({
|
||||||
:help_url => 'https://docs.openstack.org',
|
:help_url => 'https://docs.openstack.org',
|
||||||
:customization_module => 'my_project.overrides',
|
:customization_module => 'my_project.overrides',
|
||||||
:local_settings_template => fixtures_path + '/override_local_settings.py.erb'
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'uses the custom local_settings.py template' do
|
it 'configures both options' do
|
||||||
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
||||||
'# Custom local_settings.py',
|
'HORIZON_CONFIG["help_url"] = "https://docs.openstack.org"',
|
||||||
"HORIZON_CONFIG = {",
|
'HORIZON_CONFIG["customization_module"] = "my_project.overrides"',
|
||||||
" 'user_home': 'openstack_dashboard.views.get_user_home',",
|
|
||||||
" 'ajax_queue_limit': 10,",
|
|
||||||
" 'auto_fade_alerts': {",
|
|
||||||
" 'delay': 3000,",
|
|
||||||
" 'fade_duration': 1500,",
|
|
||||||
" 'types': ['alert-success', 'alert-info']",
|
|
||||||
" },",
|
|
||||||
" 'help_url': \"https://docs.openstack.org\",",
|
|
||||||
" 'exceptions': {'recoverable': exceptions.RECOVERABLE,",
|
|
||||||
" 'not_found': exceptions.NOT_FOUND,",
|
|
||||||
" 'unauthorized': exceptions.UNAUTHORIZED},",
|
|
||||||
" 'customization_module': 'my_project.overrides',",
|
|
||||||
"}",
|
|
||||||
])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with customization_module empty' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:help_url => 'https://docs.openstack.org',
|
|
||||||
:customization_module => '',
|
|
||||||
:local_settings_template => fixtures_path + '/override_local_settings.py.erb'
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'uses the custom local_settings.py template' do
|
|
||||||
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
|
|
||||||
'# Custom local_settings.py',
|
|
||||||
"HORIZON_CONFIG = {",
|
|
||||||
" 'user_home': 'openstack_dashboard.views.get_user_home',",
|
|
||||||
" 'ajax_queue_limit': 10,",
|
|
||||||
" 'auto_fade_alerts': {",
|
|
||||||
" 'delay': 3000,",
|
|
||||||
" 'fade_duration': 1500,",
|
|
||||||
" 'types': ['alert-success', 'alert-info']",
|
|
||||||
" },",
|
|
||||||
" 'help_url': \"https://docs.openstack.org\",",
|
|
||||||
" 'exceptions': {'recoverable': exceptions.RECOVERABLE,",
|
|
||||||
" 'not_found': exceptions.NOT_FOUND,",
|
|
||||||
" 'unauthorized': exceptions.UNAUTHORIZED},",
|
|
||||||
"}",
|
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
17
spec/fixtures/override_local_settings.py.erb
vendored
17
spec/fixtures/override_local_settings.py.erb
vendored
@ -1,19 +1,4 @@
|
|||||||
# Custom local_settings.py
|
# Custom local_settings.py
|
||||||
DEBUG = <%= @django_debug %>
|
DEBUG = <%= @django_debug %>
|
||||||
|
|
||||||
HORIZON_CONFIG = {
|
HORIZON_CONFIG["help_url"] = "<%= @help_url %>"
|
||||||
'user_home': 'openstack_dashboard.views.get_user_home',
|
|
||||||
'ajax_queue_limit': 10,
|
|
||||||
'auto_fade_alerts': {
|
|
||||||
'delay': 3000,
|
|
||||||
'fade_duration': 1500,
|
|
||||||
'types': ['alert-success', 'alert-info']
|
|
||||||
},
|
|
||||||
'help_url': "<%= @help_url %>",
|
|
||||||
'exceptions': {'recoverable': exceptions.RECOVERABLE,
|
|
||||||
'not_found': exceptions.NOT_FOUND,
|
|
||||||
'unauthorized': exceptions.UNAUTHORIZED},
|
|
||||||
<% if @customization_module and ! (@customization_module.empty?) -%>
|
|
||||||
'customization_module': '<%= @customization_module -%>',
|
|
||||||
<% end -%>
|
|
||||||
}
|
|
||||||
|
@ -127,24 +127,14 @@ OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = '<%= @keystone_default_domain %>'
|
|||||||
# Set to None explicitly if you want to deactivate the console.
|
# Set to None explicitly if you want to deactivate the console.
|
||||||
#CONSOLE_TYPE = "AUTO"
|
#CONSOLE_TYPE = "AUTO"
|
||||||
|
|
||||||
# Default OpenStack Dashboard configuration.
|
# URL for additional help with this site.
|
||||||
HORIZON_CONFIG = {
|
HORIZON_CONFIG["help_url"] = "<%= @help_url %>"
|
||||||
'user_home': 'openstack_dashboard.views.get_user_home',
|
|
||||||
'ajax_queue_limit': 10,
|
|
||||||
'auto_fade_alerts': {
|
|
||||||
'delay': 3000,
|
|
||||||
'fade_duration': 1500,
|
|
||||||
'types': ['alert-success', 'alert-info']
|
|
||||||
},
|
|
||||||
'help_url': "<%= @help_url %>",
|
|
||||||
'exceptions': {'recoverable': exceptions.RECOVERABLE,
|
|
||||||
'not_found': exceptions.NOT_FOUND,
|
|
||||||
'unauthorized': exceptions.UNAUTHORIZED},
|
|
||||||
<% if @customization_module and ! (@customization_module.empty?) -%>
|
|
||||||
'customization_module': '<%= @customization_module -%>',
|
|
||||||
<% end -%>
|
|
||||||
}
|
|
||||||
|
|
||||||
|
<% if @customization_module and ! (@customization_module.empty?) -%>
|
||||||
|
# The python module containing own modifications
|
||||||
|
HORIZON_CONFIG["customization_module"] = "<%= @customization_module -%>"
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
# If provided, a "Report Bug" link will be displayed in the site header
|
# If provided, a "Report Bug" link will be displayed in the site header
|
||||||
# which links to the value of this setting (ideally a URL containing
|
# which links to the value of this setting (ideally a URL containing
|
||||||
# information on how to report issues).
|
# information on how to report issues).
|
||||||
|
Loading…
Reference in New Issue
Block a user