ripienaar / puppet-module-data

Hiera backend that stores data in a module
74 stars 43 forks source link

Fixed hash merge behavior when :merge_behavior deeper is set #13

Closed telamonian closed 10 years ago

telamonian commented 10 years ago

I was getting incorrect behavior for hash merges in Hiera for data files placed in modules. Following the "deeper" hash merge example in https://docs.puppetlabs.com/hiera/1/lookup_types.html, I was getting {"bob"=>{"uid"=>1000, "group"=>"deglitch"}, "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}, "jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"}} for a hash merge between Debian.yaml and common.yaml files placed in a module, and {"bob"=>{"uid"=>1000, "shell"=>"/bin/bash", "group"=>"deglitch"}, "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}, "jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"}} for a hash merge between Debian.yaml and common.yaml files placed at the Puppet root. Changing a few lines around in module_data_backend.rb fixed the problem.

telamonian commented 10 years ago

All done. Ruby is weird.

ripienaar commented 10 years ago

thank you