diff options
-rw-r--r-- | lib/puppet/util/log.rb | 2 | ||||
-rwxr-xr-x | 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 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 |