If a fact is stored in a file that does not follow the 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.
(#14332) Correct stubbing on Ubuntu
The tests for facter fail on Ubuntu because lsbdistid is not correctly stubbed. This patch fixes that small mistake by stubbing lsbdistid for all Linux tests, except where the test is really about testing for Ubuntu.
Facter 1.6.9 Changelog =================== Jeff Weiss (2): 14eee2b (#12864) Windows: get primary DNS from registry 753f3a4 Revert "(#12864) Windows: get primary DNS from registry"
Joachim de Groot (1): b398bd8 (#14334) Fix dmidecode based facts on DragonFly BSD
Ken Barber (1): 6c46b2c (#14332) Correct stubbing on Ubuntu
Matthaus Litteken (1): ceefaf1 Update lib/facter.rb, CHANGELOG, facter.spec for 1.6.9rc1