summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-02-03 15:42:10 -0800
committerDaniel Pittman <daniel@rimspace.net>2011-02-03 15:42:10 -0800
commit7a061409bd0490e5a9ef11a68260deb4f6e3b7ab (patch)
tree645f2222a1d0b7c6c5dd4701e23dbc7f4c92bfb3 /lib
parent81876a6afd75686ac7abde7cd9e519ef6de79d35 (diff)
parent4ff5769119aefafa33e05449ebcfac78ba0c0fe0 (diff)
downloadpuppet-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')
-rw-r--r--lib/puppet/application.rb9
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