puppetlabs/puppet — pull request #571 by cprice-puppet (2012-03-09 21:58:15+00:00)
Title: (#7749) bootstrapping puppet: FOR REVIEW ONLY

PLEASE DO NOT MERGE THIS PULL REQUEST...

it is intended for review only.

I have at least a few more commits that I'd like to make before this goes in, and I'll probably just do a new pull request at that point, but wouldn't mind getting some feedback on this before then.

There are three commits here, and it might be worth reviewing them individually:

1. basically changes the order in which the settings.rb/defaults.rb files get processed to a point earlier in the life cycle of an application, so that the life cycle is more predictable and settings are accessible earlier in the lifecycle. This is just a prerequisite for being able to accomplish more useful things in the command_line / application classes.
2. non-interesting commit ; just brings in a third-party command-line option parser to give us more control over that
3. moves the initial parsing of command line arguments and the puppet.conf file to an earlier spot in the life cycle; it happens in command_line now, instead of in application.rb. The main goal here is to allow the libdir to be resolved before we look for a list of available applications; but, more generally, this ensures that all puppet-wide settings are resolved and available by the time any individual application begins to initialize itself.

Additional forthcoming changes include:

* cleanup of these commits
* documentation
* bring in some of the changes from Nick Lewis' branch
* get rid of references to Puppet.application_name and Puppet.run_mode in defaults.rb
* introduce "application default settings" to provide values for the stuff removed from defaults.rb
* get rid of "set_run_mode" method in application.rb
* get rid of run_mode-related global variables
* address the other few places where Daniel has commented about this set of issues, which should hopefully be resolved by all of the above.