replace validate_legacy with proper data types

the validate_legacy function is marked for deprecation in
v9.0.0 from puppetlabs-stdlib.

Change-Id: I6a4e4fe824713a08839ab49f151415a9186a9a5a
This commit is contained in:
Takashi Kajinami 2023-06-16 02:02:59 +09:00
parent 85c81d97ce
commit c4ab7eb22a
7 changed files with 22 additions and 42 deletions

View File

@ -53,11 +53,11 @@
# Defaults to 'Default'
#
class aodh::api (
$manage_service = true,
$enabled = true,
Boolean $manage_service = true,
Boolean $enabled = true,
$package_ensure = 'present',
$service_name = $::aodh::params::api_service_name,
$sync_db = false,
Boolean $sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $facts['os_service_default'],
$max_request_body_size = $facts['os_service_default'],
@ -70,10 +70,6 @@ class aodh::api (
include aodh::params
include aodh::policy
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
validate_legacy(Boolean, 'validate_bool', $sync_db)
if $auth_strategy == 'keystone' {
include aodh::keystone::authtoken
}

View File

@ -24,15 +24,12 @@
# or Puppet catalog compilation will fail with duplicate resources.
#
class aodh::config (
$aodh_config = {},
$aodh_api_paste_ini = {},
Hash $aodh_config = {},
Hash $aodh_api_paste_ini = {},
) {
include aodh::deps
validate_legacy(Hash, 'validate_hash', $aodh_config)
validate_legacy(Hash, 'validate_hash', $aodh_api_paste_ini)
create_resources('aodh_config', $aodh_config)
create_resources('aodh_api_paste_ini', $aodh_api_paste_ini)
}

View File

@ -34,7 +34,7 @@
# Defaults to 'utf8_general_ci'
#
class aodh::db::mysql(
$password,
String[1] $password,
$dbname = 'aodh',
$user = 'aodh',
$host = '127.0.0.1',
@ -45,8 +45,6 @@ class aodh::db::mysql(
include aodh::deps
validate_legacy(String, 'validate_string', $password)
openstacklib::db::mysql { 'aodh':
user => $user,
password => $password,

View File

@ -31,8 +31,8 @@
# Defaults to $facts['os_service_default'].
#
class aodh::evaluator (
$manage_service = true,
$enabled = true,
Boolean $manage_service = true,
Boolean $enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
$evaluation_interval = $facts['os_service_default'],
@ -43,9 +43,6 @@ class aodh::evaluator (
include aodh::deps
include aodh::params
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
aodh_config {
'evaluator/evaluation_interval': value => $evaluation_interval;
'DEFAULT/event_alarm_cache_ttl': value => $event_alarm_cache_ttl;

View File

@ -31,21 +31,18 @@
# Defaults to $facts['os_service_default'].
#
class aodh::listener (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
$event_alarm_topic = $facts['os_service_default'],
$batch_size = $facts['os_service_default'],
$batch_timeout = $facts['os_service_default'],
Boolean $manage_service = true,
Boolean $enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
$event_alarm_topic = $facts['os_service_default'],
$batch_size = $facts['os_service_default'],
$batch_timeout = $facts['os_service_default'],
) {
include aodh::deps
include aodh::params
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
aodh_config {
'listener/workers': value => $workers;
'listener/event_alarm_topic': value => $event_alarm_topic;

View File

@ -28,20 +28,17 @@
# Defaults to $facts['os_service_default']
#
class aodh::notifier (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
$batch_size = $facts['os_service_default'],
$batch_timeout = $facts['os_service_default'],
Boolean $manage_service = true,
Boolean $enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
$batch_size = $facts['os_service_default'],
$batch_timeout = $facts['os_service_default'],
) {
include aodh::deps
include aodh::params
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
aodh_config {
'notifier/workers': value => $workers;
'notifier/batch_size': value => $batch_size;

View File

@ -48,7 +48,7 @@
class aodh::policy (
$enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $facts['os_service_default'],
$policies = {},
Hash $policies = {},
$policy_path = '/etc/aodh/policy.yaml',
$policy_default_rule = $facts['os_service_default'],
$policy_dirs = $facts['os_service_default'],
@ -58,8 +58,6 @@ class aodh::policy (
include aodh::deps
include aodh::params
validate_legacy(Hash, 'validate_hash', $policies)
$policy_parameters = {
policies => $policies,
policy_path => $policy_path,