This is the corrected example, with the altered syntax.

########################################################
#
# Simple test execution
#
########################################################

body common control

{
bundlesequence  => { "testbundle"  };
}

########################################################

bundle agent testbundle

{
vars:

  "size" int => "46k";
  "rand" int => randomint("33","$(size)");

commands:

  "/bin/echo"
     args => "Hello world - $(size)/$(rand)",
     contain => standard,
     classes => cdefine("followup","alert");

  followup::

     "/bin/ls"
       contain => standard;

reports:

  alert::

     "What happened?";

}

######################################################################

body contain standard

{
exec_owner => "mark";
useshell => "true";
}

######################################################################

body classes cdefine(class,alert)

{
promise_repaired => { "$(class)" };
repair_failed => { "$(alert)" };
}


Joseph VanAndel wrote:
> I've created /tmp/test.cf, containing the example cfengine test from "  
> section 1.4  Familiarizing yourself " of the documentation.
> 
> Using cfengine 3.0.0.b6 on CentOS 5.2, cf-promises -f /tmp/test.cf, I  
> get the result:
> 
> cf3:/tmp/test.cf:38,27: Constraint lvalue on_change is not allowed in  
> 'classes' constraint near token '}'
> cf3:/tmp/test.cf:38,27: Constraint lvalue on_failure is not allowed in  
> 'classes' constraint near token '}'
> 
> I don't want to be overly critical, but it is hard to understand why  
> an example copied/pasted straight from the documentation  does not  
> seem to work.  Is the example wrong, or does cfengine3 have a bug?
> 
> _______________________________________________
> Bug-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/bug-cfengine

-- 


Mark Burgess

Web: http://www.iu.hio.no/~mark
Tlf: +47 22453272
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to