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: If25820ad85e763246d90954a80db86763ed9e9c5
This commit is contained in:
Tobias Urdin 2019-02-23 22:59:32 +01:00
parent e66ca58657
commit 916bbb41e7
4 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class tacker::config (
include ::tacker::deps include ::tacker::deps
validate_hash($tacker_config) validate_legacy(Hash, 'validate_hash', $tacker_config)
create_resources('tacker_config', $tacker_config) create_resources('tacker_config', $tacker_config)
} }

View File

@ -56,8 +56,8 @@ class tacker::db (
include ::tacker::deps include ::tacker::deps
validate_re($database_connection, validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection,
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?') ['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'tacker_config': oslo::db { 'tacker_config':
db_max_retries => $database_db_max_retries, db_max_retries => $database_db_max_retries,

View File

@ -45,7 +45,7 @@ class tacker::db::mysql(
include ::tacker::deps include ::tacker::deps
validate_string($password) validate_legacy(String, 'validate_string', $password)
::openstacklib::db::mysql { 'tacker': ::openstacklib::db::mysql { 'tacker':
user => $user, user => $user,

View File

@ -31,7 +31,7 @@ class tacker::policy (
include ::tacker::deps include ::tacker::deps
include ::tacker::params include ::tacker::params
validate_hash($policies) validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base { Openstacklib::Policy::Base {
file_path => $policy_path, file_path => $policy_path,