Bug #1922
Functions squash all arguments into a single hash
| Status: | Closed | Start date: | 01/30/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | functions | |||
| Target version: | 0.24.8 | |||
| Affected Puppet version: | 0.24.7 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
The fix for #1682 does some funky things to functions. Previously, arguments were passed through as an array, but now they’re always flattened. Given this code:
$ary = ["foo", "bar"] testing $ary, "boo", "baz"
With a simple function that just prints the arguments, in 0.24.6 I got this:
warning: [["foo", "bar"], "boo", "baz"]
But with 0.24.7 I get this:
warning: ["foo", "bar", "boo", "baz"]
The question becomes, what’s the right solution?
It seems like we should pass an array straight through, and if one of the arguments in that array is also an array, then the function should receive an array of arrays.
Related issues
History
Updated by Brice Figureau about 3 years ago
- Status changed from Accepted to In Topic Branch Pending Review
- Assignee changed from Brice Figureau to James Turnbull
- % Done changed from 0 to 100
- 3 changed from Unknown to Easy
The fix is available in the tickets/0.24.x/1922 branch of my github repository: http://github.com/masterzen/puppet/tree/tickets/0.24.x/1922
Updated by James Turnbull about 3 years ago
- Status changed from In Topic Branch Pending Review to Closed
Pushed in commit:b22d148e6d6eb36c9b02a58dc0c04c9650d5207b in branch 0.24.x