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: I70b9cafad10ec5abfc0166feb01c49adbd1f517d
This commit is contained in:
parent
5d0b6b51c4
commit
6bdeca8d21
@ -40,7 +40,9 @@ define openstacklib::db::mysql::host_access (
|
||||
$create_grant = true,
|
||||
$tls_options = ['NONE'],
|
||||
) {
|
||||
validate_re($title, '_', 'Title must be $dbname_$host')
|
||||
|
||||
validate_legacy(Pattern[/_/], 'validate_re', $title,
|
||||
['_', 'Title must be $dbname_$host'])
|
||||
|
||||
$host = inline_template('<%= @title.split("_").last.downcase %>')
|
||||
|
||||
|
@ -12,8 +12,7 @@ class openstacklib::policy (
|
||||
$policies = {},
|
||||
) {
|
||||
|
||||
validate_hash($policies)
|
||||
validate_legacy(Hash, 'validate_hash', $policies)
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class openstacklib::policyrcd(
|
||||
$services
|
||||
) {
|
||||
|
||||
validate_array($services)
|
||||
validate_legacy(Array, 'validate_array', $services)
|
||||
|
||||
if $::osfamily == 'Debian' {
|
||||
# We put this out there so openstack services wont auto start
|
||||
|
Loading…
x
Reference in New Issue
Block a user