X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fkey.pp;h=1933b3f9110b996e666208132e06188d1dc8c5a6;hb=280b3a9ee4f9233026b0806bf12da378f0d95ce5;hp=50f70dd1f5ccc091b6974fbb8c9bb21da70dbd1c;hpb=3d2c888a793d9828d924d9bc087db555041762c8;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/key.pp b/manifests/key.pp index 50f70dd..1933b3f 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -8,14 +8,19 @@ define apt::key ( Optional[String] $options = undef, ) { - validate_re($id, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z']) + assert_type( + Pattern[ + /\A(0x)?[0-9a-fA-F]{8}\Z/, + /\A(0x)?[0-9a-fA-F]{16}\Z/, + /\A(0x)?[0-9a-fA-F]{40}\Z/, + ], $id) if $source { - validate_re($source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+']) + assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source) } if $server { - validate_re($server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$']) + assert_type(Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/], $server) } case $ensure {