New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(PUP-1118) List environments from a directory #2296
Merged
jpartlow
merged 10 commits into
puppetlabs:master
from
zaphod42:feature/master/pup-1118-implement-environment-directory
Jan 25, 2014
Merged
(PUP-1118) List environments from a directory #2296
jpartlow
merged 10 commits into
puppetlabs:master
from
zaphod42:feature/master/pup-1118-implement-environment-directory
Jan 25, 2014
Conversation
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
The acceptance test now checks for getting multiple environments listed from the environmentsdir
This starts the process of creating a Puppet::Environments::Directory that will find environments from a particular directory. The directory has sub-directories, where each sub-directory name is the environment name.
This changes the loader used by the code to list environments to be a composition of the legacy environments and the new directory environments.
Puppet::Context can reduce the number of objects that it uses for tracking contexts by keeping everything internal to it. This actually results in much less code, but a few more instance variables to track. Overall is seems like an easier to understand system.
There end up being 3 steps of initialization in puppet: * bootstrap: after code starts loading, but before initialize_settings is called * initial: after initialize_settings is called, but before an application has been loaded and sets up the true run mode * application: after an application has started running, set the run mode, and reinitialized the app default settings. This last one had been missed in previous changes to have puppet setup the right contexts. This now setups another context override in the Puppet::Application run method to control the application context.
The directories that were made for the environment listing tests were not actually readable by the master. This changes them to be readable.
This also creates two new rake tasks for generating the documentation: doc:api and doc:all. The doc:api is to generate the published docs, which omits portions of the code that hasn't been tagged. doc:all just outputs everything.
And adjust TestHelper initialization to preserve base context setup without requiring settings initialization in before_all_tests hook. Initializing settings in the before_all_tests was causing a slowdown somewhere in call_hooks_deferred_to_application_initialization. The issue came from the root environment needing to have the modulepath, which interpolates in the confdir to produce the value. However, after an initial run, the after each hook tears down the settings, which makes them unavailable in the second before all call. This problem had been masked previously because of the way the root environment was cached and not reset between tests.
CLA signed by all contributors. |
If there are multiple root environments ever created, then functions that belong on the root do not get registered correctly. This stops that by making sure that the root is only created during the bootstrap phase.
jpartlow
added a commit
that referenced
this pull request
Jan 25, 2014
…ent-environment-directory (PUP-1118) List environments from a directory
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a Puppet::Environments::Directory that will find
environments from a particular directory. The directory has sub-directories,
where each sub-directory name is the environment name.