Skip to content

Commit

Permalink
strict_indent/unquoted_string_in_case
Browse files Browse the repository at this point in the history
  • Loading branch information
david22swan committed Aug 18, 2022
1 parent f9fbef8 commit 6fbb2ef
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 37 deletions.
2 changes: 0 additions & 2 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
--no-relative_classname_inclusion-check
--no-parameter_documentation-check
--no-anchor_resource-check
--no-strict_indent-check
--no-unquoted_string_in_case-check
2 changes: 0 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ Rakefile:
- relative_classname_inclusion
- parameter_documentation
- anchor_resource
- strict_indent
- unquoted_string_in_case
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ PuppetLint.configuration.send('disable_topscope_variable')
PuppetLint.configuration.send('disable_relative_classname_inclusion')
PuppetLint.configuration.send('disable_parameter_documentation')
PuppetLint.configuration.send('disable_anchor_resource')
PuppetLint.configuration.send('disable_strict_indent')
PuppetLint.configuration.send('disable_unquoted_string_in_case')

if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
Expand Down
14 changes: 9 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,21 @@
$_item = merge($apt::proxy_defaults, $item)
$_scheme = $_item['https'] ? {
true => 'https',
default => 'http' }
default => 'http',
}
$_port = $_item['port'] ? {
Integer => ":${_item['port']}",
default => ''
}
$_target = $_item['direct'] ? {
true => 'DIRECT',
default => "${_scheme}://${_item['host']}${_port}/" }
default => "${_scheme}://${_item['host']}${_port}/",
}
merge($item, {
'scheme' => $_scheme,
'target' => $_target })
'scheme' => $_scheme,
'target' => $_target,
}
)
}
} else {
$_perhost = {}
Expand Down Expand Up @@ -260,7 +264,7 @@
true => "# Repos managed by puppet.\n",
default => undef,
}
}
}

$preferences_ensure = $_purge['preferences'] ? {
true => absent,
Expand Down
4 changes: 2 additions & 2 deletions manifests/key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$/] $server = $::apt::keyserver,
Boolean $weak_ssl = false,
Optional[String] $options = $::apt::key_options,
) {
) {
case $ensure {
/^(refreshed|present)$/: {
if defined(Anchor["apt_key ${id} absent"]) {
Expand Down Expand Up @@ -82,7 +82,7 @@
}
}

absent: {
/absent/: {
if defined(Anchor["apt_key ${id} present"]) {
fail("key with id ${id} already ensured as present")
}
Expand Down
8 changes: 4 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@

case $facts['os']['name'] {
'Debian': {
$backports = {
'location' => 'http://deb.debian.org/debian',
'repos' => 'main contrib non-free',
}
$backports = {
'location' => 'http://deb.debian.org/debian',
'repos' => 'main contrib non-free',
}
$ppa_options = undef
$ppa_package = undef
$auth_conf_owner = '_apt'
Expand Down
2 changes: 1 addition & 1 deletion manifests/pin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

if $packages_string != '*' { # specific form
if ( $pin_release != '' and ( $origin or $version )) or
( $version and ( $pin_release != '' or $origin )) {
( $version and ( $pin_release != '' or $origin )) {
fail('parameters release, origin, and version are mutually exclusive')
}
} else { # general form
Expand Down
11 changes: 6 additions & 5 deletions manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$sources_list_d_filename = "${dash_filename_no_specialchars}-${release}.list"

if versioncmp($facts['os']['release']['full'], '15.10') >= 0 and
versioncmp($facts['os']['release']['full'], '21.04') < 0 {
versioncmp($facts['os']['release']['full'], '21.04') < 0 {
$trusted_gpg_d_filename = "${underscore_filename_no_specialchars}.gpg"
} else {
$trusted_gpg_d_filename = "${dash_filename_no_specialchars}.gpg"
Expand Down Expand Up @@ -91,10 +91,11 @@

unless $sources_list_d_filename in $facts['apt_sources'] {
$script_content = epp('apt/add-apt-repository.sh.epp', {
command => ['/usr/bin/add-apt-repository', shell_join($options), $name],
sources_list_d_path => $::apt::sources_list_d,
sources_list_d_filename => $sources_list_d_filename,
})
command => ['/usr/bin/add-apt-repository', shell_join($options), $name],
sources_list_d_path => $::apt::sources_list_d,
sources_list_d_filename => $sources_list_d_filename,
}
)

file { "add-apt-repository-script-${name}":
ensure => 'file',
Expand Down
29 changes: 15 additions & 14 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,21 @@
}

$sourcelist = epp('apt/source.list.epp', {
'comment' => $comment,
'includes' => $includes,
'options' => delete_undef_values( {
'arch' => $architecture,
'trusted' => $allow_unsigned ? { true => 'yes', false => undef },
'allow-insecure' => $allow_insecure ? { true => 'yes', false => undef },
'signed-by' => $keyring,
'check-valid-until' => $check_valid_until? { true => undef, false => 'false' },
},
),
'location' => $_location,
'release' => $_release,
'repos' => $repos,
})
'comment' => $comment,
'includes' => $includes,
'options' => delete_undef_values( {
'arch' => $architecture,
'trusted' => $allow_unsigned ? { true => 'yes', false => undef },
'allow-insecure' => $allow_insecure ? { true => 'yes', false => undef },
'signed-by' => $keyring,
'check-valid-until' => $check_valid_until? { true => undef, false => 'false' },
},
),
'location' => $_location,
'release' => $_release,
'repos' => $repos,
}
)

apt::setting { "list-${name}":
ensure => $ensure,
Expand Down

0 comments on commit 6fbb2ef

Please sign in to comment.