replace validate_legacy with proper data types

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

Change-Id: Icdd88de21e43fc645303a96fe36995d8652fcb6d
This commit is contained in:
Takashi Kajinami 2023-06-20 22:23:40 +09:00
parent 7a287673f0
commit 33a84b2602
5 changed files with 10 additions and 25 deletions

View File

@ -71,15 +71,15 @@
#
class magnum::api(
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$service_name = $::magnum::params::api_service,
$port = '9511',
$host = '127.0.0.1',
$max_limit = '1000',
$sync_db = true,
Boolean $sync_db = true,
$auth_strategy = 'keystone',
$enabled_ssl = false,
Boolean $enabled_ssl = false,
$ssl_cert_file = $facts['os_service_default'],
$ssl_key_file = $facts['os_service_default'],
$workers = $facts['os_workers'],
@ -90,11 +90,6 @@ class magnum::api(
include magnum::params
include magnum::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', $enabled_ssl)
if $enabled_ssl {
if is_service_default($ssl_cert_file) {
fail('The ssl_cert_file parameter is required when enabled_ssl is true')

View File

@ -30,8 +30,8 @@
# Defaults to $facts['os_workers']
#
class magnum::conductor(
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$package_ensure = 'present',
$conductor_life_check_timeout = $facts['os_service_default'],
$auth_strategy = 'keystone',
@ -42,9 +42,6 @@ class magnum::conductor(
include magnum::deps
include magnum::params
validate_legacy(Boolean, 'validate_bool', $manage_service)
validate_legacy(Boolean, 'validate_bool', $enabled)
# Install package
package { 'magnum-conductor':
ensure => $package_ensure,

View File

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

View File

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

View File

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