From 10e543f333a1a2316d0c2395533129b00734709f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 7 Apr 2023 14:03:51 +0900 Subject: [PATCH] Stop overriding default value for some limit options This removes the hard-coded default values for the following options so that we can leverage the defaults defined in Horizon itself. - API_RESULT_LIMIT - API_RESULT_PAGE_SIZE - DROPDOWN_MAX_ITEMS Change-Id: Id392b959ff05bba0dd75343313b2c3f956d29565 --- manifests/init.pp | 12 ++++++------ spec/classes/horizon_init_spec.rb | 3 --- templates/local_settings.py.erb | 7 +++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3acdbd8b..769db7cb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -120,15 +120,15 @@ # [*api_result_limit*] # (optional) Maximum number of objects (Swift containers/objects or images) # to display on a single page. -# Defaults to 1000. +# Defaults to undef. # # [*api_result_page_size*] # (optional) Maximum number of objects retrieved by a single request. -# Defaults to 20. +# Defaults to undef. # # [*dropdown_max_items*] # (optional) Specify a maximum number of items to display in a dropdown. -# Defaults to 30 +# Defaults to undef. # # [*log_handlers*] # (optional) Log handlers. Defaults to ['file'] @@ -585,9 +585,9 @@ class horizon( $secondary_endpoint_type = undef, $openstack_keystone_endpoint_type = undef, $available_regions = undef, - $api_result_limit = 1000, - $api_result_page_size = 20, - $dropdown_max_items = 30, + $api_result_limit = undef, + $api_result_page_size = undef, + $dropdown_max_items = undef, $log_handlers = ['file'], $log_level = 'INFO', $django_log_level = undef, diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 2c249431..e88a9a00 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -76,9 +76,6 @@ describe 'horizon' do " 'enable_ha_router': False,", " 'enable_quotas': True,", " 'enable_security_group': True,", - 'API_RESULT_LIMIT = 1000', - 'API_RESULT_PAGE_SIZE = 20', - 'DROPDOWN_MAX_ITEMS = 30', 'TIME_ZONE = "UTC"', " 'handlers': ['file'],", 'COMPRESS_OFFLINE = True', diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 0b3e9dd4..34cd6cfe 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -619,14 +619,21 @@ OPENSTACK_KEYSTONE_ENDPOINT_TYPE = "<%= @openstack_keystone_endpoint_type %>" # to paginate results. #API_RESULT_LIMIT = 1000 #API_RESULT_PAGE_SIZE = 20 +<% if !(@api_result_limit.nil?) -%> API_RESULT_LIMIT = <%= @api_result_limit %> +<% end -%> +<% if !(@api_result_page_size.nil?) -%> API_RESULT_PAGE_SIZE = <%= @api_result_page_size %> +<% end -%> # The size of chunk in bytes for downloading objects from Swift #SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024 # Specify a maximum number of items to display in a dropdown. +#DROPDOWN_MAX_ITEMS = 30 +<% if !(@dropdown_max_items.nil?) -%> DROPDOWN_MAX_ITEMS = <%= @dropdown_max_items %> +<% end -%> # The timezone of the server. This should correspond with the timezone # of your entire OpenStack installation, and hopefully be in UTC.