Allow configuring 'CREATE_IMAGE_DEFAULTS' setting

Horizon now has the option of selecting various defaults for the
create image panel.  This patch allows configuring those options.

Change-Id: I01d9fc44d957394acc4243f3ee34e6e50eec0bdf
This commit is contained in:
Mohammed Naser 2017-08-24 10:40:46 -04:00 committed by Alex Schultz
parent 5dd2e6b84b
commit c60cb1a392
3 changed files with 22 additions and 1 deletions

View File

@ -285,6 +285,10 @@
# Valid values are 'legacy' and 'angular'
# Defaults to 'legacy'
#
# [*create_image_defaults*]
# (optional) A dictionary of default settings for create image modal.
# Defaults to undef - will not add entry to local settings.
#
# [*password_retrieve*]
# (optional) Enables the use of 'Retrieve Password' in the Horizon Web UI.
# Defaults to false
@ -456,6 +460,7 @@ class horizon(
$default_theme = false,
$password_autocomplete = 'off',
$images_panel = 'legacy',
$create_image_defaults = undef,
$password_retrieve = false,
$disable_password_reveal = false,
$enforce_password_check = false,

View File

@ -130,6 +130,7 @@ describe 'horizon' do
:default_theme => 'default',
:password_autocomplete => 'on',
:images_panel => 'angular',
:create_image_defaults => {'image_visibility' => 'private'},
:password_retrieve => true,
:enable_secure_proxy_ssl_header => true,
})
@ -178,6 +179,8 @@ describe 'horizon' do
" 'supported_provider_types': ['flat', 'vxlan'],",
" 'supported_vnic_types': ['*'],",
'OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True',
'CREATE_IMAGE_DEFAULTS = {',
" 'image_visibility': 'private',",
'OPENSTACK_ENDPOINT_TYPE = "internalURL"',
'SECONDARY_ENDPOINT_TYPE = "ANY-VALUE"',
'API_RESULT_LIMIT = 4682',

View File

@ -508,6 +508,18 @@ OPENSTACK_IMAGE_BACKEND = {
# table.
#IMAGE_RESERVED_CUSTOM_PROPERTIES = []
# A dictionary of default settings for create image modal.
#CREATE_IMAGE_DEFAULTS = {
# 'image_visibility': "public",
#}
<% if @create_image_defaults %>
CREATE_IMAGE_DEFAULTS = {
<%- @create_image_defaults.sort.each do |opt_name,opt_val| -%>
'<%= opt_name %>': '<%= opt_val %>',
<%- end -%>
}
<% end %>
# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
# in the Keystone service catalog. Use this setting when Horizon is running
# external to the OpenStack environment. The default is 'publicURL'.
@ -985,7 +997,8 @@ OVERVIEW_DAYS_RANGE = <%= @overview_days_range %>
# See: https://wiki.openstack.org/wiki/Horizon/RESTAPI
REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
'LAUNCH_INSTANCE_DEFAULTS',
'OPENSTACK_IMAGE_FORMATS']
'OPENSTACK_IMAGE_FORMATS',
'CREATE_IMAGE_DEFAULTS']
# Additional settings can be made available to the client side for
# extensibility by specifying them in REST_API_ADDITIONAL_SETTINGS