replace validate_legacy with proper data types

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

Change-Id: I5fa76ea9c27c51d98f07274c071563251f5c0e4e
This commit is contained in:
Takashi Kajinami 2023-06-20 22:30:11 +09:00
parent 854d79fddb
commit d8efb69c3d
5 changed files with 16 additions and 24 deletions

View File

@ -21,12 +21,10 @@
# or Puppet catalog compilation will fail with duplicate resources.
#
class watcher::config (
$watcher_config = {},
Hash $watcher_config = {},
) {
include watcher::deps
validate_legacy(Hash, 'validate_hash', $watcher_config)
create_resources('watcher_config', $watcher_config)
}

View File

@ -69,21 +69,19 @@
#
class watcher::cron::db_purge (
Enum['present', 'absent'] $ensure = 'present',
$minute = 1,
$hour = 0,
$monthday = '*',
$month = '*',
$weekday = '*',
$user = $::watcher::params::user,
$age = 30,
$destination = '/var/log/watcher/watcher-rowsflush.log',
$maxdelay = 0,
$exclude_orphans = false,
$max_number = undef,
$minute = 1,
$hour = 0,
$monthday = '*',
$month = '*',
$weekday = '*',
$user = $::watcher::params::user,
$age = 30,
$destination = '/var/log/watcher/watcher-rowsflush.log',
$maxdelay = 0,
Boolean $exclude_orphans = false,
$max_number = undef,
) inherits watcher::params {
validate_legacy(Boolean, 'validate_bool', $exclude_orphans)
include watcher::deps
$sleep = $maxdelay ? {

View File

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

View File

@ -53,8 +53,8 @@
#
class watcher::decision_engine (
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$decision_engine_conductor_topic = $facts['os_service_default'],
$decision_engine_status_topic = $facts['os_service_default'],
$decision_engine_notification_topics = $facts['os_service_default'],

View File

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