From 0cfd8f689ce3e45c649b98fd879e9172ee26ae6d Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 23 Feb 2019 23:17:56 +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: Ib31134bb604e32fd274b41dc78c4356500f71ab0 --- manifests/config.pp | 2 +- manifests/db/mysql.pp | 2 +- manifests/keystone/auth.pp | 2 +- manifests/keystone/auth_websocket.pp | 2 +- manifests/policy.pp | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index e2ea758..4f8a07d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -26,7 +26,7 @@ class zaqar::config ( include ::zaqar::deps - validate_hash($zaqar_config) + validate_legacy(Hash, 'validate_hash', $zaqar_config) create_resources('zaqar_config', $zaqar_config) } diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 078d5be..811f27c 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -45,7 +45,7 @@ class zaqar::db::mysql( include ::zaqar::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) ::openstacklib::db::mysql { 'zaqar': user => $user, diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index e2946d8..d6a553f 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -88,7 +88,7 @@ class zaqar::keystone::auth( include ::zaqar::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) keystone::resource::service_identity { 'zaqar': configure_user => $configure_user, diff --git a/manifests/keystone/auth_websocket.pp b/manifests/keystone/auth_websocket.pp index d7cf55f..de2ab77 100644 --- a/manifests/keystone/auth_websocket.pp +++ b/manifests/keystone/auth_websocket.pp @@ -76,7 +76,7 @@ class zaqar::keystone::auth_websocket( include ::zaqar::deps - validate_string($password) + validate_legacy(String, 'validate_string', $password) keystone::resource::service_identity { 'zaqar-websocket': configure_user => $configure_user, diff --git a/manifests/policy.pp b/manifests/policy.pp index 7536d60..6163526 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -31,7 +31,7 @@ class zaqar::policy ( include ::zaqar::deps include ::zaqar::params - validate_hash($policies) + validate_legacy(Hash, 'validate_hash', $policies) Openstacklib::Policy::Base { file_path => $policy_path, @@ -42,5 +42,4 @@ class zaqar::policy ( create_resources('openstacklib::policy::base', $policies) oslo::policy { 'zaqar_config': policy_file => $policy_path } - }