This method name clashed with Puppet::Indirector::Envelope#expired?, and its name wasn't actually very appropriate.
The new method name is 'dependent_data_expired?'. Signed-off-by: Luke Kanies <[email protected]> --- lib/puppet/indirector/indirection.rb | 1 + lib/puppet/resource/catalog.rb | 2 +- lib/puppet/util/cacher.rb | 4 ++-- spec/unit/resource/catalog.rb | 4 ++-- spec/unit/util/cacher.rb | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index 2a54ecc..0623446 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -190,6 +190,7 @@ class Puppet::Indirector::Indirection return result end rescue => detail + puts detail.backtrace if Puppet[:trace] Puppet.err "Cached %s for %s failed: %s" % [self.name, request.key, detail] end diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index 4f60f6e..859daa6 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -190,7 +190,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph resource end - def expired?(ts) + def dependent_data_expired?(ts) if applying? return super else diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb index e425776..2996dc9 100644 --- a/lib/puppet/util/cacher.rb +++ b/lib/puppet/util/cacher.rb @@ -9,7 +9,7 @@ module Puppet::Util::Cacher # Is the provided timestamp earlier than our expiration timestamp? # If it is, then the associated value is expired. - def expired?(ts) + def dependent_data_expired?(ts) return false unless timestamp return timestamp > ts @@ -112,7 +112,7 @@ module Puppet::Util::Cacher if expirer.nil? return true unless self.class.attr_ttl(name) end - return expirer.expired?(cache_timestamp) + return expirer.dependent_data_expired?(cache_timestamp) end def expired_by_ttl?(name) diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb index 6a5922e..bf46f25 100755 --- a/spec/unit/resource/catalog.rb +++ b/spec/unit/resource/catalog.rb @@ -10,14 +10,14 @@ describe Puppet::Resource::Catalog, "when compiling" do it "should always be expired if it's not applying" do @catalog = Puppet::Resource::Catalog.new("host") @catalog.expects(:applying?).returns false - @catalog.should be_expired(Time.now) + @catalog.should be_dependent_data_expired(Time.now) end it "should not be expired if it's applying and the timestamp is late enough" do @catalog = Puppet::Resource::Catalog.new("host") @catalog.expire @catalog.expects(:applying?).returns true - @catalog.should_not be_expired(Time.now) + @catalog.should_not be_dependent_data_expired(Time.now) end it "should be able to write its list of classes to the class file" do diff --git a/spec/unit/util/cacher.rb b/spec/unit/util/cacher.rb index d0f5d5e..a1dd17a 100755 --- a/spec/unit/util/cacher.rb +++ b/spec/unit/util/cacher.rb @@ -21,7 +21,7 @@ describe Puppet::Util::Cacher::Expirer do end it "should be able to test whether a timestamp is expired" do - @expirer.should respond_to(:expired?) + @expirer.should respond_to(:dependent_data_expired?) end it "should be able to expire all values" do @@ -29,12 +29,12 @@ describe Puppet::Util::Cacher::Expirer do end it "should consider any value to be valid if it has never been expired" do - @expirer.should_not be_expired(Time.now) + @expirer.should_not be_dependent_data_expired(Time.now) end it "should consider any value created after expiration to be expired" do @expirer.expire - @expirer.should be_expired(Time.now - 1) + @expirer.should be_dependent_data_expired(Time.now - 1) end end -- 1.6.1 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
