]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge remote-tracking branch 'upstream/master' into 1.7.x-merge
authorMorgan Haskel <morgan@puppetlabs.com>
Mon, 27 Oct 2014 13:57:46 +0000 (09:57 -0400)
committerMorgan Haskel <morgan@puppetlabs.com>
Mon, 27 Oct 2014 13:57:46 +0000 (09:57 -0400)
Conflicts:
lib/facter/apt_package_updates.rb
lib/facter/apt_security_updates.rb
lib/facter/apt_updates.rb

1  2 
lib/facter/apt_updates.rb

index 15d9473d6e63716cfd9048775bc8ca82a6857bdb,75670bc39767280c0d8fbd2ddfa7121ded3ffe30..77e667e6d76c18f8f2eed5adc3b2dad187035c32
@@@ -1,9 -1,23 +1,23 @@@
- Facter.add("apt_updates") do
+ apt_package_updates = nil
+ Facter.add("apt_has_updates") do
    confine :osfamily => 'Debian'
 -    apt_package_updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1').split(';')
+   if File.executable?("/usr/lib/update-notifier/apt-check")
++    apt_package_updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>/dev/null').split(';')
+   end
+   setcode do
+     apt_package_updates != ['0', '0'] unless apt_package_updates.nil?
+   end
+ end
+ Facter.add("apt_package_updates") do
+   confine :apt_has_updates => true
    setcode do
-     if File.executable?("/usr/lib/update-notifier/apt-check")
-       updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>/dev/null')
-       Integer(updates.strip.split(';')[0])
 -    packages = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check -p 2>&1').split("\n")
++    packages = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check -p 2>/dev/null').split("\n")
+     if Facter.version < '2.0.0'
+       packages.join(',')
+     else
+       packages
      end
    end
  end