Skip to content

Instantly share code, notes, and snippets.

@teroka
Last active December 31, 2015 03:29
Show Gist options
  • Save teroka/7928277 to your computer and use it in GitHub Desktop.
Save teroka/7928277 to your computer and use it in GitHub Desktop.
regarray() bug?
body common control { bundlesequence => { "example1", "example2" }; }
bundle agent example1
{
vars:
"myarray[0]" string => "bla1";
"myarray[1]" string => "bla2";
"myarray[3]" string => "bla";
classes:
"ok" expression => regarray("myarray","b.*2");
reports:
ok::
"$(this.bundle): Found in list";
!ok::
"$(this.bundle): Not found in list";
}
bundle agent example2
{
vars:
"myarray[0]" string => "bla1";
"myarray[1]" string => "bla2";
"myarray[3]" string => "bla";
classes:
"ok" expression => regarray("$(this.bundle).myarray","b.*2");
reports:
ok::
"$(this.bundle): Found in list";
!ok::
"$(this.bundle): Not found in list";
}
####
$ cf-agent -Kf ./regarray_bug.cf
2013-12-12T15:53:24+0200 notice: R: example1: Not found in list
2013-12-12T15:53:24+0200 notice: R: example2: Found in list
$ cf-agent -V
CFEngine Core 3.5.2
$ ./cf-agent -Kf /tmp/regarray_bug.cf
2013-12-12T16:34:11+0200 notice: R: example1: Not found in list
2013-12-12T16:34:11+0200 notice: R: example2: Found in list
$ ./cf-agent -V
CFEngine Core 3.5.3
$ ./cf-agent -f /tmp/regarray_bug.cf
2013-12-12T16:37:44+0200 notice: /example1: R: example1: Found in list
2013-12-12T16:37:44+0200 notice: /example2: R: example2: Found in list
$ ./cf-agent -V
CFEngine Core 3.6.0a1.bc38eab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment