From 0804121719e4bde856723e19e8ff8bf6f9c2d55d Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Thu, 8 May 2014 14:43:06 -0700 Subject: Fix the stdlib functions that fail tests --- lib/puppet/parser/functions/is_function_available.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/puppet/parser/functions/is_function_available.rb') diff --git a/lib/puppet/parser/functions/is_function_available.rb b/lib/puppet/parser/functions/is_function_available.rb index 6cbd35c..6da82c8 100644 --- a/lib/puppet/parser/functions/is_function_available.rb +++ b/lib/puppet/parser/functions/is_function_available.rb @@ -15,6 +15,9 @@ true if the function exists, false if not. "given #{arguments.size} for 1") end + # Only allow String types + return false unless arguments[0].is_a?(String) + function = Puppet::Parser::Functions.function(arguments[0].to_sym) function.is_a?(String) and not function.empty? end -- cgit v1.2.3