Skip to content

(#18187) Clear *root* environment when clearing caches#1455

Closed
domcleal wants to merge 1 commit intopuppetlabs:masterfrom
domcleal:tickets/master/18187-root-env-cache
Closed

(#18187) Clear *root* environment when clearing caches#1455
domcleal wants to merge 1 commit intopuppetlabs:masterfrom
domcleal:tickets/master/18187-root-env-cache

Conversation

@domcleal
Copy link
Contributor

@domcleal domcleal commented Feb 6, 2013

When changing settings or initializing Puppet via TestHelper, the
Puppet::Node::Environment.clear method is called to delete the cached
environment objects, as they may reference cached module paths based on old
values of settings.

The root environment is a special case, as it acts as the current environment
when no other environment has been created and set yet. It can still have a
module path based on current settings, so it too should be cleared along with
other cached environments.

This was an issue in 2.7.x in particular, where root would be used usually.
In later versions, app_defaults_initialized? prevents root from being used
too early.

When changing settings or initializing Puppet via TestHelper, the
Puppet::Node::Environment.clear method is called to delete the cached
environment objects, as they may reference cached module paths based on old
values of settings.

The *root* environment is a special case, as it acts as the current environment
when no other environment has been created and set yet.  It can still have a
module path based on current settings, so it too should be cleared along with
other cached environments.

This was an issue in 2.7.x in particular, where *root* would be used usually.
In later versions, app_defaults_initialized? prevents *root* from being used
too early.
@domcleal
Copy link
Contributor Author

domcleal commented Feb 6, 2013

Replaces GH-1339, targeted at master instead (though most useful in 2.7.x).

@adrienthebo
Copy link
Contributor

Thanks very much for submitting this pull request! I actually rebased this pull request myself since we decided to retarget at 3.1.x. It's been merged as 7bd6a90 and should be released in 3.1.1.

Pardon the confusion on this; I didn't update the tickets in a timely manner before acting. Thanks again!

@adrienthebo adrienthebo closed this Feb 6, 2013
@adrienthebo
Copy link
Contributor

In addition, this has been merged up from 3.1.x into master as ab440d9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants