Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Addressing Rubocop Errors
[puppet-modules/puppetlabs-apt.git]
/
manifests
/
key.pp
diff --git
a/manifests/key.pp
b/manifests/key.pp
index a8c9f54950a368463c8bcd95f8d4ca6880519763..1933b3f9110b996e666208132e06188d1dc8c5a6 100644
(file)
--- a/
manifests/key.pp
+++ b/
manifests/key.pp
@@
-8,14
+8,19
@@
define apt::key (
Optional[String] $options = undef,
) {
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 {
if $source {
-
validate_re($source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+']
)
+
assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source
)
}
if $server {
}
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 {
}
case $ensure {
@@
-38,11
+43,13
@@
define apt::key (
'Debian': {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
ensure_packages(['dirmngr'])
'Debian': {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
ensure_packages(['dirmngr'])
+ Apt::Key<| title == $title |>
}
}
'Ubuntu': {
if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
ensure_packages(['dirmngr'])
}
}
'Ubuntu': {
if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
ensure_packages(['dirmngr'])
+ Apt::Key<| title == $title |>
}
}
default: { }
}
}
default: { }