Skip to content

Commit

Permalink
Merge "Added support for parametrized help_url path." into stable/havana
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 7, 2014
2 parents 4684099 + 72e3088 commit ad9117d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
# (optional) Location of template to use for local_settings.py generation.
# Defaults to 'horizon/local_settings.py.erb'.
#
# [*help_url*]
# (optional) Location where the documentation should point.
# Defaults to 'http://docs.openstack.org'.

class horizon(
$secret_key,
$fqdn = $::fqdn,
Expand All @@ -96,6 +100,7 @@
$horizon_cert = undef,
$horizon_key = undef,
$horizon_ca = undef,
$help_url = 'http://docs.openstack.org',
$local_settings_template = 'horizon/local_settings.py.erb'
) {

Expand Down
18 changes: 17 additions & 1 deletion spec/classes/horizon_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,30 @@
before do
params.merge!({
:django_debug => 'True',
:help_url => 'https://docs.openstack.org',
:local_settings_template => fixtures_path + '/override_local_settings.py.erb'
})
end

it 'uses the custom local_settings.py template' do
verify_contents(subject, '/etc/openstack-dashboard/local_settings.py', [
'# Custom local_settings.py',
'DEBUG = True'
'DEBUG = True',
"HORIZON_CONFIG = {",
" 'dashboards': ('project', 'admin', 'settings',),",
" 'default_dashboard': 'project',",
" '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
Expand Down
16 changes: 16 additions & 0 deletions spec/fixtures/override_local_settings.py.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# Custom local_settings.py
DEBUG = <%= django_debug %>

HORIZON_CONFIG = {
'dashboards': ('project', 'admin', 'settings',),
'default_dashboard': 'project',
'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},
}
2 changes: 1 addition & 1 deletion templates/local_settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ HORIZON_CONFIG = {
'fade_duration': 1500,
'types': ['alert-success', 'alert-info']
},
'help_url': "http://docs.openstack.org",
'help_url': "<%= @help_url %>",
'exceptions': {'recoverable': exceptions.RECOVERABLE,
'not_found': exceptions.NOT_FOUND,
'unauthorized': exceptions.UNAUTHORIZED},
Expand Down

0 comments on commit ad9117d

Please sign in to comment.