Issue #20923 has been updated by Jeff McCune.
Andrew Parker wrote: > I don't understand why we would want to special case the hiera functions. It > seems much simpler to make a global "make undef passing to functions sane" > setting that defaults to false. Is there a reason we wouldn't want to make > this globally across all functions? The hiera function is special because the user determines whether or not they want to an undefined default value returned to them by passing in a value of `undef`. For nearly all other functions, passing in `undef` as an argument is unlikely to result in `undef` being returned, unmodified. For those functions the munging behavior is more nuanced. Each function must make an assumption about how the framework will munge, or not munge arguments with `undef` values. It's entirely possible the user wants to use function A, which assumes `undef` is munged with function B which assumes `undef` isn't munged. In this scenario, the user could never use A and B together if the only way to control the munging behavior is system-wide rather than on a function by function basis. Furthermore, the user doesn't really have the best information regarding whether a particular function behaves well with `undef` values. I think the best we can do is support functions that don't want to accept munged values and allow those functions to opt-in to the behavior. Basically, hiera is a bit special and we need to preserve compatibility. Nearly all other functions should opt-in to the new "don't munge" behavior in my opinion. -Jeff ---------------------------------------- Bug #20923: Hiera cannot take `undef` as a default value https://projects.puppetlabs.com/issues/20923#change-91664 * Author: Raphaƫl Pinson * Status: In Topic Branch Pending Review * Priority: Normal * Assignee: * Category: * Target version: * Affected Puppet version: * Keywords: * Branch: https://github.com/puppetlabs/puppet/pull/1670 ---------------------------------------- As discussed with Jeff McCune yesterday, I believe #13210 is not a duplicate of #15329, as #13210 can be fixed without fixing #15329 per se. Here's the idea: * Implement a new `:honor_undef` option for functions, defaulting to `false`; * Implement a new `:hiera_munge_undef` option in puppet.conf, defaulting to `true` for backwards compatibility; * Use `:honor_undef = true` in all hiera functions when `:hiera_munge_undef` is set to `false`. The code can be found in this PR: https://github.com/puppetlabs/puppet/pull/1670 -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
