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. # or Puppet catalog compilation will fail with duplicate resources.
# #
class watcher::config ( class watcher::config (
$watcher_config = {}, Hash $watcher_config = {},
) { ) {
include watcher::deps include watcher::deps
validate_legacy(Hash, 'validate_hash', $watcher_config)
create_resources('watcher_config', $watcher_config) create_resources('watcher_config', $watcher_config)
} }

View File

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

View File

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

View File

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

View File

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