Skip to content

Commit

Permalink
puppet-lint: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 25, 2020
1 parent 8df6dd1 commit aee0d38
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion functions/bool2num_hash_recursive.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function yum::bool2num_hash_recursive($arg) {
Hash => yum::bool2num_hash_recursive($value),
default => $value,
}
Hash({ $key => $return_value })
Hash( { $key => $return_value })
}.reduce |$attrs_memo, $kv| {
merge($attrs_memo, $kv)
}
Expand Down
4 changes: 1 addition & 3 deletions manifests/clean.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# A $(yum clean all) Exec to be notified if desired.
class yum::clean {

exec{'yum_clean_all':
exec { 'yum_clean_all':
command => '/usr/bin/yum clean all',
refreshonly => true,
}

}
1 change: 0 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
Variant[Boolean, Integer, Enum['absent'], String] $ensure,
String $key = $title,
) {

$_ensure = $ensure ? {
Boolean => bool2num($ensure),
default => $ensure,
Expand Down
1 change: 0 additions & 1 deletion manifests/gpgkey.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
String $group = 'root',
String $mode = '0644'
) {

$_creators = [$content, $source]
$_used_creators = $_creators.filter |$value| { !empty($value) }

Expand Down
1 change: 0 additions & 1 deletion manifests/group.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
Enum['present', 'installed', 'latest', 'absent', 'purged'] $ensure = 'present',
Optional[Integer] $timeout = undef,
) {

Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => 'LC_ALL=C',
Expand Down
9 changes: 4 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
class yum (
Boolean $clean_old_kernels = true,
Boolean $keep_kernel_devel = false,
Hash[String, Variant[String, Integer, Boolean, Hash[String, Variant[String, Integer, Boolean]]]] $config_options = { },
Hash[String, Variant[String, Integer, Boolean, Hash[String, Variant[String, Integer, Boolean]]]] $config_options = {},
Optional[Hash[String, Optional[Hash[String, Variant[String, Integer, Boolean]]]]] $repos = {},
Array[String] $managed_repos = [],
Boolean $manage_os_default_repos = false,
Expand All @@ -105,7 +105,6 @@
Hash[String, Hash[String, String]] $gpgkeys = {},
String $utils_package_name = 'yum-utils',
) {

$module_metadata = load_module_metadata($module_name)
$supported_operatingsystems = $module_metadata['operatingsystem_support']
$supported_os_names = $supported_operatingsystems.map |$os| {
Expand Down Expand Up @@ -162,16 +161,16 @@
}

$_normalized_ensure = $_ensure ? {
Boolean => Hash({ ensure => bool2num($_ensure) }), # lint:ignore:unquoted_string_in_selector
default => Hash({ ensure => $_ensure }), # lint:ignore:unquoted_string_in_selector
Boolean => Hash( { ensure => bool2num($_ensure) }), # lint:ignore:unquoted_string_in_selector
default => Hash( { ensure => $_ensure }), # lint:ignore:unquoted_string_in_selector
}

$_normalized_attrs = $attrs ? {
Hash => merge($attrs, $_normalized_ensure),
default => $_normalized_ensure,
}

Hash({ $key => $_normalized_attrs })
Hash( { $key => $_normalized_attrs })
}.reduce |$memo, $cfg_opt_hash| {
merge($memo, $cfg_opt_hash)
}
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
Enum['present', 'installed', 'absent', 'purged'] $ensure = 'present',
Optional[Integer] $timeout = undef,
) {

Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => 'LC_ALL=C',
Expand Down
1 change: 0 additions & 1 deletion manifests/plugin/versionlock.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
String $path = '/etc/yum/pluginconf.d/versionlock.list',
Boolean $clean = false,
) {

yum::plugin { 'versionlock':
ensure => $ensure,
}
Expand Down
4 changes: 0 additions & 4 deletions manifests/versionlock.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@
}

if $facts['package_provider'] == 'yum' and $version =~ Undef {

assert_type(Yum::VersionlockString, $name) |$_expected, $actual | {
fail("Package name must be formatted as %{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not \'${actual}\'. See Yum::Versionlock documentation for details.")
}

$_versionlock = "${line_prefix}${name}"

} else {

assert_type(Yum::RpmName, $name) |$_expected, $actual | {
fail("Package name must be formatted as Yum::RpmName, not \'${actual}\'. See Yum::Rpmname documentation for details.")
}
Expand All @@ -89,7 +86,6 @@
'yum' => "${line_prefix}${epoch}:${name}-${version}-${release}.${arch}",
default => "${line_prefix}${name}-${epoch}:${version}-${release}.${arch}",
}

}

unless $ensure == 'absent' {
Expand Down

0 comments on commit aee0d38

Please sign in to comment.