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
This commit is contained in:
parent
96e5483986
commit
5bc7e0a115
|
@ -30,8 +30,8 @@ class glare::config (
|
||||||
|
|
||||||
include ::glare::deps
|
include ::glare::deps
|
||||||
|
|
||||||
validate_hash($glare_config)
|
validate_legacy(Hash, 'validate_hash', $glare_config)
|
||||||
validate_hash($glare_paste_ini_config)
|
validate_legacy(Hash, 'validate_hash', $glare_paste_ini_config)
|
||||||
|
|
||||||
create_resources('glare_config', $glare_config)
|
create_resources('glare_config', $glare_config)
|
||||||
create_resources('glare_paste_ini', $glare_paste_ini_config)
|
create_resources('glare_paste_ini', $glare_paste_ini_config)
|
||||||
|
|
|
@ -56,8 +56,8 @@ class glare::db (
|
||||||
|
|
||||||
include ::glare::deps
|
include ::glare::deps
|
||||||
|
|
||||||
validate_re($database_connection,
|
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection,
|
||||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
|
||||||
|
|
||||||
oslo::db { 'glare_config':
|
oslo::db { 'glare_config':
|
||||||
connection => $database_connection,
|
connection => $database_connection,
|
||||||
|
|
|
@ -45,7 +45,7 @@ class glare::db::mysql(
|
||||||
|
|
||||||
include ::glare::deps
|
include ::glare::deps
|
||||||
|
|
||||||
validate_string($password)
|
validate_legacy(String, 'validate_string', $password)
|
||||||
|
|
||||||
::openstacklib::db::mysql { 'glare':
|
::openstacklib::db::mysql { 'glare':
|
||||||
user => $user,
|
user => $user,
|
||||||
|
|
|
@ -31,7 +31,7 @@ class glare::policy (
|
||||||
include ::glare::deps
|
include ::glare::deps
|
||||||
include ::glare::params
|
include ::glare::params
|
||||||
|
|
||||||
validate_hash($policies)
|
validate_legacy(Hash, 'validate_hash', $policies)
|
||||||
|
|
||||||
Openstacklib::Policy::Base {
|
Openstacklib::Policy::Base {
|
||||||
file_path => $policy_path,
|
file_path => $policy_path,
|
||||||
|
|
Loading…
Reference in New Issue