Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
PUP 4.3.2
-
None
-
3
-
Language 2016-02-24
-
Bug Fix
-
Our old foe :undef turned up again due to 3.x calling convention also applying to resource expressions.
Description
The following code:
define test ($b) {
|
$a = { key => undef }
|
notice("a: $a") |
notice("b: $b") |
$a.each |Array $values| {
|
notice("a values: $values") |
}
|
$b.each |Array $values| {
|
notice("b values: $values") |
}
|
}
|
|
$a = { key => undef }
|
test { "test": |
b => $a,
|
}
|
generates the following output if run with puppet apply:
puppet apply test.pp
|
Notice: Scope(Test[test]): a: {key => }
|
Notice: Scope(Test[test]): b: {key => }
|
Notice: Scope(Test[test]): a values: [key, ]
|
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Method call, block parameter 'values' expects an Array value, got Tuple at /home/rvicinus/test.pp:8:5 at /home/rvicinus/test.pp:14 on node puppetmaster
|
I would expect that the second each statement would run like the first, because the supplied hash is absolutely equally created like the one provided to the first each statement. I think somehow assigning the hash to a parameter messes up the data types, because the code works as expected if the Array keyword in the second each statement is removed. This is also the workaround that I use.
Attachments
Issue Links
- relates to
-
PUP-1467 DIE :undef, DIE!
-
- Closed
-
- links to