Feature #14448
kafo_parsers should support selecting available providers with soft deps
Description
kafo_parsers should provide a method to recommend a parser based on those providers that are available in the local environment. The current parser only loads on Puppet 3 when available in the same Ruby environment, while #7848 adds a new puppet-strings parser which will only load with that module installed.
For Kafo itself to select a provider, the hard dependency on the puppet gem in the current parser should be removed and the providers should be able to indicate if they are available/ready.
Related issues
Associated revisions
refs #14448 - handle logger being missing
refs #14448 - use kafo_parsers .find_available to load parser
By using the parser cache, the parser is now optional and will raise an
error at runtime if the cache misses and no parser is available. Tests
still require the Puppet 3.x parser to test validations etc.
History
#1
Updated by Dominic Cleal about 6 years ago
- Blocks Tracker #8447: Puppet 4 support added
#2
Updated by Dominic Cleal about 6 years ago
- Description updated (diff)
#3
Updated by Dominic Cleal about 6 years ago
- Related to Feature #7848: YARD / Puppet Strings support added
#4
Updated by Dominic Cleal about 6 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
#5
Updated by The Foreman Bot about 6 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/kafo_parsers/pull/14 added
#6
Updated by The Foreman Bot about 6 years ago
- Pull request https://github.com/theforeman/kafo/pull/138 added
#7
Updated by Dominic Cleal about 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset kafo_parsers|fbfbeadaf8dd6c1a1dcf2f16b5d9e54cc165f1ae.
#8
Updated by The Foreman Bot about 6 years ago
- Pull request https://github.com/theforeman/kafo_parsers/pull/18 added
fixes #14448 - change Puppet to a soft dep, add helper to find parser
Each parser's `.available?` method now tries to load any dependencies
and indicates if the parser is usable. An exception may be thrown with
more details.
`KafoParsers::Parsers.find_available` finds the first parser that's
available, which should be the preferred way of using kafo_parsers.