FAQ
The first notice command shows the array as having two elements. The
second notice command shows the same array as having only one element.
Some sort of variable reference thing? How can I make a copy of the
$nodes array rather than make a reference to it?

notice ("NODES1=$nodes")
$n2 = $nodes
$useless = inline_template("<%= n2.shift -%>")
notice ("NODES2=$nodes")

Doug.

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

Search Discussions

  • Henrik Lindberg at Aug 28, 2012 at 10:49 am

    On 2012-28-08 5:02, Douglas Garstang wrote:
    The first notice command shows the array as having two elements. The
    second notice command shows the same array as having only one element.
    Some sort of variable reference thing? How can I make a copy of the
    $nodes array rather than make a reference to it?

    notice ("NODES1=$nodes")
    $n2 = $nodes
    $useless = inline_template("<%= n2.shift -%>")
    notice ("NODES2=$nodes")

    Doug.
    You are responsible for not mutating variables and arrays in the ruby
    logic. Did you try n.dup.shift instead of n2.shift ?

    - henrik

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 28, '12 at 3:02a
activeAug 28, '12 at 10:49a
posts2
users2
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase