puppetlabs/puppet — pull request #2873 by hlindberg (2014-07-15 14:17:16+00:00)
Title: (PUP-2757) Change Puppet::Resource default env to avoid duplicate

parsing.

When a Resource is used as a reference, it still needs to find its type
and will try to find it via known_resource_types in the environment.
Hence, if Puppet::Resource#environment produces the special environment
NONE when the resource is not contained in a catalog (as no references
by definition are) then, the NONE environment will need to be populated
and this triggers a duplicate initial_import).

This commit changes the default environment for a resource to be:

* the environment attribute if set
* the environment of the catalog it is contained in
* the current_environment if set
* the special environment NONE if the other two were not set

This also changes the '*root*' boot context to specify the manifest
to be NO_MANIFEST. This because the defaults otherwise may lead to
loading the entire source tree of puppet when running tests.