Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Duplicate
-
PUP 4.3.2
-
None
-
None
-
None
-
Agent
Description
Running:
puppet facts --environment=test
|
throws the following error if the environment directory don't exists:
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'test' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
|
But if you remove /etc/puppetlabs/code/environments/production it still works for production because in puppet.rb a basic default environment is only created if the environment is named production:
# in case the configured environment (used for the default sometimes) |
# doesn't exist
|
default_environment = Puppet[:environment].to_sym
|
if default_environment == :production |
loaders << Puppet::Environments::StaticPrivate.new( |
Puppet::Node::Environment.create(default_environment,
|
basemodulepath,
|
Puppet::Node::Environment::NO_MANIFEST))
|
end
|
I'm no expert on the puppet code, so I could miss something, but in my opinion a basic default environment should be created in every case.
Attachments
Issue Links
- duplicates
-
PUP-6739 Error running puppet with non-existent and non-default environment
-
- Closed
-