puppetlabs/facter — pull request #176 by stschulte (2012-02-23 22:25:26+00:00)
Title: Split lsb facts due to nasty recursion problem

If a fact is stored in a file that does not follow the filename convention
`$factname.rb` we may encounter ordering and recursion issues as seen in
bugreport #11511. The concrete example was

- flush clears all facts
- load_all is triggered to reload facts
- inside an .rb file we query the operatingsystem fact directly
(say outside a Facter.add block)
- the operatingsystem fact has a suitable resolver for linux which
wants to query the lsbdistid fact, which is (apperently) not yet
loaded (this might not even be predictable)
- the loader doesnt find a lsbdistid.rb file so it triggers load_all
(remember: we are still trying to get a value for operatingsystem)
- the load_all does load other files (like processor.rb) that want to
query the architecture fact directly (outside a Facter.add block)
- the architecture fact is dependent on the operatingsystem fact, we are
currently trying to resolve -> boom: recursion

This commit implements one possible fix: Split the lsb facts into
differnet files so the loader finds them. We therefore dont have to run
load_all in the middle of a fact resolution.