Issue #5127 has been updated by Brice Figureau.

Brice Figureau wrote:
> It once worked when I submitted the patch (if you look at the ast for this 
> operation it is call HashOrArrayAccess), something might have break this 
> feature.

Or maybe not and it was broken since the beginning :(
----------------------------------------
Feature #5127: Array entries should be addressable by index in the DSL
https://projects.puppetlabs.com/issues/5127

Author: Nigel Kersten
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.2
Keywords: 
Branch: 


This is something people shouldn't have to use functions or string munging for.

Hashes work by key:

<pre>
$foo = { 0 => "zero", 1 => "one", 2 => "two" }
notice $foo[0]
</pre>
<pre>
nbk$ puppet -v /tmp/test.pp 
notice: Scope(Class[main]): zero
info: Applying configuration version '1288210234'
</pre>

Arrays do not, no matter how I quote:
<pre>
$foo = ["one", "two", "three"]
notice "$foo[1]"
notice $foo[1]
</pre>

<pre>
nbk$ puppet -v /tmp/test.pp 
notice: Scope(Class[main]): onetwothree[1]
can't convert String into Integer at /tmp/test.pp:3 on node 
kripke.puppetlabs.lan
</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