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
This commit is contained in:
Tobias Urdin 2019-02-23 12:17:58 +01:00
parent d1703e6a76
commit df41997ef7
1 changed files with 5 additions and 4 deletions

View File

@ -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' =>