I guess to be more clear I should have said that double interpolation
(first the index, then the actual array slist values) is what seems to
be failing. I did verify it works fine when the array element's value is
a string rather than an slist.

Justin

-----Original Message-----
From: help-cfengine-boun...@cfengine.org
[mailto:help-cfengine-boun...@cfengine.org] On Behalf Of Justin Lloyd
Sent: Wednesday, March 10, 2010 1:25 PM
To: help-cfengine@cfengine.org
Subject: Iteration fails when interpolating array index

Can anyone reproduce the following? It seems like a bug that is
preventing iterating over an array element when interpolating the index.

body common control {
    bundlesequence => { "test" };
}

bundle agent test {

    vars:

        "an_slist" string => "an_slist";
   
        "foo[$(an_slist)]" slist => { "abc", "def" };

    reports:

        linux::

            "Not interpolating the array index";
            "foo[an_slist] is $(foo[an_slist])";
            "";
            "Interpolating the array index";
            "foo[an_slist] is $(foo[$(an_slist)])";
}

[r...@gdcscf3lgmt01 masterfiles.devel]# cf-agent -Kf ./test.var.cf
R: Not interpolating the array index
R: foo[an_slist] is abc
R: foo[an_slist] is def
R:
R: Interpolating the array index
R: foo[an_slist] is $(foo[an_slist])
[r...@gdcscf3lgmt01 masterfiles.devel]#

-- 
Justin C. Lloyd 
Unix Infrastructure Engineer 
DigitalGlobe, An Imaging and Information Company



This electronic communication and any attachments may contain
confidential and proprietary 
information of DigitalGlobe, Inc. If you are not the intended recipient,
or an agent or employee 
responsible for delivering this communication to the intended recipient,
or if you have received 
this communication in error, please do not print, copy, retransmit,
disseminate or 
otherwise use the information. Please indicate to the sender that you
have received this 
communication in error, and delete the copy you received. DigitalGlobe
reserves the 
right to monitor any electronic communication sent or received by its
employees, agents 
or representatives.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to