summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-03 16:14:26 -0700
committerLuke Kanies <luke@madstop.com>2009-08-03 16:14:26 -0700
commit5b87dba681cc0aa3144dca59216223bb16d10a4a (patch)
tree6845dbdc8fbbcbb0dfb9249e44d52e3757103079
parent1410bed5a40fe945f68b805474b7c022403c3d47 (diff)
downloadpuppet-5b87dba681cc0aa3144dca59216223bb16d10a4a.tar.gz
puppet-5b87dba681cc0aa3144dca59216223bb16d10a4a.tar.xz
puppet-5b87dba681cc0aa3144dca59216223bb16d10a4a.zip
Logs now assume resource params have metadata
We were previously not assuming they had it, because I figured there were just a couple that didn't. On closer inspection, none of them did. The previous commit fixed that, so this commit fixes the assumption. Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r--lib/puppet/util/log.rb2
-rwxr-xr-xspec/unit/util/log.rb7
2 files changed, 1 insertions, 8 deletions
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index d6d3ba018..25c4677fb 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -537,7 +537,7 @@ class Puppet::Util::Log
source.tags.each { |t| tag(t) }
[:file, :line, :version].each do |param|
- next unless source.respond_to?(param) and value = source.send(param)
+ next unless value = source.send(param)
send(param.to_s + "=", value)
end
end
diff --git a/spec/unit/util/log.rb b/spec/unit/util/log.rb
index 70309e456..4e2c8dcc5 100755
--- a/spec/unit/util/log.rb
+++ b/spec/unit/util/log.rb
@@ -139,13 +139,6 @@ describe Puppet::Util::Log do
log.file.should == "/my/file"
log.line.should == 50
end
-
- it "should not fail when RAL objects don't actually support all of the metadata" do
- file = Puppet::Type.type(:file).new :path => "/foo/bar", :ensure => :file
- source = file.property(:ensure)
- log = Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => source)
- log.file.should be_nil
- end
end
describe "when setting the source as a non-RAL object" do