(PUP-9794) prevent autoload superclass errors #7590
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With these commits, 'package_targetable.rb' requires 'puppet/provider/package'
avoiding errors when the gem package provider is the first provider to
be autoloaded, which varies depending on the inode order of files in
'puppet/provider/package' and which one 'Dir.entries' happens to returns first.
The 'package_provider' fact in puppetlabs-stdlib triggers this error when it
requires the 'puppet/type/package' outside the body of 'setcode'.
In between the time that 'puppet/type.rb' is required and when when providers
are loaded 'Puppet::Provider::Package' refers to the wrong object. An explicit
'require puppet/provider/package' overwrites an earlier 'Puppet::Provider::Package'
constant, resulting from a mixin of Puppet::Util and Puppet::Provider.