forked from puppetlabs/puppet-editor-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(puppetlabsGH-121) Use the Puppet 4 loaders to load Puppet 3 functions
Previously functions were loaded with the autoloader classes however in the new Puppet 4 API we use the environment loaders. In particular we use the discover method to discover all of the available "things", in this case functions, within the environment. `current_env.loaders.private_environment_loader.discover(:function)` * Note this commit only loads the Puppet 3 API functions using the Puppet 4 loaders, thus there are no test changes. Later commits will load Puppet 4 functions * Note we use the private loader, not the public one, because we want all of the available things, not just the ones that are publicly exposed. We still need intellisense on private objects. * Note that we monkey patch the ruby_legacy_function_instantiator (Puppet 3 API functions) and ruby_function_instantiator (Puppet 4 API functions) as in default Puppet any errors would terminate all function discovery. Instead we trap and log the error and move on. * Due to PUP-9509 we need to monkey patch the cached loader to also load Puppet 3 API functions. Previously these were missing * The Sidecar then uses the appropriate method to enumerate the available functions based on the presence or absence of the feature flag.
- Loading branch information
1 parent
49b6a1b
commit 48e597e
Showing
3 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters