From ecb873d3a6d2eabc931457bd8f4c185c990976db Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 13 Mar 2008 12:36:21 -0500 Subject: Fixing #1118 -- downloading plugins and facts now ignores noop. Note that this changes the behaviour a bit -- the resource's noop setting always beats the global setting (previously, whichever was true would win). --- lib/puppet/metatype/evaluation.rb | 6 +++++- lib/puppet/network/client/master.rb | 14 ++------------ lib/puppet/type.rb | 2 -- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/metatype/evaluation.rb b/lib/puppet/metatype/evaluation.rb index 08756e988..36328c537 100644 --- a/lib/puppet/metatype/evaluation.rb +++ b/lib/puppet/metatype/evaluation.rb @@ -108,7 +108,11 @@ class Puppet::Type # Are we running in noop mode? def noop? - @noop || Puppet[:noop] + if defined?(@noop) + @noop + else + Puppet[:noop] + end end def noop diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 913c51b3d..e914d5c69 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -320,7 +320,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client :group => Process.gid, :purge => true, :force => true, - :backup => false + :backup => false, + :noop => false } if args[:ignore] @@ -331,9 +332,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client Puppet.info "Retrieving #{args[:name]}s" - noop = Puppet[:noop] - Puppet[:noop] = false - files = [] begin Timeout::timeout(self.timeout) do @@ -355,14 +353,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client downconfig.clear return files - ensure - # I can't imagine why this is necessary, but apparently at last one person has had problems with noop - # being nil here. - if noop.nil? - Puppet[:noop] = false - else - Puppet[:noop] = noop - end end # Retrieve facts from the central server. diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 09003e8f5..f8949ec90 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -155,8 +155,6 @@ class Type @parameters = {} end - # set defalts - @noop = false # keeping stats for the total number of changes, and how many were # completely sync'ed # this isn't really sufficient either, because it adds lots of special -- cgit