diff options
| author | Daniel Pittman <daniel@rimspace.net> | 2011-02-03 15:36:50 -0800 |
|---|---|---|
| committer | Daniel Pittman <daniel@rimspace.net> | 2011-02-03 15:36:50 -0800 |
| commit | 4ff5769119aefafa33e05449ebcfac78ba0c0fe0 (patch) | |
| tree | b49232a64521a0de647300fa44f75cda70d1f525 /lib/puppet | |
| parent | 0502c557cbe8dc0d039e05ff5940a9e3b7e5c150 (diff) | |
| download | puppet-4ff5769119aefafa33e05449ebcfac78ba0c0fe0.tar.gz puppet-4ff5769119aefafa33e05449ebcfac78ba0c0fe0.tar.xz puppet-4ff5769119aefafa33e05449ebcfac78ba0c0fe0.zip | |
(#5823) run mode can now be set dynamically...
Third party scripts, and complex command line tools, depend on being able to
configure the run_mode value at runtime, not just when they fire up.
For better or worse we used to allow this sort of thing to work, but stopped,
and we have no sane, safe and consensual alternative, so we broke a bunch of
client code.
This enables the feature again, but does not add any safety catch; you can now
happily slice off your own feet with this, if you really want to.
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 |
