diff options
-rwxr-xr-x | bin/puppetd | 3 | ||||
-rw-r--r-- | lib/puppet/network/client/master.rb | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/bin/puppetd b/bin/puppetd index afb30b55b..e46f01d40 100755 --- a/bin/puppetd +++ b/bin/puppetd @@ -119,7 +119,7 @@ # # test:: # Enable the most common options used for testing. These are +onetime+, -# +verbose+, and +no-usecacheonfailure+. +# +verbose+, +ignorecache, and +no-usecacheonfailure+. # # verbose:: # Turn on verbose reporting. @@ -212,6 +212,7 @@ begin options[:enable] = true when "--test" # Enable all of the most common test options. + Puppet.config.handlearg("--ignorecache") Puppet.config.handlearg("--no-usecacheonfailure") options[:onetime] = true unless Puppet::Util::Log.level == :debug diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 08a37d9b6..ebeddd281 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -18,6 +18,12 @@ class Puppet::Network::Client::MasterClient < Puppet::Network::Client new configurations, where you want to fix the broken configuration rather than reverting to a known-good one." ], + :ignorecache => [false, + "Ignore cache and always recompile the configuration. This is + useful for testing new configurations, where the local cache may in + fact be stale even if the timestamps are up to date - if the facts + change or if the server changes." + ], :downcasefacts => [false, "Whether facts should be made all lowercase when sent to the server."] ) @@ -196,9 +202,8 @@ class Puppet::Network::Client::MasterClient < Puppet::Network::Client # Check whether our configuration is up to date def fresh? - unless self.compile_time - return false - end + return false if Puppet[:ignorecache] + return false unless self.compile_time # We're willing to give a 2 second drift if @driver.freshness - @compile_time.to_i < 1 |