From 6795430c5ad4c10cfbd68bc2f601d010a301e27e Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 23 Feb 2019 12:40:40 +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: Ie623d7ae68a0ad58ed8a60e06abc906ebdfac0c4 --- manifests/config.pp | 2 +- manifests/db.pp | 4 ++-- manifests/db/mysql.pp | 2 +- manifests/keystone/auth.pp | 2 +- manifests/policy.pp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 61ee139..b99af02 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -26,7 +26,7 @@ class mistral::config ( include ::mistral::deps - validate_hash($mistral_config) + validate_legacy(Hash, 'validate_hash', $mistral_config) create_resources('mistral_config', $mistral_config) } diff --git a/manifests/db.pp b/manifests/db.pp index f584ca3..7aac4a2 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -66,8 +66,8 @@ class mistral::db ( $database_retry_interval_real = pick($::mistral::database_retry_interval,$database_retry_interval) $database_max_overflow_real = pick($::mistral::database_max_overflow,$database_max_overflow) - validate_re($database_connection_real, - '^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?') + validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real, + ['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?']) oslo::db { 'mistral_config': connection => $database_connection_real, diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index b0995b6..e826c25 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -45,7 +45,7 @@ class mistral::db::mysql( include ::mistral::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) ::openstacklib::db::mysql { 'mistral': user => $user, diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 727ef97..6e05af9 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -83,7 +83,7 @@ class mistral::keystone::auth( include ::mistral::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) keystone::resource::service_identity { 'mistral': configure_user => $configure_user, diff --git a/manifests/policy.pp b/manifests/policy.pp index 701e36f..3ddddc7 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -31,7 +31,7 @@ class mistral::policy ( include ::mistral::deps include ::mistral::params - validate_hash($policies) + validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { file_path => $policy_path,