When run as a non-root user, facter would always spew "/dev/mem: Permission denied" because it called dmidecode without redirecting stderr. This was filed upstream as FACT-86¹. It's unclear what is insufficient about this method, but failing tests that are not visible aren't as much of a concern to me as clearly useless output on every run of the command. ¹ https://tickets.puppetlabs.com/browse/FACT-86epel9
parent
e6aaf2ad61
commit
938d3cb881
@ -0,0 +1,12 @@
|
||||
diff -up facter-1.7.4/lib/facter/virtual.rb.dmidecode-drop-stderr facter-1.7.4/lib/facter/virtual.rb
|
||||
--- facter-1.7.4/lib/facter/virtual.rb.dmidecode-drop-stderr 2013-12-17 15:23:22.000000000 -0500
|
||||
+++ facter-1.7.4/lib/facter/virtual.rb 2014-01-28 18:28:27.604949053 -0500
|
||||
@@ -133,7 +133,7 @@ Facter.add("virtual") do
|
||||
end
|
||||
|
||||
# Parse dmidecode
|
||||
- output = Facter::Util::Resolution.exec('dmidecode')
|
||||
+ output = Facter::Util::Resolution.exec('dmidecode 2>/dev/null')
|
||||
if output
|
||||
lines = output.split("\n")
|
||||
next "parallels" if lines.any? {|l| l =~ /Parallels/ }
|
Loading…
Reference in new issue