From c86b851ac118deb47f57a38e9c50f13b3b5ab507 Mon Sep 17 00:00:00 2001 From: Andy Botting Date: Thu, 18 Aug 2016 16:41:02 +1000 Subject: [PATCH] Allow override of dashboard label Overrides the default dashboard name (Murano) that is displayed in the main accordion navigation Change-Id: I49edfe483c87ccc537889609d7eefc11b53f29d2 --- manifests/dashboard.pp | 6 ++++++ releasenotes/notes/dashboard-label-60e3afe5a9de0339.yaml | 3 +++ spec/classes/murano_dashboard_spec.rb | 3 +++ templates/local_settings.py.erb | 1 + 4 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/dashboard-label-60e3afe5a9de0339.yaml diff --git a/manifests/dashboard.pp b/manifests/dashboard.pp index d06ea92..d6bbbee 100644 --- a/manifests/dashboard.pp +++ b/manifests/dashboard.pp @@ -8,6 +8,11 @@ # (Optional) Ensure state for package # Defaults to 'present' # +# [*dashboard_name*] +# (Optional) Overrides the default dashboard name (Murano) that is displayed +# in the main accordion navigation +# Defaults to 'undef' +# # [*repo_url*] # (Optional) Application repository URL for murano-dashboard # Defaults to 'undef' @@ -46,6 +51,7 @@ # class murano::dashboard( $package_ensure = 'present', + $dashboard_name = undef, $repo_url = undef, $enable_glare = false, $collect_static_script = '/usr/share/openstack-dashboard/manage.py', diff --git a/releasenotes/notes/dashboard-label-60e3afe5a9de0339.yaml b/releasenotes/notes/dashboard-label-60e3afe5a9de0339.yaml new file mode 100644 index 0000000..f1fa9d9 --- /dev/null +++ b/releasenotes/notes/dashboard-label-60e3afe5a9de0339.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add ability to configure dashboard label diff --git a/spec/classes/murano_dashboard_spec.rb b/spec/classes/murano_dashboard_spec.rb index c5123ef..5530950 100644 --- a/spec/classes/murano_dashboard_spec.rb +++ b/spec/classes/murano_dashboard_spec.rb @@ -26,6 +26,7 @@ describe 'murano::dashboard' do it { is_expected.to_not contain_concat__fragment('murano_dashboard_section').with_content(/MURANO_API_URL = /)} it { is_expected.to_not contain_concat__fragment('murano_dashboard_section').with_content(/MURANO_REPO_URL = /)} + it { is_expected.to_not contain_concat__fragment('murano_dashboard_section').with_content(/MURANO_DASHBOARD_NAME = /)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/MAX_FILE_SIZE_MB = '5'/)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/METADATA_CACHE_DIR = '\/var\/cache\/murano-dashboard'/)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/LOGGING\['loggers'\]\['muranodashboard'\] = \{'handlers': 'file', 'level': 'DEBUG'\}/)} @@ -52,6 +53,7 @@ describe 'murano::dashboard' do shared_examples_for 'with parameters override' do let :params do { + :dashboard_name => 'Application Catalog', :repo_url => 'http://storage.apps.openstack.com', :enable_glare => true, :collect_static_script => '/bin/openstack-dashboard/manage.py', @@ -79,6 +81,7 @@ describe 'murano::dashboard' do :order => 2, })} + it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/MURANO_DASHBOARD_NAME = 'Application Catalog'/)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/MURANO_REPO_URL = 'http:\/\/storage.apps.openstack.com'/)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/MAX_FILE_SIZE_MB = '5'/)} it { is_expected.to contain_concat__fragment('murano_dashboard_section').with_content(/METADATA_CACHE_DIR = '\/tmp\/muranodashboard-cache'/)} diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 2c06c2c..529efbe 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -1,4 +1,5 @@ ## MURANO_CONFIG_BEGIN ## +<% if @dashboard_name != nil %>MURANO_DASHBOARD_NAME = '<%= @dashboard_name %>'<% end %> <% if @repo_url != nil %>MURANO_REPO_URL = '<%= @repo_url %>'<% end %> MAX_FILE_SIZE_MB = '<%= @max_file_size %>' METADATA_CACHE_DIR = '<%= @metadata_dir %>'