Hello, I'm trying to create an array with list expansion and wonder why there is no coordinated iteration.
Here is my test case:
#v+
body common control
{
bundlesequence => { "test" };
version => "0.0.5";
}
bundle agent test
{
vars:
"l1" slist => { "test1" };
"array[$(l1)]" string => "prefix_$(l1)";
"index" slist => getindices("array");
reports:
Yr2011::
"Indexes are $(index)";
"array for test1 is $(array[test1])";
"array for test2 is $(array[test2])";
}
#v-
The result is:
#v+
bin/cf-agent -K -I
!! Redefinition of a constant list "index"
cf3> -- Was {'cf_null'}cf3> now {'test1'}cf3>
Promise (version 0.0.5) belongs to bundle 'test' in file
'/home/dad/.cfagent/inputs/promises.cf' near line 14
!! Redefinition of a constant list "index"
cf3> -- Was {'cf_null'}cf3> now {'test1'}cf3>
Promise (version 0.0.5) belongs to bundle 'test' in file
'/home/dad/.cfagent/inputs/promises.cf' near line 14
R: array for test1 is prefix_test1
R: array for test2 is $(array[test2])
#v-
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpXFEZ44cxV1.pgp
Description: PGP signature
_______________________________________________ Help-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/help-cfengine
