From 8cd1540f82cbdf903c164bdbc2c7229e34a4178b Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Fri, 17 Sep 2010 16:42:40 -0700 Subject: [#4692] undefined variables cause :undef to be passed to functions The :undef symbol, which we use internally to distinguish between undefined variables and variables whose value is the empty string, is being leaked in calls to functions (e.g. "split"). This is a departure from 0.25.x behavior, where undefined variables evaluated to "". This patch restores the 0.25.x behavior. --- lib/puppet/parser/ast/function.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 74023f631..80e6e6512 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -28,7 +28,7 @@ class Puppet::Parser::AST end # We don't need to evaluate the name, because it's plaintext - args = @arguments.safeevaluate(scope) + args = @arguments.safeevaluate(scope).map { |x| x == :undef ? '' : x } scope.send("function_#{@name}", args) end -- cgit