From ef6070bb90f01f6a83fafd983d53f8cd10c87beb Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 10 Feb 2019 13:42:17 +0100 Subject: [PATCH] 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: I740270de4abe95be5223db4dbb9ce2ecbe93a7c0 --- manifests/config.pp | 4 ++-- manifests/db.pp | 4 ++-- manifests/db/mysql.pp | 2 +- manifests/policy.pp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 732b5557..c145ecc8 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -33,8 +33,8 @@ class barbican::config ( include ::barbican::deps - validate_hash($api_config) - validate_hash($api_paste_ini_config) + validate_legacy(Hash, 'validate_hash', $api_config) + validate_legacy(Hash, 'validate_hash', $api_paste_ini_config) create_resources('barbican_config', $api_config) create_resources('barbican_api_paste_ini', $api_paste_ini_config) diff --git a/manifests/db.pp b/manifests/db.pp index 8febe246..72a413c1 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -67,8 +67,8 @@ class barbican::db ( include ::barbican::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 { 'barbican_config': connection => $database_connection, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 25e7780d..26e22562 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -45,7 +45,7 @@ class barbican::db::mysql( include ::barbican::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) ::openstacklib::db::mysql { 'barbican': user => $user, diff --git a/manifests/policy.pp b/manifests/policy.pp index b88ad2ed..41412ceb 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -31,7 +31,7 @@ class barbican::policy ( include ::barbican::deps include ::barbican::params - validate_hash($policies) + validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { file_path => $policy_path,