Issue #15353 has been updated by Andrew Parker.

Status changed from Investigating to Accepted


----------------------------------------
Bug #15353: Single fact and full facter run can produce different results for 
the same fact.
https://projects.puppetlabs.com/issues/15353#change-79254

Author: Matthaus Owens
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Keywords: 
Branch: 
Affected Facter version: 


The way that facter loads a single fact vs all facts causes discrepancies if 
the same fact is defined twice (it's possible defining a fact twice should be 
considered an error). In this simple example, there are two facts in 
lib/facter, bar.rb and foo.rb.

The single fact looks for $factname.rb in the facter path and returns the first 
it finds, while the facter run will load all facts in a sorted order, and load 
the first fact in that sort.

bar.rb
<pre>
Facter.add('foo') do
  setcode do
    "foo bar"
  end
end
</pre>

foo.rb
<pre>
Facter.add('foo') do
  setcode do
    "bar foo"
  end
end
</pre>

<pre>
root@deb6-64:~# facter foo
bar foo
root@deb6-64:~# facter -p | grep foo
foo => foo bar
</pre>


-- 
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