On Thursday, March 14, 2013 3:39:41 PM UTC-5, Ellison Marks wrote:
>
> I'm pretty sure it does do merging, in the yaml backend at least.
>
> case resolution_type
> ...
> when :hash
>             raise Exception, "Hiera type mismatch: expected Hash and got 
> #{new_answer.class}" unless new_answer.kind_of? Hash
>             answer ||= {}
>             answer = new_answer.merge answer
>
>

Never mind.  I somehow got a totally wrong idea of what hiera_hash() does.  
I probably formed it by analogy with hiera_array(), but in fact they aren't 
very analogous in that hiera_array() gives you all the data in your 
hierarchy, whereas hiera_hash() gives you a digested form.  It looks like 
it does merge (but only shallowly until 1.2).

I got another surprise when studying the code, too: hiera_array() is much 
less general than I thought.  It collects only String and Array values, not 
numeric, boolean, or hash values.  It raises an exception if any of the 
collected values for the give key is of any of the latter types, and it is 
not clear to me why.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to