summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/application.rb8
-rw-r--r--lib/puppet/defaults.rb2
-rw-r--r--lib/puppet/reports/store.rb2
-rw-r--r--lib/puppet/util/settings.rb4
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.