diff options
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/type.rb | 4 | ||||
-rw-r--r-- | lib/puppet/util/settings.rb | 21 |
2 files changed, 10 insertions, 15 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 880711066..c3855a400 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -723,6 +723,10 @@ class Type # Are we running in noop mode? def noop? + # If we're not a host_config, we're almost certainly part of + # Settings, and we want to ignore 'noop' + return false if catalog and ! catalog.host_config? + if defined?(@noop) @noop else diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index cbb12a816..ca4ecda35 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -157,13 +157,6 @@ class Puppet::Util::Settings set_value(str, value, :cli) end - def without_noop - old_noop = value(:noop,:cli) and set_value(:noop, false, :cli) if valid?(:noop) - yield - ensure - set_value(:noop, old_noop, :cli) if valid?(:noop) - end - def include?(name) name = name.intern if name.is_a? String @config.include?(name) @@ -635,14 +628,12 @@ if @config.include?(:run_mode) return end - without_noop do - catalog.host_config = false - catalog.apply do |transaction| - if transaction.any_failed? - report = transaction.report - failures = report.logs.find_all { |log| log.level == :err } - raise "Got #{failures.length} failure(s) while initializing: #{failures.collect { |l| l.to_s }.join("; ")}" - end + catalog.host_config = false + catalog.apply do |transaction| + if transaction.any_failed? + report = transaction.report + failures = report.logs.find_all { |log| log.level == :err } + raise "Got #{failures.length} failure(s) while initializing: #{failures.collect { |l| l.to_s }.join("; ")}" end end |