puppetlabs/puppet — pull request #2646 by jpartlow (2014-05-14 00:39:15+00:00)
Title: Issue/master/pup 2519 settings create environment dir

@zaphod42 @hlindberg I got Andy's original creation of default directory environment, and was able to whittle down the case for a fallback env when env does not exist to just the default production case (when directory env could not be created). I have puppet throwing an error if you run in master or user mode and request a non-existent directory environment. So just about everything relies on puppet/application setting a proper current_environment.

I'm concerned that I may be overlooking some case of puppet running not as an app, but perhaps being called as a library, without a sane current environment being set.

Anyway please look this over and see if it seems reasonable or crazy or some mix thereof.

One thing I didn't get too...currently we make a fallback env if the env is production, would be better if we only did that if the env was production and this setting came from the default settings (was not set by user). Should be doable but I ran out of time today.