Add a few more strict type validations

Some logics (especially ones in templates) require specific data types.
This adds a few more type validations to avoid users from passing
unexpected types of inputs.

Change-Id: I7f77203f3eb431e96fde1fdfae0f0c51b7a8aaed
This commit is contained in:
Takashi Kajinami 2023-06-20 11:26:23 +09:00
parent 658a12dda5
commit 53bc36b448
5 changed files with 111 additions and 110 deletions

View File

@ -26,8 +26,8 @@
# Defaults to undef
#
class horizon::dashboards::designate(
$policy_file = 'designate_policy.yaml',
$policies = undef,
String[1] $policy_file = 'designate_policy.yaml',
Optional[Hash] $policies = undef,
) {
include horizon::deps

View File

@ -39,10 +39,10 @@
#
class horizon::dashboards::heat(
$enable_user_pass = true,
$policy_file = 'heat_policy.yaml',
String[1] $policy_file = 'heat_policy.yaml',
$template_generator_api_timeout = 60,
$template_generator_api_parallel = 2,
$policies = undef,
Optional[Hash] $policies = undef,
) {
include horizon::deps

View File

@ -37,9 +37,9 @@
# Defaults to undef
#
class horizon::dashboards::manila(
$policy_file = 'manila_policy.yaml',
$manila_options = {},
$policies = undef,
String[1] $policy_file = 'manila_policy.yaml',
Hash $manila_options = {},
Optional[Hash] $policies = undef,
) {
include horizon::deps

View File

@ -26,8 +26,8 @@
# Defaults to undef
#
class horizon::dashboards::octavia(
$policy_file = 'octavia_policy.yaml',
$policies = undef,
String[1] $policy_file = 'octavia_policy.yaml',
Optional[Hash] $policies = undef,
) {
include horizon::deps

View File

@ -593,7 +593,7 @@ class horizon(
$api_result_limit = undef,
$api_result_page_size = undef,
$dropdown_max_items = undef,
$log_handlers = ['file'],
Array[String[1]] $log_handlers = ['file'],
$log_level = 'INFO',
$django_log_level = undef,
$django_template_log_level = 'INFO',
@ -619,21 +619,22 @@ class horizon(
$wsgi_processes = $facts['os_workers'],
$wsgi_threads = '1',
Boolean $compress_offline = true,
$hypervisor_options = {},
$cinder_options = {},
$keystone_options = {},
$neutron_options = {},
$instance_options = {},
# TODO(tkajinam) Consider adding more strict validation about key-value
Hash $hypervisor_options = {},
Hash $cinder_options = {},
Hash $keystone_options = {},
Hash $neutron_options = {},
Hash $instance_options = {},
$use_simple_tenant_usage = undef,
$file_upload_temp_dir = '/tmp',
Optional[String] $policy_files_path = undef,
$policy_files = undef,
Optional[Hash[String, String]] $policy_files = undef,
$redirect_type = 'permanent',
Hash $api_versions = {},
Boolean $keystone_multidomain_support = false,
$keystone_default_domain = undef,
$keystone_domain_choices = undef,
$image_backend = {},
Hash[String, Hash[String, String]] $image_backend = {},
$overview_days_range = undef,
$root_url = $::horizon::params::root_url,
Stdlib::Absolutepath $root_path = "${::horizon::params::static_path}/openstack-dashboard",