Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PUP-11328) Get the environment's name without loading the environment
The previous commit added back the node request as a fallback, but it was calling `Node#environment`, which will try to load the environment from disk. Since the server-assigned environment likely doesn't exist on the agent, the run printed the following warning and continued using "production" Warning: Could not find a directory environment named 'xxx' anywhere in the path ... Does the directory exist? To complicate matters, node termini set the environment on the node differently. The :rest terminus returns a node with an environment_name, but not an instance. The :plain terminus returns a node with an environment instance, but not an environment_name. To avoid breaking things, retrieve the environment name the same way we did before[1]. [1] https://github.com/puppetlabs/puppet/blob/6.24.0/lib/puppet/configurer.rb#L315-L319
- Loading branch information