Adds interface for enable_user_pass

Uncomments the `OPENSTACK_HEAT_STACK` dict and allows to
set `enable_user_pass` in the `local_settings.py.erb`
template

Change-Id: I97874af257a7cbb3eea862645952f6000e3fc3ce
Closes-Bug: #1676366
This commit is contained in:
Mariusz Karpiarz 2017-03-24 17:23:55 +00:00
parent 8e00bbbd1d
commit 47aeba3f5b
4 changed files with 34 additions and 1 deletions

View File

@ -352,6 +352,10 @@
# [*password_validator_help*]
# (optional) Help text to display when password validation fails in horizon.
#
# [*enable_user_pass*]
# (optional) Enable the password field while launching a Heat stack.
# Defaults to true
#
# === DEPRECATED group/name
#
# [*fqdn*]
@ -458,6 +462,7 @@ class horizon(
$websso_idp_mapping = undef,
$password_validator = undef,
$password_validator_help = undef,
$enable_user_pass = true,
# DEPRECATED PARAMETERS
$custom_theme_path = undef,
$fqdn = undef,

View File

@ -0,0 +1,5 @@
---
features:
- Added ability to enable/disable the password field while launching
a Heat stack by setting the enable_user_pass parameter of the
OPENSTACK_HEAT_STACK dictionary in local_settings.py.

View File

@ -76,7 +76,10 @@ describe 'horizon' do
'API_RESULT_LIMIT = 1000',
'TIME_ZONE = "UTC"',
'COMPRESS_OFFLINE = True',
"FILE_UPLOAD_TEMP_DIR = '/tmp'"
"FILE_UPLOAD_TEMP_DIR = '/tmp'",
"OPENSTACK_HEAT_STACK = {",
" 'enable_user_pass': True",
"}",
])
# From internals of verify_contents, get the contents to check for absence of a line
@ -199,6 +202,19 @@ describe 'horizon' do
it { is_expected.to contain_file(params[:file_upload_temp_dir]) }
end
context 'with enable_user_pass disabled' do
before do
params.merge!({ :enable_user_pass => false })
end
it {
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
"OPENSTACK_HEAT_STACK = {",
" 'enable_user_pass': False",
"}",
])
}
end
context 'with overridden parameters and cache_server_ip array' do
before do
params.merge!({

View File

@ -453,6 +453,13 @@ OPENSTACK_NEUTRON_NETWORK = {
#OPENSTACK_HEAT_STACK = {
# 'enable_user_pass': True,
#}
OPENSTACK_HEAT_STACK = {
<%- if @enable_user_pass -%>
'enable_user_pass': True
<%- else -%>
'enable_user_pass': False
<%- end -%>
}
# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
# in the OpenStack Dashboard related to the Image service, such as the list