summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 16:58:48 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 16:58:48 +0000
commit17c59f8d83145c728bca3636dfa7c42f66967169 (patch)
treee02bb0645a9542697c0e5adb5a35a3a691d81c2f
parentebc4dd231e4970e9d3ccbbe57d0df9f38cf4c1aa (diff)
downloadpuppet-17c59f8d83145c728bca3636dfa7c42f66967169.tar.gz
puppet-17c59f8d83145c728bca3636dfa7c42f66967169.tar.xz
puppet-17c59f8d83145c728bca3636dfa7c42f66967169.zip
Adding "ignorecache" option to always force a recompile of the configuration
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2245 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xbin/puppetd3
-rw-r--r--lib/puppet/network/client/master.rb11
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