On 02/21/2012 01:29 PM, no-re...@cfengine.com wrote:
> Forum: CFEngine Help
> Subject: Re: getindices with an array of lists
> Author: Authority
> Link to topic: https://cfengine.com/forum/read.php?3,24975,24976#msg-24976
> 
> You can't iterate over non-local slists.  You'd need to import the slists 
> from the array (you forgot your array keys in the example, by the way) into 
> the local scope.  I'm not sure how to do that.

The keys are there, but the form -> email list functionality strips out
hard brackets.

Wes Hardin posted an example yesterday that pulled an slist out of an
array but I have yet to understand it fully myself. Ive tried a few
things with what you just posted Niel and I have been unsuccessful.
Here is the link to the post from wes.
https://cfengine.com/forum/read.php?3,24924,24958#msg-24958

Ive tried this without success.

bundle agent test (shorewall){

    vars:
       "i" slist => getindices( "${shorewall}" );
       "my_${i}" slist => {"@{test.shorewall[${i}]}"};

    reports:
        cfengine::
            "my_${i} => $(my_$(i))";


-- 
Nick Anderson <n...@cmdln.org>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to