diff options
author | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 11:45:46 -0700 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 11:45:46 -0700 |
commit | 0f254bec2937f0b27171dce0352a25fcaddca719 (patch) | |
tree | cf89c488b3b0b918996d528663d498541621efe2 /lib | |
parent | 41aeba49ed4afc523f0e9827076cb3532569f49f (diff) | |
download | puppet-0f254bec2937f0b27171dce0352a25fcaddca719.tar.gz puppet-0f254bec2937f0b27171dce0352a25fcaddca719.tar.xz puppet-0f254bec2937f0b27171dce0352a25fcaddca719.zip |
Fixing Hash functionality with non-constant keys
It was only apparently working with constant keys,
not, say, AST strings.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/ast/asthash.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/asthash.rb b/lib/puppet/parser/ast/asthash.rb index 3e09457ab..aa5127dd9 100644 --- a/lib/puppet/parser/ast/asthash.rb +++ b/lib/puppet/parser/ast/asthash.rb @@ -9,7 +9,8 @@ class Puppet::Parser::AST items = {} @value.each_pair do |k,v| - items.merge!({ k => v.safeevaluate(scope) }) + key = k.respond_to?(:safeevaluate) ? k.safeevaluate(scope) : k + items.merge!({ key => v.safeevaluate(scope) }) end return items |