diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-05-31 13:14:18 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-05-31 15:35:40 -0700 |
commit | 2255abee7bdb9b6478ca228546e3d275dbac0ec3 (patch) | |
tree | d09703a3753b6541f1b0267d817c4eecdf7a75a1 /lib/facter/path.rb | |
parent | 59173268a5c6525a4a5df55b362775d07bc6b52d (diff) | |
download | facter-2255abee7bdb9b6478ca228546e3d275dbac0ec3.tar.gz facter-2255abee7bdb9b6478ca228546e3d275dbac0ec3.tar.xz facter-2255abee7bdb9b6478ca228546e3d275dbac0ec3.zip |
(#7670) Never fail to find a fact that is present
With the previous behavior, any fact which depended on another fact in a file
not matching its name would fail to properly load the required fact, resulting
in missing, incorrect, or inconsistent values.
For instance, the operatingsystem fact depends on the lsbdistid fact found in
lsb.rb. The first time the operatingsystem fact is requested, it requires
lsb.rb, and so the required fact is loaded first. But if Facter is subsequently
cleared and the operatingsystem fact requested again, the require will not
occur, and the fact will not be automatically loaded because it doesn't match
its filename.
Now if a fact is requested and can't be found, we will attempt to load all the
facts to find it. Such an approach appears heavy-handed, but in the case where
we want a particular fact, this is the only way to make sure we've found it. In
the case where we eventually want other facts, we are conveniently eagerly
loading them.
Paired-With: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'lib/facter/path.rb')
0 files changed, 0 insertions, 0 deletions