That is a bummer. The problem here is that the 3x API *expects* undefs
to be transformed to empty string (if that is not done, other functions
break). However, the 3x runtime does a poor job and only translates
*some* undefs to empty strings.
We faced a dilemma: which "bug" should future parser be compliant with?
We choose the strict; translate all undefs to empty string.
In the 4x function API there is no such transformation. The intent is
to gradually move functions to the new API on a "most urgent to fix" basis.
Until this has been done, one way of solving this is to implement
bridging function using the new API (if it is named the same as the 3x
function, it will be chosen instead of the 3x function when using parser
== future). It can then simply relay the call to the 3x implementation
(without any transformation).
Tip: If attempting to do this, there may be need to transform other
values such as types - this because the 3x functions does not understand
the new type system, and something like File['/tmp'] results in a
PResourceType in the future parser/evaluator, and needs to be
transformed to a Puppet::Resource.
We are currently discussing, when and how we deal with functions
that needs to be transitioned to the 4x API. As an interim, maybe we
should make the future parser bug compatible wrt. transformation of
undef to empty string when these values are nested in arrays and hashes.
Sorry for the inconvenience.
Regards
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/