getindices from array[1][2]

13 views
Skip to first unread message

Mark

unread,
Jan 28, 2015, 9:13:07 AM1/28/15
to help-c...@googlegroups.com
getindices on the second dimension returns more than expected. Is this a bug or am I missing something?

v3.6.2

vars:
"array[x][1]" string => "x.1";
"array[x][2]" string => "x.2";
"array[y][3]" string => "y.3";
"array[y][4]" string => "y.4";
"dim_1" slist => getindices("array");
"dim_2_x" slist => getindices("array[x]");
"dim_2_y" slist => getindices("array[y]");

reports:
"dim 1: $(dim_1)";
"dim 2 [x]: $(dim_2_x)";
"dim 2 [y]: $(dim_2_y)";

R: dim 1: x
R: dim 1: y
R: dim 2 [x] 1
R: dim 2 [x] 3
R: dim 2 [x] 2
R: dim 2 [x] 4
R: dim 2 [y] 1
R: dim 2 [y] 3
R: dim 2 [y] 2
R: dim 2 [y] 4

I was expecting [x] to return 1 & 2 and [y] 3 & 4.




This email is confidential.  If you have received this email in error please notify us immediately by return email and delete this email and any attachments.  
VIX accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.


Nick Anderson

unread,
Jan 28, 2015, 9:19:04 AM1/28/15
to Mark, help-c...@googlegroups.com
On 01/28/2015 08:13 AM, Mark wrote:
> getindices on the second dimension returns more than expected. Is this a
> bug or am I missing something?

Hi Mark, I think that has been fixed in 3.6.3.

bundle agent example
{
vars:
"array[x][1]" string => "x.1";
"array[x][2]" string => "x.2";
"array[y][3]" string => "y.3";
"array[y][4]" string => "y.4";
"dim_1" slist => getindices("array");
"dim_2_x" slist => getindices("array[x]");
"dim_2_y" slist => getindices("array[y]");

reports:
"CFEngine Version '$(sys.cf_version)'";
"dim 1: $(dim_1)";
"dim 2 [x]: $(dim_2_x)";
"dim 2 [y]: $(dim_2_y)";

}


[root@hub ~]# cf-agent -KIf ./t.cf -b example
2015-01-28T14:18:09+0000 info: Using command line specified
bundlesequence
R: CFEngine Version '3.6.3'
R: dim 1: x
R: dim 1: y
R: dim 2 [x]: 2
R: dim 2 [x]: 1
R: dim 2 [y]: 3
R: dim 2 [y]: 4


Mark

unread,
Jan 28, 2015, 9:35:50 AM1/28/15
to help-c...@googlegroups.com, mark....@vixtechnology.com
Thanks,

Updating my test machine now.

Mark
Reply all
Reply to author
Forward
0 new messages