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
Merge pull request #1101 from david22swan/CONT-773/main/puppet_8
[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 3b46e2d63d696adc243bab33e895bec673b901be..66c6a892867be4b15161f41cc84aad3ea9ca0510 100644
(file)
--- 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)
%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
end
end
end
@@
-36,9
+34,7
@@
Facter.add('apt_has_updates') do
confine osfamily: 'Debian'
setcode do
apt_package_updates = get_updates('upgrade')
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
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')
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
end
end