Skip to content

Commit

Permalink
(maint) Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jhbuchanan45 committed Oct 10, 2024
1 parent b208aff commit 8db17e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
58 changes: 29 additions & 29 deletions plans/util/retrieve_and_upload.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,39 @@
|-HEREDOC
# lint:endignore

$operating_system = run_task('peadm::os_identification', 'local://localhost')
$os_string =$operating_system.first.value['_output']
$operating_system = run_task('peadm::os_identification', 'local://localhost')
$os_string =$operating_system.first.value['_output']

if 'windows' in $os_string {
$exists = run_command("[System.IO.File]::Exists('${local_path}')", 'local://localhost')
if $exists.first['stdout'].chomp == 'false' {
run_task('peadm::download', 'local://localhost',
source => $source,
path => $local_path,
)
}
if 'windows' in $os_string {
$exists = run_command("[System.IO.File]::Exists('${local_path}')", 'local://localhost')
if $exists.first['stdout'].chomp == 'false' {
run_task('peadm::download', 'local://localhost',
source => $source,
path => $local_path,
)
}

$result_size = run_task('peadm::filesize', 'local://localhost',
path => $local_path,
)
$local_size = $result_size.first.value['_output']
} else {
$exists = without_default_logging() || {
run_command("test -e '${local_path}'", 'local://localhost',
_catch_errors => true,
).ok()
}
unless $exists {
run_task('peadm::download', 'local://localhost',
source => $source,
path => $local_path,
$result_size = run_task('peadm::filesize', 'local://localhost',
path => $local_path,
)
}
$local_size = $result_size.first.value['_output']
} else {
$exists = without_default_logging() || {
run_command("test -e '${local_path}'", 'local://localhost',
_catch_errors => true,
).ok()
}
unless $exists {
run_task('peadm::download', 'local://localhost',
source => $source,
path => $local_path,
)
}

$local_size = run_task('peadm::filesize', 'local://localhost',
path => $local_path,
).first['size']
}
$local_size = run_task('peadm::filesize', 'local://localhost',
path => $local_path,
).first['size']
}

$targets_needing_file = run_task('peadm::filesize', $nodes,
path => $upload_path,
Expand Down
7 changes: 3 additions & 4 deletions tasks/validate_rbac_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def execute!
body = JSON.parse(resp.body)
case resp.code
when '401', '403'
puts "#{resp.code} #{body['kind']}: \nCheck your API token at #{token_file}. " +
"An alternate token file can be specified using the token_file param. \n\n" +
"See https://www.puppet.com/docs/pe/latest/rbac_token_auth_intro for more details. \n"
puts "#{resp.code} #{body['kind']}: \nCheck your API token at #{token_file}. \
An alternate token file can be specified using the token_file param. \n\n\
See https://www.puppet.com/docs/pe/latest/rbac_token_auth_intro for more details. \n"
else
puts "Error validating token: #{resp.code} #{body['kind']}"
puts body['msg']
Expand Down Expand Up @@ -65,7 +65,6 @@ def https_object(uri:)

https
end

end

# Run the task unless an environment flag has been set, signaling not to. The
Expand Down

0 comments on commit 8db17e4

Please sign in to comment.