From df41997ef7d79d4656ca1064a6d2f582ab7d60a2 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sat, 23 Feb 2019 12:17:58 +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: I841fb0c66a891cc936a117ac2d2fd0b82a60fbd1 --- manifests/init.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index f1763f35..feea7d85 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -607,10 +607,11 @@ class horizon( $keystone_options_real = merge($keystone_defaults, $keystone_options) $neutron_options_real = merge($neutron_defaults,$neutron_options) $instance_options_real = merge($instance_defaults,$instance_options) - validate_hash($api_versions) - validate_re($password_autocomplete, ['^on$', '^off$']) - validate_re($images_panel, ['^legacy$', '^angular$']) - validate_absolute_path($root_path) + + validate_legacy(Hash, 'validate_hash', $api_versions) + validate_legacy(Enum['on', 'off'], 'validate_re', $password_autocomplete, [['^on$', '^off$']]) + validate_legacy(Enum['legacy', 'angular'], 'validate_re', $images_panel, [['^legacy$', '^angular$']]) + validate_legacy(Stdlib::Absolutepath, 'validate_absolute_path', $root_path) if $manage_memcache_package and $cache_backend =~ /MemcachedCache/ { ensure_resources('package', { 'python-memcache' =>