From 83b6d1b325f2223c1f096b4da022ce4ec944b2d3 Mon Sep 17 00:00:00 2001 From: Pratik Bandarkar Date: Tue, 29 Jan 2019 16:39:16 +0000 Subject: [PATCH] update "DROPDOWN_MAX_ITEMS" horizon parameter as a variable "DROPDOWN_MAX_ITEMS" horizon parameter was hardcoded in a ruby template. Hence, it was not possible to manage it using heat. This fix will allow user to manage "DROPDOWN_MAX_ITEMS" from heat template. Change-Id: I121a4ad2070cfef173c572a3d25788abbbf16989 Closes-Bug: #1813786 (cherry picked from commit 004142d577a1388244b19b2869797a4653b46bed) --- manifests/init.pp | 5 +++++ .../notes/add-dropdown_max_items-38ea8e64152d76e5.yaml | 6 ++++++ spec/classes/horizon_init_spec.rb | 3 +++ templates/local_settings.py.erb | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-dropdown_max_items-38ea8e64152d76e5.yaml diff --git a/manifests/init.pp b/manifests/init.pp index b2281889..3b163ee4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -84,6 +84,10 @@ # (optional) Maximum number of Swift containers/objects to display # on a single page. Defaults to 1000. # +# [*dropdown_max_items*] +# (optional) Specify a maximum number of items to display in a dropdown. +# Defaults to 30 +# # [*log_handler*] # (optional) Log handler. Defaults to 'file' # @@ -480,6 +484,7 @@ class horizon( $secondary_endpoint_type = undef, $available_regions = undef, $api_result_limit = 1000, + $dropdown_max_items = 30, $log_handler = 'file', $log_level = 'INFO', $help_url = 'http://docs.openstack.org', diff --git a/releasenotes/notes/add-dropdown_max_items-38ea8e64152d76e5.yaml b/releasenotes/notes/add-dropdown_max_items-38ea8e64152d76e5.yaml new file mode 100644 index 00000000..2d7894d3 --- /dev/null +++ b/releasenotes/notes/add-dropdown_max_items-38ea8e64152d76e5.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Added new horizon::dropdown_max_items parameter that configures the + DROPDOWN_MAX_ITEMS config option in local_settings.py. Default value + is set to 30 like the Horizon default is. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 2dd88d6c..94f28e87 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -76,6 +76,7 @@ describe 'horizon' do " 'enable_security_group': True,", " 'enable_vpn': False,", 'API_RESULT_LIMIT = 1000', + 'DROPDOWN_MAX_ITEMS = 30', 'TIME_ZONE = "UTC"', 'COMPRESS_OFFLINE = True', "FILE_UPLOAD_TEMP_DIR = '/tmp'", @@ -110,6 +111,7 @@ describe 'horizon' do :secondary_endpoint_type => 'ANY-VALUE', :django_debug => true, :api_result_limit => 4682, + :dropdown_max_items => 123, :compress_offline => false, :hypervisor_options => {'can_set_mount_point' => false, 'can_set_password' => true }, :cinder_options => {'enable_backup' => true }, @@ -196,6 +198,7 @@ describe 'horizon' do 'OPENSTACK_ENDPOINT_TYPE = "internalURL"', 'SECONDARY_ENDPOINT_TYPE = "ANY-VALUE"', 'API_RESULT_LIMIT = 4682', + 'DROPDOWN_MAX_ITEMS = 123', 'TIME_ZONE = "Asia/Shanghai"', "AVAILABLE_THEMES = [", " ('default', 'Default', 'themes/default'),", diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 41d41879..2149e730 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -564,7 +564,7 @@ API_RESULT_PAGE_SIZE = 20 #SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024 # Specify a maximum number of items to display in a dropdown. -#DROPDOWN_MAX_ITEMS = 30 +DROPDOWN_MAX_ITEMS = <%= @dropdown_max_items %> # The timezone of the server. This should correspond with the timezone # of your entire OpenStack installation, and hopefully be in UTC.