hiera_array() overriden when used as default class parameter

26 views
Skip to first unread message

Bruno Léon

unread,
Sep 11, 2014, 10:26:54 AM9/11/14
to puppet...@googlegroups.com
Hi there,

it took me while to figure this out but it seems that when you do set the default value of a class parameter to the value hiera_array('myparameter'), hiera does not do an array merge but a standard "most specific value found".

This is on Puppet 3.7.

I created a module to show this:https://github.com/brunoleon/puppet-foo

I would expect to have the same behavior whether I call hiera_array() within class body or a default parameter value.

Can anybody confirm this is a bug ?

Bruno Léon

unread,
Sep 11, 2014, 10:58:20 AM9/11/14
to puppet...@googlegroups.com
Double checked by temporarily removing /usr/lib/ruby/vendor_ruby/puppet/parser/functions/hiera_array.rb from puppet master

If called in the body this raises an error as expected.
If called as a default class parameter => no error so the function is not called

Bruno Léon

unread,
Sep 11, 2014, 12:49:27 PM9/11/14
to puppet...@googlegroups.com
Got a reply on IRC chan and I actually was wrongly thinking that the default param value would have precendence over databinding.
Sorry for the noise...

Bruno
Reply all
Reply to author
Forward
0 new messages