[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Max Martin max at puppetlabs.com
Tue May 10 08:18:13 UTC 2011


The following commit has been merged in the experimental branch:
commit 6064e8e37b0d6f9996921bfa598d5401a1f98537
Author: Max Martin <max at puppetlabs.com>
Date:   Tue Apr 26 11:44:16 2011 -0700

    (#7101) Fix template error messages in Ruby 1.8.5
    
    lib/puppet/parser/templatewrapper.rb#script_line was calling .first on a
    String object, which in Ruby > 1.8.5 will return the entire string, but
    in 1.8.5 will cause an exception. This change (proposed by Markus
    Roberts) removes the call to .first and adds a condition for when the
    template error involves the file not being found.
    
    Reviewed-by: Jesse Wolfe

diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb
index 180a03d..27d75bf 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -20,7 +20,7 @@ class Puppet::Parser::TemplateWrapper
 
   def script_line
     # find which line in the template (if any) we were called from
-    caller.find { |l| l =~ /#{file}:/ }.first[/:(\d+):/,1]
+    (caller.find { |l| l =~ /#{file}:/ }||"")[/:(\d+):/,1]
   end
 
   # Should return true if a variable is defined, false if it is not

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list