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 <[email protected]> --- lib/puppet/util/log.rb | 2 +- spec/unit/util/log.rb | 7 ------- 2 files changed, 1 insertions(+), 8 deletions(-) diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index d6d3ba0..25c4677 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 70309e4..4e2c8dc 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 -- 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 -~----------~----~----~----~------~----~------~--~---
