Skip to content

Commit

Permalink
Fixes #11729: eval usage is not compatible with CFEngine < 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Normation GIT merger authored and amousset committed Nov 14, 2017
2 parents 5eee98f + 9cd4d0c commit 9118e12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ body common control
bundle agent init
{
vars:
!aix::
debian::
"service_name" string => "cron";
redhat::
"service_name" string => "crond";
aix::
"service_name" string => "syslogd";
}
Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/30_generic_methods/unsafe/service_reload.cf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ bundle agent init
{
vars:
redhat::
"service_script" string => "sshd";
"service_script" string => "crond";
aix::
"service_script" string => "syslogd";
!(redhat|aix)::
"service_script" string => "ssh";
debian::
"service_script" string => "cron";
}

#######################################################
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/30_generic_methods/unsafe/service_start.cf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ body common control
bundle agent init
{
vars:
!aix::
debian::
"service_name" string => "cron";
redhat::
"service_name" string => "crond";
aix::
"service_name" string => "syslogd";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bundle agent variable_string_from_math_expression(variable_prefix, variable_name
"args" slist => { "${variable_prefix}", "${variable_name}", "${expression}", "${format}" };

# define the variable within the variable_prefix namespace
"temp" string => eval("${expression}");
"temp" string => eval("${expression}", "math", "infix");
"${variable_prefix}.${variable_name}" string => format("${format}", "${temp}");

classes:
Expand Down

0 comments on commit 9118e12

Please sign in to comment.