diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-02-03 15:42:10 -0800 |
|---|---|---|
| committer | Daniel Pittman <daniel@rimspace.net> | 2011-02-03 15:42:10 -0800 |
| commit | 7a061409bd0490e5a9ef11a68260deb4f6e3b7ab (patch) | |
| tree | 645f2222a1d0b7c6c5dd4701e23dbc7f4c92bfb3 /lib/puppet | |
| parent | 81876a6afd75686ac7abde7cd9e519ef6de79d35 (diff) | |
| parent | 4ff5769119aefafa33e05449ebcfac78ba0c0fe0 (diff) | |
| download | puppet-7a061409bd0490e5a9ef11a68260deb4f6e3b7ab.tar.gz puppet-7a061409bd0490e5a9ef11a68260deb4f6e3b7ab.tar.xz puppet-7a061409bd0490e5a9ef11a68260deb4f6e3b7ab.zip | |
Merge branch 'bug/2.6.next/5823-allow-run-mode-to-cut-your-hand-off' into 2.6.next
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/application.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 17ad69cee..b944a554e 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -264,9 +264,14 @@ class Application def initialize(command_line = nil) require 'puppet/util/command_line' @command_line = command_line || Puppet::Util::CommandLine.new - @run_mode = self.class.run_mode + set_run_mode self.class.run_mode @options = {} + require 'puppet' + end + + def set_run_mode(mode) + @run_mode = mode $puppet_application_mode = @run_mode $puppet_application_name = name @@ -281,8 +286,6 @@ class Application Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults) Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults) end - - require 'puppet' end # This is the main application entry point |
