X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Ffacter%2Fapt_updates.rb;h=66c6a892867be4b15161f41cc84aad3ea9ca0510;hb=refs%2Fheads%2Ftrusted-contributors;hp=3b46e2d63d696adc243bab33e895bec673b901be;hpb=a4609826c3dc663c2ebb5402ffe7b8a1ea1ecd4f;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/lib/facter/apt_updates.rb b/lib/facter/apt_updates.rb index 3b46e2d..66c6a89 100644 --- a/lib/facter/apt_updates.rb +++ b/lib/facter/apt_updates.rb @@ -23,9 +23,7 @@ def get_updates(upgrade_option) %r{ gNewSense[^\s]+-security[, ]}, ] re = Regexp.union(security_matches) - if line.match(re) - apt_updates[1].push(package) - end + apt_updates[1].push(package) if line.match(re) end end end @@ -36,9 +34,7 @@ Facter.add('apt_has_updates') do confine osfamily: 'Debian' setcode do apt_package_updates = get_updates('upgrade') - if !apt_package_updates.nil? && apt_package_updates.length == 2 - apt_package_updates != [[], []] - end + apt_package_updates != [[], []] if !apt_package_updates.nil? && apt_package_updates.length == 2 end end @@ -46,9 +42,7 @@ Facter.add('apt_has_dist_updates') do confine osfamily: 'Debian' setcode do apt_dist_updates = get_updates('dist-upgrade') - if !apt_dist_updates.nil? && apt_dist_updates.length == 2 - apt_dist_updates != [[], []] - end + apt_dist_updates != [[], []] if !apt_dist_updates.nil? && apt_dist_updates.length == 2 end end