Issue #7681 has been updated by Nick Lewis.

Status changed from Accepted to Merged - Pending Release

Fix merged to 2.7rc in commit:2ebd2d9eda3c556244cda1ae62da95965a92d79b.

Since resource reference titles are implicitly wrapped in an array, if one of
the elements of that array is a variable containing an array, the list of
titles is a nested array. Prior to the change causing the regression, we would
flatten arrays when evaluating them, under certain circumstances.  We no longer
ever flatten AST arrays when evaluating them, so anywhere that we really do
need a flattened array, we have to manually flatten it.

ResourceReference expects its list of titles to be a single, flat list of
titles, so we have to make it so.
----------------------------------------
Bug #7681: Regression, arrays and variables
https://projects.puppetlabs.com/issues/7681

Author: Stig Sandbeck Mathisen
Status: Merged - Pending Release
Priority: Urgent
Assignee: 
Category: 
Target version: 2.7.0
Affected Puppet version: 2.7.0rc3
Keywords: regression, array, require
Branch: 


There seems to be a regression, or at least a change in how puppet handles 
arrays assigned to variables, in 2.7

Given the following manifest:

    $files = ["/tmp/one", "/tmp/two"]
    file { "/tmp/one":
      content => "one",
    }
    file { "/tmp/two":
      content => "two",
    }
    file { "/tmp/three":
      content => "three",
      require => File[$files],
    }
    

2.7.0 concatenates the strings in the array in the variable.

    $ puppet test_array.pp
    Could not find dependency File[/tmp/one/tmp/two] for File[/tmp/three] at 
/srv/nfs/ms/home/ssm/test_array.pp:15
    $ puppet --version
    2.7.0
    
2.6.8 and 0.25.4 handles the array just fine

    $ puppet test_array.pp
    notice: /Stage[main]//File[/tmp/two]/ensure: defined content as 
'{md5}b8a9f715dbb64fd5c56e7783c6820a61'
    notice: /Stage[main]//File[/tmp/one]/ensure: defined content as 
'{md5}f97c5d29941bfb1b2fdab0874906ab82'
    notice: /Stage[main]//File[/tmp/three]/ensure: defined content as 
'{md5}35d6d33467aae9a2e3dccb4b6b027878'
    notice: Finished catalog run in 0.62 seconds
    $ puppet --version
    2.6.8
    
    $ puppet test_array.pp
    notice: //File[/tmp/one]/content: defined content as 'unknown checksum'
    notice: //File[/tmp/two]/content: defined content as 'unknown checksum'
    notice: //File[/tmp/three]/content: defined content as 'unknown checksum'
    $ puppet --version
    0.25.4


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to