From 614d13d9699737eac60fb630f14ed60510be2d85 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 10 Feb 2019 14:01:07 +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: Ic534a8249e3defc5f33a34580eaba8f478c4755a --- 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 3c459ff..25f6623 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -30,8 +30,8 @@ class congress::config ( include ::congress::deps - validate_hash($congress_config) - validate_hash($congress_api_paste_ini) + validate_legacy(Hash, 'validate_hash', $congress_config) + validate_legacy(Hash, 'validate_hash', $congress_api_paste_ini) create_resources('congress_config', $congress_config) create_resources('congress_api_paste_ini', $congress_api_paste_ini) diff --git a/manifests/db.pp b/manifests/db.pp index e364505..26de847 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -56,8 +56,8 @@ class congress::db ( include ::congress::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 { 'congress_config': connection => $database_connection, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 4202333..1041a81 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -45,7 +45,7 @@ class congress::db::mysql( include ::congress::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) ::openstacklib::db::mysql { 'congress': user => $user, diff --git a/manifests/policy.pp b/manifests/policy.pp index 3ebb4ac..d429a9f 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -31,7 +31,7 @@ class congress::policy ( include ::congress::deps include ::congress::params - validate_hash($policies) + validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { file_path => $policy_path,