From 5a11279cc54e7f9f5d168c75728f990d0bd0b694 Mon Sep 17 00:00:00 2001 From: Uwe Stuehler Date: Tue, 23 Oct 2012 16:43:03 +0200 Subject: Fix number of arguments check in flatten() The function only uses the first argument, so raise an error with too few arguments *and* with too many arguments. --- lib/puppet/parser/functions/flatten.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/functions/flatten.rb b/lib/puppet/parser/functions/flatten.rb index 781da78..a1ed183 100644 --- a/lib/puppet/parser/functions/flatten.rb +++ b/lib/puppet/parser/functions/flatten.rb @@ -16,7 +16,7 @@ Would return: ['a','b','c'] ) do |arguments| raise(Puppet::ParseError, "flatten(): Wrong number of arguments " + - "given (#{arguments.size} for 1)") if arguments.size < 1 + "given (#{arguments.size} for 1)") if arguments.size != 1 array = arguments[0] -- cgit v1.2.3