Bug #2226

Regression between 0.24.7 and 0.24.8 with array handling.

Added by Jason Hansen about 3 years ago. Updated about 3 years ago.

Status:Rejected Start date:05/06/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:unknown
Target version:-
Affected Puppet version:0.24.8 Branch:
Keywords:
Votes: 0

Description

It looks like the behavior when processing a template using arrays whose members are variables (other arrays) has changed between 0.24.7 and 0.24.8.

Using the following code:

#!/usr/bin/env puppet

$a = ['a1', 'a2']

$b = ['b1', 'b2']

$c = [$a, $b]

$d = ['d1', 'd2', ['ds1', 'ds2']]

file { "testfile":
    path => "/tmp/testfile",
    content => template("/tmp/testfile.erb")
}

With template:

<% c.each do |val| -%>
c val: <%= val %>
<% end -%>

<% d.each do |val| -%>
d val: <%= val %>
<% end -%>

Produces the following template output in 0.24.7 produces the expected behavior:

c val: a1
c val: a2
c val: b1
c val: b2

d val: d1
d val: d2
d val: ds1
d val: ds2

While the output with version 0.24.8 produces new behavior:

c val: a1a2
c val: b1b2

d val: d1
d val: d2
d val: ds1
d val: ds2

History

Updated by Jason Hansen about 3 years ago

Potential tickets?: * #1738 – same behavior, different ‘cause’ * #1682 – deals with flattening arrays… * #1824 – passing arrays (probably unrelated, as far as I can tell)

Updated by Luke Kanies about 3 years ago

  • Status changed from Unreviewed to Rejected

This is actually a regression between 0.24.6 and 0.24.7 being fixed. You’re correctly getting the arrays of arrays, where in 0.24.7 the arrays were all flattened.

Also available in: Atom PDF