replace validate_legacy with proper data types

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

Change-Id: If29a88bdb31e26a6e95cca854385ae0960a5e05f
This commit is contained in:
Benedikt Trefzer 2023-06-02 22:10:41 +02:00
parent 95399aeca0
commit f6ba76c00b
6 changed files with 10 additions and 24 deletions

View File

@ -33,21 +33,17 @@
# Defaults to $facts['os_service_default'].
#
class placement::api (
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$api_service_name = $::placement::params::service_name,
$package_ensure = 'present',
$sync_db = false,
Boolean $sync_db = false,
$enable_proxy_headers_parsing = $facts['os_service_default'],
) inherits placement::params {
include placement::deps
include placement::policy
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
validate_legacy(Boolean, 'validate_bool', $sync_db)
if $manage_service {
if $api_service_name == 'httpd' {
# The following logic is currently required only in Debian, because

View File

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

View File

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

View File

@ -33,17 +33,14 @@
define placement::generic_service(
$package_name,
$service_name,
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$ensure_package = 'present'
) {
include placement::deps
include placement::params
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
$placement_title = "placement-${name}"
# I need to mark that ths package should be

View File

@ -28,7 +28,7 @@
#
class placement(
$ensure_package = 'present',
$sync_db = true,
Boolean $sync_db = true,
$state_path = $facts['os_service_default'],
$randomize_allocation_candidates = $facts['os_service_default'],
$allocation_conflict_retry_count = $facts['os_service_default'],
@ -36,8 +36,6 @@ class placement(
include placement::deps
validate_legacy(Boolean, 'validate_bool', $sync_db)
if $sync_db {
include placement::db::sync
}

View File

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