diff options
author | Matt Robinson <matt@puppetlabs.com> | 2010-06-30 12:43:23 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-01 13:48:03 -0700 |
commit | 2a2588392a2eead4265afcb93ff7bc16b5fc1ef1 (patch) | |
tree | 128c7039ced805af716cd49c25690634de5243ad /lib/puppet | |
parent | 75e0662168936da8255507a10bccad8889326947 (diff) | |
download | puppet-2a2588392a2eead4265afcb93ff7bc16b5fc1ef1.tar.gz puppet-2a2588392a2eead4265afcb93ff7bc16b5fc1ef1.tar.xz puppet-2a2588392a2eead4265afcb93ff7bc16b5fc1ef1.zip |
[#4090] Git rid of the idea that run_mode is a configurable option with defaults
Along the way this fixes an issue with 2.6 alpha that sections of the
puppet config file were getting ignored.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/application.rb | 8 | ||||
-rw-r--r-- | lib/puppet/defaults.rb | 2 | ||||
-rw-r--r-- | lib/puppet/reports/store.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/settings.rb | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index f74b37573..c49f42fd7 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -221,10 +221,14 @@ class Application find(name).new end + # Sets or gets the run_mode name. Sets the run_mode name if a mode_name is + # passed. Otherwise, gets the run_mode or a default run_mode + # def run_mode( mode_name = nil) - @run_mode ||= mode_name || @run_mode || :user + return @run_mode if @run_mode and not mode_name + require 'puppet/util/run_mode' - Puppet::Util::RunMode.new( @run_mode ) + @run_mode = Puppet::Util::RunMode.new( mode_name || :user ) end end diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index bfc18d8aa..ac82975eb 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -6,8 +6,6 @@ module Puppet it defaults to being in ``~``."], :vardir => [Puppet.run_mode.var_dir, "Where Puppet stores dynamic and growing data. The default for this parameter is calculated specially, like `confdir`_."], :name => [Puppet.application_name.to_s, "The name of the application, if we are running as one. The - default is essentially $0 without the path or ``.rb``."], - :run_mode => [Puppet.run_mode.name.to_s, "The name of the application, if we are running as one. The default is essentially $0 without the path or ``.rb``."] ) diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb index a74527566..a71cd3387 100644 --- a/lib/puppet/reports/store.rb +++ b/lib/puppet/reports/store.rb @@ -1,8 +1,6 @@ require 'puppet' Puppet::Reports.register_report(:store) do - Puppet.settings.use(:reporting) - desc "Store the yaml report on disk. Each host sends its report as a YAML dump and this just stores the file on disk, in the ``reportdir`` directory. diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index 398fa482c..3e2020c55 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -284,9 +284,9 @@ class Puppet::Util::Settings end end - # Figure out the section name for the mode. + # Figure out the section name for the run_mode. def run_mode - convert(@config[:run_mode].default).intern if @config[:run_mode] + Puppet.run_mode.name end # Return all of the parameters associated with a given section. |