diff options
author | Luke Kanies <luke@madstop.com> | 2009-05-27 10:47:36 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-05-28 07:02:48 +1000 |
commit | 62534a1622c710eb52b681d96aca8687c597190c (patch) | |
tree | e7ba17fb8cce394b8c0ff61bd7a2e175945de3da | |
parent | ff5c44f2420864357d1c37635c311913c14d7a8b (diff) | |
download | puppet-62534a1622c710eb52b681d96aca8687c597190c.tar.gz puppet-62534a1622c710eb52b681d96aca8687c597190c.tar.xz puppet-62534a1622c710eb52b681d96aca8687c597190c.zip |
Logging when a cached catalog is used.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/configurer.rb | 1 | ||||
-rwxr-xr-x | spec/unit/configurer.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index d9f207143..7db9972dd 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -103,6 +103,7 @@ class Puppet::Configurer duration = thinmark do result = catalog_class.find(name, fact_options.merge(:ignore_terminus => true)) end + Puppet.notice "Using cached catalog" rescue => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not retrieve catalog from cache: %s" % detail diff --git a/spec/unit/configurer.rb b/spec/unit/configurer.rb index fcc124d8e..c27445a64 100755 --- a/spec/unit/configurer.rb +++ b/spec/unit/configurer.rb @@ -105,10 +105,12 @@ describe Puppet::Configurer, "when retrieving a catalog" do @agent.retrieve_catalog.should == @catalog end - it "should return the cached catalog when no catalog can be retrieved from the server" do + it "should log and return the cached catalog when no catalog can be retrieved from the server" do Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns nil Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog + Puppet.expects(:notice) + @agent.retrieve_catalog.should == @catalog end |