Issue #12197 has been updated by Stefan Schulte.

If I revert commit 48726b662d2fb5cc3532fca12eb6aa5a3c1622cd it works again.

The commit introduces the following code to test insyc if array_matching is all 
(reduced to the important stuff)
<pre>
old = (is == @should or is == @should.collect { |v| v.to_s })
new = Array(is).zip(@should).all? {|is, want| property_matches?(is, want) }
fail "old and new mismatch!" unless old == new

return Array(is).zip(@should).all? {|is, want| property_matches?(is, want) }
</pre>

So I guess the intention was to be sure that the new way behaves exactly like 
the old way to determine insync. Unfortunately the the first execution of 
`Array(is).zip(@should).all? {|is, want| property_matches?(is, want) }` 
modifies the `is` value (blocks dont create a new scope under ruby 1.8 if I am 
not mistaken.

Short test with irb18
<pre>
irb(main):001:0> a=['a','b']
=> ["a", "b"]
irb(main):002:0> a.all? { |a| true }
=> true
irb(main):003:0> a
=> "b"
</pre>
while with irb19
<pre>
irb(main):001:0> a=['a','b']
=> ["a", "b"]
irb(main):002:0> a.all? { |a| true }
=> true
irb(main):003:0> a
=> ["a", "b"]
</pre>

----------------------------------------
Bug #12197: Array handling broken in 2.7.10
https://projects.puppetlabs.com/issues/12197

Author: Stefan Schulte
Status: Investigating
Priority: Normal
Assignee: Stefan Schulte
Category: ralsh
Target version: 
Affected Puppet version: 2.7.10
Keywords: 
Branch: 


Handling properties with array_matching all is somehow broken in 2.7.10 and 
ruby 1.8

I have created the following manifest and applied it once, so the resource must 
be in sync
<pre>
k5login { '/tmp/test.txt':
  ensure     => present,
  principals => [ 'A', 'B', 'C' ],
}
</pre>

running puppet apply on 2.7.9
<pre>
# puppet apply /tmp/test.pp 
notice: Finished catalog run in 0.03 seconds
</pre>

running puppet apply on 2.7.10
<pre>
# puppet apply /tmp/test.pp
notice: /Stage[main]//K5login[/tmp/test.txt]/principals: principals changed 
['A', 'B', 'C'] to 'A B C'
notice: Finished catalog run in 0.13 seconds
</pre>

running puppet apply on 2.7.10 and ruby 1.9.3
<pre>
# puppet apply /tmp/test.pp
/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 
iconv will be deprecated in the future, use String#encode instead.
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- 
puppet/provider/confine/operatingsystem
notice: Finished catalog run in 0.07 seconds
</pre>


-- 
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