puppetlabs/puppet — pull request #2905 by jpartlow (2014-07-23 23:17:09+00:00)
Title: (PUP-2757) Check for env change before updating Configurer context

Previous work on PUP-2757 ensured that resource references would use the
current environment and that agent runs would use a correctly
initialized 'remote' reference environment, but, ironically, Charlie
Sharpsteen found that the fixes for agent runs re-introduced the
duplication of initial environment import in the Puppet apply case.
Removing that duplication of effort was the reason for the initial
change.

This commit tests whether the environment has changed, which it should
only do in the agent case, and, if not, pushes the original env onto the
context stack. We push regardless, so that we don't have to guard the
corresponding pop.