Issue #20893 has been updated by Arnoud de Jonge.
Facter::Util::Resolution.exec returns nil when the script returns nothing.
if out == ""
return nil
else
return out
end
ScriptParser.results then does a each_line() on this nil. Which causes the
error.
----------------------------------------
Bug #20893: Empty output from facts.d scripts crashes facter
https://projects.puppetlabs.com/issues/20893#change-94517
* Author: Paul Tötterman
* Status: Investigating
* Priority: Normal
* Assignee: Arnoud de Jonge
* Category:
* Target version:
* Keywords:
* Branch:
* Affected Facter version: 1.7.1
----------------------------------------
Reproduce by placing a script that doesn't output anything to
/etc/facter/facts.d:
cd /etc/facter/facts.d && echo "#!/bin/sh" > bad.sh && chmod +x bad.sh
After this facter will crash with:
Error: undefined method `each_line' for nil:NilClass
The facts.d support from stdlib did not crash on empty output.
Also incorrect output keeps facter from crashing:
#!/bin/sh
echo invalid output
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.