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: I6a42a790a327334616f9af706a15494838e92523
This commit is contained in:
Tobias Urdin 2019-02-23 22:47:27 +01:00
parent efbeaaab25
commit 4a4c572af8
4 changed files with 6 additions and 6 deletions

View File

@ -30,8 +30,8 @@ class sahara::config (
include ::sahara::deps
validate_hash($sahara_config)
validate_hash($sahara_api_paste_ini)
validate_legacy(Hash, 'validate_hash', $sahara_config)
validate_legacy(Hash, 'validate_hash', $sahara_api_paste_ini)
create_resources('sahara_config', $sahara_config)
create_resources('sahara_api_paste_ini', $sahara_api_paste_ini)

View File

@ -66,8 +66,8 @@ class sahara::db (
$database_retry_interval_real = pick($::sahara::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::sahara::database_max_overflow, $database_max_overflow)
validate_re($database_connection_real,
'^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
['^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'sahara_config':
db_max_retries => $database_db_max_retries,

View File

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

View File

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