[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:31 UTC 2009


The following commit has been merged in the master branch:
commit 42cac73a7ce531e125c1c94f7bd942d9002e5445
Author: Luke Kanies <luke at madstop.com>
Date:   Mon Oct 27 23:22:03 2008 -0500

    Fixing #1698 - all logs again show up in the report.

diff --git a/CHANGELOG b/CHANGELOG
index accacc9..8415c06 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 0.24.x
+    Fixed #1698 - All logs should now show up in the reports
+
     Fixed #1661 - Type reference: tidy should specify manditory parameters
 
     Fixed #1104 - Classes and nodes should set $name variables
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index 0dfd36d..b57faad 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -369,11 +369,7 @@ class Puppet::Util::Log
         end
 
         def handle(msg)
-            # Only add messages from objects, since anything else is
-            # probably unrelated to this run.
-            if msg.objectsource?
-                @report.newlog(msg)
-            end
+            @report.newlog(msg)
         end
     end
 
@@ -505,15 +501,6 @@ class Puppet::Util::Log
         Log.newmessage(self)
     end
 
-    # Was the source of this log a Puppet resource or parameter?
-    def objectsource?
-        if defined? @objectsource and @objectsource
-            @objectsource
-        else
-            false
-        end
-    end
-
     # If they pass a source in to us, we make sure it is a string, and
     # we retrieve any tags we can.
     def source=(source)
@@ -521,10 +508,8 @@ class Puppet::Util::Log
         # We can't just check for whether it responds to :path, because
         # plenty of providers respond to that in their normal function.
         if (source.is_a?(Puppet::Type) or source.is_a?(Puppet::Parameter)) and source.respond_to?(:path)
-            @objectsource = true
             @source = source.path
         else
-            @objectsource = false
             @source = source.to_s
         end
         if source.respond_to?(:tags)
diff --git a/spec/unit/util/log.rb b/spec/unit/util/log.rb
index aa00602..c42b25c 100755
--- a/spec/unit/util/log.rb
+++ b/spec/unit/util/log.rb
@@ -103,51 +103,5 @@ describe Puppet::Util::Log do
             report.should be_include(log.source)
             report.should be_include(log.time.to_s)
         end
-
-        it "should have a method for indicating whether it was created by a resource" do
-            Puppet::Util::Log.new(:level => "notice", :message => :foo).should respond_to(:objectsource?)
-        end
-
-        describe "when setting a source" do
-            it "should mark itself as from a Puppet resource if its source is a Puppet resource" do
-                file = Puppet::Type.type(:file).create :path => "/testing/object/source/in/logs"
-                Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => file).should be_objectsource
-            end
-
-            it "should use the resource's path when its source is a resource" do
-                # Use a different path, so we don't use 'clear', which is deprecated in master
-                file = Puppet::Type.type(:file).create :path => "/testing/object/source/in/logs/with/path"
-                file.expects(:path).returns "mypath"
-                Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => file).source.should == "mypath"
-            end
-
-            it "should mark itself as from a Puppet resource if its source is a Puppet parameter" do
-                file = Puppet::Type.type(:file).create :path => "/testing/object/source/in/logs/with/parameters", :mode => "500"
-                mode = file.property(:mode)
-                Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => mode).should be_objectsource
-            end
-
-            it "should use the resource's path when its source is a Puppet parameter" do
-                # Use a different path, so we don't use 'clear', which is deprecated in master
-                file = Puppet::Type.type(:file).create :path => "/testing/object/source/in/logs/with/path/in/parameters", :mode => "500"
-                mode = file.property(:mode)
-                mode.expects(:path).returns "mypath"
-                Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => mode).source.should == "mypath"
-            end
-
-            it "should acquire its source's tags if its source has any" do
-                file = Puppet::Type.type(:file).create :path => "/testing/object/source/in/logs/with/tags"
-                file.tag("foo")
-                file.tag("bar")
-                log = Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => file)
-
-                log.should be_tagged("foo")
-                log.should be_tagged("bar")
-            end
-
-            it "should not set objectsource if the source is not a Parameter or Resource" do
-                Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => "mysource").should_not be_objectsource
-            end
-        end
     end
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list