Allow override of dashboard label

Overrides the default dashboard name (Murano) that is displayed
in the main accordion navigation

Change-Id: I49edfe483c87ccc537889609d7eefc11b53f29d2
This commit is contained in:
Andy Botting 2016-08-18 16:41:02 +10:00
parent 9731904546
commit c86b851ac1
4 changed files with 13 additions and 0 deletions

View File

@ -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',

View File

@ -0,0 +1,3 @@
---
features:
- Add ability to configure dashboard label

View File

@ -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'/)}

View File

@ -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 %>'