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: I62d32faa75928ecca27a10480ce8823aaa03fafb
This commit is contained in:
Tobias Urdin 2019-02-23 11:49:31 +01:00
parent c537994b03
commit e54dc558d7
4 changed files with 6 additions and 6 deletions

View File

@ -34,8 +34,8 @@ class freezer::config (
include ::freezer::deps
validate_hash($freezer_config)
validate_hash($api_paste_ini_config)
validate_legacy(Hash, 'validate_hash', $freezer_config)
validate_legacy(Hash, 'validate_hash', $api_paste_ini_config)
create_resources('freezer_config', $freezer_config)
create_resources('freezer_api_paste_ini', $api_paste_ini_config)

View File

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

View File

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

View File

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