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: I511f23ac6af3b46bb6f0afc68b41fa1715ba9146
This commit is contained in:
parent
a0fccec778
commit
12dc2654e8
|
@ -26,7 +26,7 @@ class gnocchi::config (
|
|||
|
||||
include ::gnocchi::deps
|
||||
|
||||
validate_hash($gnocchi_config)
|
||||
validate_legacy(Hash, 'validate_hash', $gnocchi_config)
|
||||
|
||||
create_resources('gnocchi_config', $gnocchi_config)
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ class gnocchi::db (
|
|||
# to use gnocchi::<myparam> if gnocchi::db::<myparam> isn't specified.
|
||||
$database_connection_real = pick($::gnocchi::database_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+)?'])
|
||||
|
||||
if $database_connection_real {
|
||||
case $database_connection_real {
|
||||
|
|
|
@ -45,7 +45,7 @@ class gnocchi::db::mysql(
|
|||
|
||||
include ::gnocchi::deps
|
||||
|
||||
validate_string($password)
|
||||
validate_legacy(String, 'validate_string', $password)
|
||||
|
||||
::openstacklib::db::mysql { 'gnocchi':
|
||||
user => $user,
|
||||
|
|
|
@ -31,7 +31,7 @@ class gnocchi::policy (
|
|||
include ::gnocchi::deps
|
||||
include ::gnocchi::params
|
||||
|
||||
validate_hash($policies)
|
||||
validate_legacy(Hash, 'validate_hash', $policies)
|
||||
|
||||
Openstacklib::Policy::Base {
|
||||
file_path => $policy_path,
|
||||
|
|
Loading…
Reference in New Issue