Update CODEOWNERS
[puppet-modules/puppetlabs-apt.git] / lib / facter / apt_updates.rb
index 3b46e2d63d696adc243bab33e895bec673b901be..66c6a892867be4b15161f41cc84aad3ea9ca0510 100644 (file)
@@ -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