facterdb
facterdb copied to clipboard
Provide filter_results to refine a search
rspec-puppet-facts has a pattern where it does a lot of small searches for every OS. By doing a single complex FacterDB.get_facts call to get the only supported operating systems and then further refining that result it can use the cache provided by FacterDB.get_facts.
This is quite hacky now because it duplicates internals from JGrep to avoid serializing to JSON and parsing that again. The conversions to symbols and back to strings is also inefficient.
https://github.com/voxpupuli/rspec-puppet-facts/pull/158 was the inspiration for this.
Rebased, but not further tested.