facterdb icon indicating copy to clipboard operation
facterdb copied to clipboard

Provide filter_results to refine a search

Open ekohl opened this issue 1 year ago • 1 comments

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.

ekohl avatar Jul 21 '23 10:07 ekohl

Rebased, but not further tested.

ekohl avatar Jun 17 '24 10:06 ekohl