Issue #5440 has been updated by James Turnbull.

Status changed from Unreviewed to Needs design decision


----------------------------------------
Refactor #5440: should failing facts change the return code of facter?
https://projects.puppetlabs.com/issues/5440

Author: Garrett Honeycutt
Status: Needs design decision
Priority: Normal
Assignee: Paul Nasrat
Category: 
Target version: 
Branch: 


Given my poorly written fact that does not check if the file exists, it will 
fail when /etc/role is not present. Should facter return a non zero exit code 
upon these problems?
<pre>
require 'facter'
Facter.add("role") do
    setcode do
           %x{cat /etc/role}.chomp
             end
end
</pre>

There is the case when you run facter with a given fact
<pre>
# facter role
cat: /etc/role: No such file or directory
cat: /etc/role: No such file or directory
# echo $?
0
</pre>

and when you run facter without arguments
<pre>
# facter
cat: /etc/role: No such file or directory
cat: /etc/role: No such file or directory
architecture => i386
domain => puppetlabs.com
 ...
virtual => vmware
# echo $?
0
</pre>

In both cases a failure is noted, so I urge that facter return a non zero exit 
code.


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to