Remove stderr from stdout
Sometimes there are lib errors on platforms with malformed packages. This shouldn't cause the facts to completely fail.
This commit is contained in:
parent
43b894b12e
commit
97556124da
3 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ Facter.add("apt_package_updates") do
|
||||||
confine :osfamily => 'Debian'
|
confine :osfamily => 'Debian'
|
||||||
setcode do
|
setcode do
|
||||||
if File.executable?("/usr/lib/update-notifier/apt-check")
|
if File.executable?("/usr/lib/update-notifier/apt-check")
|
||||||
packages = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check -p 2>&1')
|
packages = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check -p 2>/dev/null')
|
||||||
packages = packages.split("\n")
|
packages = packages.split("\n")
|
||||||
if Facter.version < '2.0.0'
|
if Facter.version < '2.0.0'
|
||||||
packages = packages.join(',')
|
packages = packages.join(',')
|
||||||
|
|
|
@ -2,7 +2,7 @@ Facter.add("apt_security_updates") do
|
||||||
confine :osfamily => 'Debian'
|
confine :osfamily => 'Debian'
|
||||||
setcode do
|
setcode do
|
||||||
if File.executable?("/usr/lib/update-notifier/apt-check")
|
if File.executable?("/usr/lib/update-notifier/apt-check")
|
||||||
updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
|
updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>/dev/null')
|
||||||
Integer(updates.strip.split(';')[1])
|
Integer(updates.strip.split(';')[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ Facter.add("apt_updates") do
|
||||||
confine :osfamily => 'Debian'
|
confine :osfamily => 'Debian'
|
||||||
setcode do
|
setcode do
|
||||||
if File.executable?("/usr/lib/update-notifier/apt-check")
|
if File.executable?("/usr/lib/update-notifier/apt-check")
|
||||||
updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
|
updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>/dev/null')
|
||||||
Integer(updates.strip.split(';')[0])
|
Integer(updates.strip.split(';')[0])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue