Skip to content

Commit

Permalink
rubocop: fix Style/SafeNavigation and Style/GlobalStdStream
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Feb 11, 2022
1 parent 0ee7a9d commit a770b2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/facter/yum_updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

if File.executable?('/usr/bin/yum')
yum_get_result = Facter::Util::Resolution.exec('/usr/bin/yum --assumeyes --quiet --cacheonly list updates')
unless yum_get_result.nil?
yum_get_result.each_line do |line|
%r{\A(?<package>\S+\.\S+)\s+(?<available_version>[[:digit:]]\S+)\s+(?<repository>\S+)\s*\z} =~ line
yum_updates.push(package) if package && available_version && repository
end
yum_get_result&.each_line do |line|
%r{\A(?<package>\S+\.\S+)\s+(?<available_version>[[:digit:]]\S+)\s+(?<repository>\S+)\s*\z} =~ line
yum_updates.push(package) if package && available_version && repository
end
end

Expand Down
2 changes: 1 addition & 1 deletion tasks/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_list_updates(output)
{ status: result }
end

params = JSON.parse(STDIN.read)
params = JSON.parse($stdin.read)
action = params['action']
quiet = params['quiet']

Expand Down

0 comments on commit a770b2b

Please sign in to comment.