From 5bc7e0a115cea9176d9ac239bb8f9f54e9f8ae8f Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 23 Feb 2019 12:00:05 +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: I41d8fc86b439914098a87b4ae6da6c8c672a399d --- 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 64ba372..b5a6451 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -30,8 +30,8 @@ class glare::config ( include ::glare::deps - validate_hash($glare_config) - validate_hash($glare_paste_ini_config) + validate_legacy(Hash, 'validate_hash', $glare_config) + validate_legacy(Hash, 'validate_hash', $glare_paste_ini_config) create_resources('glare_config', $glare_config) create_resources('glare_paste_ini', $glare_paste_ini_config) diff --git a/manifests/db.pp b/manifests/db.pp index 143a5f5..d644afd 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -56,8 +56,8 @@ class glare::db ( include ::glare::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 { 'glare_config': connection => $database_connection, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index bddad7e..f21a1a2 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -45,7 +45,7 @@ class glare::db::mysql( include ::glare::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) ::openstacklib::db::mysql { 'glare': user => $user, diff --git a/manifests/policy.pp b/manifests/policy.pp index 1e7948e..e3c780d 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -31,7 +31,7 @@ class glare::policy ( include ::glare::deps include ::glare::params - validate_hash($policies) + validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { file_path => $policy_path,