Issue #4536 has been updated by Markus Roberts.

Priority changed from High to Low
Affected version changed from 2.6.1rc2 to 0.25.5

This has been this way for going on two years at least.
----------------------------------------
Refactor #4536: scope.lookupvar should return a clone of the object, not the 
object itself
http://projects.puppetlabs.com/issues/4536

Author: Daniel Pittman
Status: Needs design decision
Priority: Low
Assigned to: 
Category: functions
Target version: 
Affected version: 0.25.5
Branch: 


At present this code will destroy the content of a puppet variable:

$foo = [1, 2]
notice("bar is $bar")  # 'bar is 12'
$bar = inline_template('<% foo.shift %>')
notice("bar is $bar")  # 'bar is 2'

This is certainly surprising behaviour, and it means that it is relatively easy 
to destroy the content of a puppet variable from a template.

This would probably be better returning a clone of the object so, at least, 
that the most obvious top level actions don't destroy the content so easily.  
Perhaps even a dclone is appropriate...


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