Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
(maint) Update ke_compat_spec to run under STRICT_VARIABLES
[puppet-modules/puppetlabs-apt.git]
/
lib
/
facter
/
apt_updates.rb
diff --git
a/lib/facter/apt_updates.rb
b/lib/facter/apt_updates.rb
index 75670bc39767280c0d8fbd2ddfa7121ded3ffe30..014782eab2edaa33c5f29f79bac19d81a901d7da 100644
(file)
--- a/
lib/facter/apt_updates.rb
+++ b/
lib/facter/apt_updates.rb
@@
-2,11
+2,16
@@
apt_package_updates = nil
Facter.add("apt_has_updates") do
confine :osfamily => 'Debian'
if File.executable?("/usr/lib/update-notifier/apt-check")
Facter.add("apt_has_updates") do
confine :osfamily => 'Debian'
if File.executable?("/usr/lib/update-notifier/apt-check")
- apt_package_updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1').split(';')
+ apt_check_result = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
+ if not apt_check_result.nil? and apt_check_result =~ /^\d+;\d+$/
+ apt_package_updates = apt_check_result.split(';')
+ end
end
setcode do
end
setcode do
- apt_package_updates != ['0', '0'] unless apt_package_updates.nil?
+ if not apt_package_updates.nil? and apt_package_updates.length == 2
+ apt_package_updates != ['0', '0']
+ end
end
end
end
end