Use validate_legacy
This changes all the puppet 3 validate_* functions to use the validate_legacy function. The validate_legacy function has been available since about three years but require Puppet >= 4.4.0 and since there is Puppet 4.10.12 as latest we should assume people are running a fairly new Puppet 4 version. This is the first step to then remove all validate function calls and use proper types for parameter as described in spec [1]. [1] https://review.openstack.org/#/c/568929/ Change-Id: I639f87c524ea7f565a8cc6ddaf331afa284b9e22
This commit is contained in:
parent
b7d5ee6c78
commit
b1a827b340
@ -225,7 +225,7 @@ class ironic::conductor (
|
||||
fail('rescuing_network_name and rescuing_network can not be specified in the same time.')
|
||||
}
|
||||
|
||||
validate_array($enabled_hardware_types)
|
||||
validate_legacy(Array, 'validate_array', $enabled_hardware_types)
|
||||
|
||||
# NOTE(dtantsur): all in-tree drivers are IPA-based, so it won't hurt
|
||||
# including its manifest (which only contains configuration options)
|
||||
@ -243,7 +243,8 @@ class ironic::conductor (
|
||||
}
|
||||
|
||||
if $cleaning_disk_erase {
|
||||
validate_re($cleaning_disk_erase, ['^full$', '^metadata$', '^none$'])
|
||||
validate_legacy(Enum['full', 'metadata', 'none'], 'validate_re', $cleaning_disk_erase,
|
||||
[['^full$', '^metadata$', '^none$']])
|
||||
}
|
||||
|
||||
case $cleaning_disk_erase {
|
||||
|
@ -29,8 +29,9 @@ class ironic::config (
|
||||
) {
|
||||
|
||||
include ::ironic::deps
|
||||
validate_hash($ironic_config)
|
||||
validate_hash($ironic_api_paste_ini)
|
||||
|
||||
validate_legacy(Hash, 'validate_hash', $ironic_config)
|
||||
validate_legacy(Hash, 'validate_hash', $ironic_api_paste_ini)
|
||||
|
||||
create_resources('ironic_config', $ironic_config)
|
||||
create_resources('ironic_api_paste_ini', $ironic_api_paste_ini)
|
||||
|
@ -66,8 +66,8 @@ class ironic::db (
|
||||
$database_max_pool_size_real = pick($::ironic::database_max_pool_size, $database_max_pool_size)
|
||||
$database_max_overflow_real = pick($::ironic::database_max_overflow, $database_max_overflow)
|
||||
|
||||
validate_re($database_connection_real,
|
||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
|
||||
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
|
||||
|
||||
oslo::db { 'ironic_config':
|
||||
connection => $database_connection_real,
|
||||
|
@ -38,7 +38,7 @@ define ironic::drivers::hardware_interface (
|
||||
include ::ironic::deps
|
||||
|
||||
if !is_service_default($enabled_list) and !empty($enabled_list){
|
||||
validate_array($enabled_list)
|
||||
validate_legacy(Array, 'validate_array', $enabled_list)
|
||||
$enabled_list_real = join($enabled_list, ',')
|
||||
} else {
|
||||
$enabled_list_real = $::os_service_default
|
||||
|
@ -58,8 +58,8 @@ class ironic::inspector::db (
|
||||
|
||||
$database_connection_real = pick($::ironic::inspector::db_connection, $database_connection)
|
||||
|
||||
validate_re($database_connection_real,
|
||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
|
||||
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
|
||||
|
||||
oslo::db { 'ironic_inspector_config':
|
||||
connection => $database_connection_real,
|
||||
|
@ -31,7 +31,7 @@ class ironic::policy (
|
||||
include ::ironic::deps
|
||||
include ::ironic::params
|
||||
|
||||
validate_hash($policies)
|
||||
validate_legacy(Hash, 'validate_hash', $policies)
|
||||
|
||||
Openstacklib::Policy::Base {
|
||||
file_path => $policy_path,
|
||||
|
Loading…
Reference in New Issue
Block a user