On 21-06-11 21:49, Seva Gluschenko wrote: > I'm not sure if I've read you right, but if you mean that or => "" > works and or => {} doesn't, perhaps, it's high time to file a bug > report about that, because it must be strictly the opposite. > That is correct the "" works and { } doesn't, see: {{{ >>>> "PBS_MOM_1" or => "NODES"; >>>> "PBS_MOM_2" or => { "NODES" };
PBS_MON_1 gets defined (with waring message" and PBS_MOM_2 not. > 2011/6/21 Bas van der Vlies<b...@sara.nl>: >> >> On 21 jun 2011, at 16:47, Seva Gluschenko wrote: >> >>> Well, or => must be followed by a list { }, and expression => must be >>> followed by a string "", definitely. Perhaps, your tests were >>> unsuccessful because of wrong definitions for expressions defining >>> NO_PBS_MOM and NODES. >>> >> >> Seva, >> >> Thanks for the explanation. I have misread the expression syntax and >> finally i understand how to use expressions ;-). >> >> >> The working examples for 'or' and 'and' are strings and not lists. If an >> list is used the the tests will fail. Is this an issue? >> >> regards >> >>> 2011/6/21 Bas van der Vlies<b...@sara.nl>: >>>> On 17-06-11 16:17, Bas van der Vlies wrote: >>>>> >>>>> On 17 jun 2011, at 15:07, Seva Gluschenko wrote: >>>>> >>>>>> I'd rather rewrote it as follows: >>>> >>>> I have done some experiments and was a bit surprise over the outcome, maybe >>>> some can explain to me why some work and others not: >>>> * reference is: >>>> http://cfengine.com/manuals/cf3-reference.html#classes-in-common-promises >>>> >>>> Here is my example: >>>> body common control >>>> { >>>> >>>> bundlesequence => { >>>> "test" >>>> }; >>>> >>>> # inputs => { >>>> # "cfengine_stdlib.cf", >>>> # }; >>>> } >>>> >>>> bundle agent test { >>>> classes: >>>> "NO_PBS_MOM" expression => { classify("gb-r7n1.irc.sara.nl") >>>> }; >>>> "NODES" expression => { regcmp( ".*r[0-9]+n[0-9].*", >>>> "$(sys.host)") }; >>>> # >>>> ## >>>> http://cfengine.com/manuals/cf3-reference.html#classes-in-common-promises >>>> # >>>> "PBS_MOM_1" or => "NODES"; >>>> "PBS_MOM_2" or => { "NODES" }; >>>> "PBS_MOM_3" or => "NODES|NO_PBS_MOM"; >>>> "PBS_MOM_4" or => { "NODES", "NO_PBS_MOM" }; >>>> >>>> "PBS_MOM_5" and => "NODES.!NO_PBS_MOM"; >>>> "PBS_MOM_6" and => { "NODES", "NO_PBS_MOM" }; >>>> >>>> "PBS_MOM_7" expression => "NODES"; >>>> "PBS_MOM_8" expression => { "NODES|NO_PBS_MOM" }; >>>> "PBS_MOM_9" expression => "NODES.!NO_PBS_MOM"; >>>> } >>>> >>>> We i run this with cfengine version: 3.2.0a1.r2412M and 3.1.5b4.r2244M >>>> >>>> Only classes: PBS_MOM_1, PBS_MOM_3, PBS_MOM_5 are activated. But i get a >>>> warning: >>>> * RHS of promise body attribute "or" is not a list >>>> >>>> To my surprise classes: PBS_MOM_2, PBS_MOM_4, and the expression classes >>>> are not set. Is there something wrong in the parsing of classes? >>>> >>>> -- >>>> ******************************************************************** >>>> * Bas van der Vlies e-mail: b...@sara.nl * >>>> * SARA - Academic Computing Services Amsterdam, The Netherlands * >>>> ******************************************************************** >>>> _______________________________________________ >>>> Help-cfengine mailing list >>>> Help-cfengine@cfengine.org >>>> https://cfengine.org/mailman/listinfo/help-cfengine >>>> >>> >>> >>> >>> -- >>> SY, Seva Gluschenko. >> >> -- >> Bas van der Vlies >> b...@sara.nl >> >> >> >> > > > -- ******************************************************************** * Bas van der Vlies e-mail: b...@sara.nl * * SARA - Academic Computing Services Amsterdam, The Netherlands * ******************************************************************** _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine