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: Id6ac95b468f7e1f4affed50a2a694216cd72a6c5
This commit is contained in:
Tobias Urdin 2019-02-10 13:48:07 +01:00
parent e0069da972
commit e94c1072af
2 changed files with 3 additions and 2 deletions

View File

@ -240,7 +240,8 @@ class ceph::profile::params (
$fs_name = undef,
$rbd_default_features = undef,
) {
validate_hash($client_keys)
validate_legacy(Hash, 'validate_hash', $client_keys)
if $authentication_type == 'cephx' and empty($client_keys) {
fail("client_keys must be provided when using authentication_type = 'cephx'")

View File

@ -28,7 +28,7 @@ describe 'ceph::profile::params' do
}"
end
it { should raise_error Puppet::Error, /is not a Hash/ }
it { should raise_error(Puppet::Error) }
end
describe "should fail when using cephx without client_keys" do