Details
Description
Here is the code to realize the problem.
inline_epp( '<%- |Optional[String[1]] $var| -%>', { 'var' => undef } )
|
The value undef is given to the variable var and it should be accepted by the function inline_epp() because the type of var is:
Optional[String[1]]
|
which means ok to have a value undef. But with Puppet 4.4.0, we have an error:
~# puppet --version
|
|
~# puppet apply /tmp/test.pp
|
Error: Evaluation Error: Error while evaluating a Function Call, lambda: expects a value for parameter 'var' at /tmp/test.pp:1:1 on node puppet.athome.priv
|
We have exactly the same error with the function epp().
Note: with Puppet 4.3.2, the same worked correctly:
~# puppet --version
|
4.3.2
|
|
~# puppet apply /tmp/test.pp
|
Notice: Compiled catalog for middleware.athome.priv in environment production in 0.04 seconds
|
Notice: Applied catalog in 0.12 seconds
|
When doing this (setting a default value):
# cat pup6064.pp
|
notice inline_epp( '<%- |Optional[String[1]] $var=ouch| -%> <%= $var %>', { 'var' => undef } ) |
# puppet apply pup6064.pp
|
ouch
|
Clearly shows the regression - EPP now has define/class instantiation call semantics as the
{undef}picks the default.
Attachments
Issue Links
- links to