Merge pull request #323 from cmurphy/master
[puppet-modules/puppetlabs-apt.git] / lib / facter / apt_updates.rb
1 Facter.add("apt_updates") do
2   confine :osfamily => 'Debian'
3   setcode do
4     if File.executable?("/usr/lib/update-notifier/apt-check")
5       updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
6       Integer(updates.strip.split(';')[0])
7     end
8   end
9 end