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 <[email protected]>:
>> 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: [email protected] *
>> * SARA - Academic Computing Services Amsterdam, The Netherlands *
>> ********************************************************************
>> _______________________________________________
>> Help-cfengine mailing list
>> [email protected]
>> https://cfengine.org/mailman/listinfo/help-cfengine
>>
>
>
>
> --
> SY, Seva Gluschenko.
--
Bas van der Vlies
[email protected]
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine