From 3077d26b00b170ef2c5c808831577d421613b198 Mon Sep 17 00:00:00 2001 From: Martin Hellmich Date: Mon, 22 Apr 2013 23:26:22 +0200 Subject: check if an argument supposed to be merged is empty to pass over undefs without failing --- lib/puppet/parser/functions/merge.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/puppet/parser/functions') diff --git a/lib/puppet/parser/functions/merge.rb b/lib/puppet/parser/functions/merge.rb index 6ec085e..54d1c1c 100644 --- a/lib/puppet/parser/functions/merge.rb +++ b/lib/puppet/parser/functions/merge.rb @@ -22,6 +22,7 @@ module Puppet::Parser::Functions accumulator = Hash.new # Merge into the accumulator hash args.each do |arg| + next if arg.empty? # empty string is synonym for puppet's undef unless arg.is_a?(Hash) raise Puppet::ParseError, "merge: unexpected argument type #{arg.class}, only expects hash arguments" end -- cgit v1.2.3