summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application.rb
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-02-03 19:14:23 -0800
committerJacob Helwig <jacob@puppetlabs.com>2011-02-03 19:14:23 -0800
commitec4254dec20c8cc8ab9ef3065f4325ed52b9eacd (patch)
tree1d847e457af83163dadd933632ab3af1eeedbddd /lib/puppet/application.rb
parent876d0503dd93329a73e7f335c10a47330d745293 (diff)
parente10ba1ab720cb62b39b430104a55a987f4c37f31 (diff)
Merge branch '2.6.next' into 2.6.x
* 2.6.next: (#6018) Nick F's --help text for puppet inspect. (#5823) document the not-an-API status of set_run_mode (#5823) run mode can now be set dynamically... (6114) Update the audit metaparameter for 2.6.5. Fix for #5755 -- making zaml serialization robust over projected objects (#4139) hook log autoflush into global defaults
Diffstat (limited to 'lib/puppet/application.rb')
-rw-r--r--lib/puppet/application.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index 17ad69cee..c3d7355f6 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -264,9 +264,21 @@ 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
+
+ # WARNING: This is a totally scary, frightening, and nasty internal API. We
+ # strongly advise that you do not use this, and if you insist, we will
+ # politely allow you to keep both pieces of your broken code.
+ #
+ # We plan to provide a supported, long-term API to deliver this in a way
+ # that you can use. Please make sure that you let us know if you do require
+ # this, and this message is still present in the code. --daniel 2011-02-03
+ def set_run_mode(mode)
+ @run_mode = mode
$puppet_application_mode = @run_mode
$puppet_application_name = name
@@ -281,8 +293,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