From fb5c1d7bbe629df6214af9b47e522fb282983beb Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 6 Jun 2010 15:40:44 +0200 Subject: Fix #3907 - Hash couldn't be initialized with an empty hash The following manifest was failing: $data = {} This patch makes sure we initalize our ast hash with an empty ruby hash when it is created without any values. Signed-off-by: Brice Figureau --- lib/puppet/parser/ast/asthash.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/ast/asthash.rb b/lib/puppet/parser/ast/asthash.rb index aa5127dd9..d04901912 100644 --- a/lib/puppet/parser/ast/asthash.rb +++ b/lib/puppet/parser/ast/asthash.rb @@ -28,5 +28,10 @@ class Puppet::Parser::AST def to_s "{" + @value.collect { |v| v.collect { |a| a.to_s }.join(' => ') }.join(', ') + "}" end + + def initialize(args) + super(args) + @value ||= {} + end end end -- cgit