From d3724a40b23e2ab952529cc7dcdf452e133b314b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 16 Jun 2023 02:07:13 +0900 Subject: [PATCH] replace validate_legacy with proper data types the validate_legacy function is marked for deprecation in v9.0.0 from puppetlabs-stdlib. Change-Id: I0707b0a8b200480dbfb8f52353596127cf4dc8b5 --- manifests/api.pp | 13 ++++--------- manifests/config.pp | 7 ++----- manifests/db/mysql.pp | 4 +--- manifests/keystone/notification.pp | 7 ++----- manifests/policy.pp | 4 +--- manifests/retry_scheduler.pp | 7 ++----- manifests/worker.pp | 9 +++------ 7 files changed, 15 insertions(+), 36 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 3475587e..f14d58a9 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -257,7 +257,7 @@ class barbican::api ( $enabled_secretstore_plugins = $facts['os_service_default'], $enabled_crypto_plugins = $facts['os_service_default'], $enabled_secret_stores = 'simple_crypto', - $multiple_secret_stores_enabled = false, + Boolean $multiple_secret_stores_enabled = false, $enabled_certificate_plugins = $facts['os_service_default'], $enabled_certificate_event_plugins = $facts['os_service_default'], $kombu_ssl_ca_certs = $facts['os_service_default'], @@ -268,9 +268,9 @@ class barbican::api ( $kombu_failover_strategy = $facts['os_service_default'], $kombu_compression = $facts['os_service_default'], $auth_strategy = 'keystone', - $manage_service = true, - $enabled = true, - $sync_db = true, + Boolean $manage_service = true, + Boolean $enabled = true, + Boolean $sync_db = true, $db_auto_create = $facts['os_service_default'], $service_name = $::barbican::params::api_service_name, $enable_proxy_headers_parsing = $facts['os_service_default'], @@ -284,11 +284,6 @@ class barbican::api ( include barbican::client include barbican::policy - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $sync_db) - validate_legacy(Boolean, 'validate_bool', $multiple_secret_stores_enabled) - package { 'barbican-api': ensure => $package_ensure, name => $::barbican::params::api_package_name, diff --git a/manifests/config.pp b/manifests/config.pp index 9cbd1cc3..eceac52d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -27,15 +27,12 @@ # or Puppet catalog compilation will fail with duplicate resources. # class barbican::config ( - $api_config = {}, - $api_paste_ini_config = {}, + Hash $api_config = {}, + Hash $api_paste_ini_config = {}, ) { include barbican::deps - validate_legacy(Hash, 'validate_hash', $api_config) - validate_legacy(Hash, 'validate_hash', $api_paste_ini_config) - create_resources('barbican_config', $api_config) create_resources('barbican_api_paste_ini', $api_paste_ini_config) } diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 516f9754..8e442638 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -34,7 +34,7 @@ # Defaults to 'utf8_general_ci' # class barbican::db::mysql( - $password, + String[1] $password, $dbname = 'barbican', $user = 'barbican', $host = '127.0.0.1', @@ -45,8 +45,6 @@ class barbican::db::mysql( include barbican::deps - validate_legacy(String, 'validate_string', $password) - openstacklib::db::mysql { 'barbican': user => $user, password => $password, diff --git a/manifests/keystone/notification.pp b/manifests/keystone/notification.pp index fc33b081..bbb48799 100644 --- a/manifests/keystone/notification.pp +++ b/manifests/keystone/notification.pp @@ -39,14 +39,12 @@ class barbican::keystone::notification ( $keystone_notification_allow_requeue = $facts['os_service_default'], $keystone_notification_thread_pool_size = $facts['os_service_default'], $package_ensure = 'present', - $manage_service = true, + Boolean $manage_service = true, ) { include barbican::deps include barbican::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - barbican_config { 'keystone_notifications/enable': value => $enable_keystone_notification; 'keystone_notifications/control_exchange': value => $keystone_notification_control_exchange; @@ -64,8 +62,7 @@ class barbican::keystone::notification ( if is_service_default($enable_keystone_notification) { $service_enabled = false } else { - validate_legacy(Boolean, 'validate_bool', $enable_keystone_notification) - $service_enabled = $enable_keystone_notification + $service_enabled = Boolean($enable_keystone_notification) } if $manage_service { diff --git a/manifests/policy.pp b/manifests/policy.pp index 0e561d86..21b40ed6 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -48,7 +48,7 @@ class barbican::policy ( $enforce_scope = $facts['os_service_default'], $enforce_new_defaults = $facts['os_service_default'], - $policies = {}, + Hash $policies = {}, $policy_path = '/etc/barbican/policy.yaml', $policy_default_rule = $facts['os_service_default'], $policy_dirs = $facts['os_service_default'], @@ -58,8 +58,6 @@ class barbican::policy ( include barbican::deps include barbican::params - validate_legacy(Hash, 'validate_hash', $policies) - $policy_parameters = { policies => $policies, policy_path => $policy_path, diff --git a/manifests/retry_scheduler.pp b/manifests/retry_scheduler.pp index 4f8aac8e..9c8a80e2 100644 --- a/manifests/retry_scheduler.pp +++ b/manifests/retry_scheduler.pp @@ -26,8 +26,8 @@ # class barbican::retry_scheduler ( $package_ensure = 'present', - $manage_service = true, - $enabled = true, + Boolean $manage_service = true, + Boolean $enabled = true, $initial_delay_seconds = $facts['os_service_default'], $periodic_interval_max_seconds = $facts['os_service_default'], ){ @@ -35,9 +35,6 @@ class barbican::retry_scheduler ( include barbican::deps include barbican::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - barbican_config { 'retry_scheduler/initial_delay_seconds': value => $initial_delay_seconds; 'retry_scheduler/periodic_interval_max_seconds': value => $periodic_interval_max_seconds; diff --git a/manifests/worker.pp b/manifests/worker.pp index b688f924..9e2c9b97 100644 --- a/manifests/worker.pp +++ b/manifests/worker.pp @@ -34,16 +34,13 @@ # Defaults to true # class barbican::worker ( - $package_ensure = 'present', - $manage_service = true, - $enabled = true, + $package_ensure = 'present', + Boolean $manage_service = true, + Boolean $enabled = true, ) inherits barbican::params { include barbican::deps - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - package { 'barbican-worker': ensure => $package_ensure, name => $::barbican::params::worker_package_name,