Aleksey is correct here - a string, which may contain variables to be expanded, 
is interpreted as a class, and the promise is evaluated if the resulting 
classname is true.

So if the variable "foo" contains the 3 letters "baz", then  ifvarclass => 
"foo$(foo)"  will allow the promise to be executed if the class named "foobaz" 
is defined.

-Dan

On Jul 19, 2011, at 2:32 PM, Aleksey Tsalolikhin wrote:

> Thanks for the correction, Seva, I certainly don't want to produce
> a misunderstanding.
> 
> Reference manual states:
> 
>    Cfengine 3 has a new class predicate ifvarclass
>    which is ANDed with the normal class expression,
>    and which is evaluated together with the promise.
>    It may contain variables as long as the resulting
>    expansion is a legal class expression.
> 
> Most simply, it's a class expression that may contain
> variables; whereas normal class expressions may not
> contain variables.
> 
> Thanks,
> -at
> 
> 
> 
> On Tue, Jul 19, 2011 at 10:57 AM, Seva Gluschenko
> <seva.glusche...@gmail.com> wrote:
>> Aleksey,
>> 
>> your statement sounds very new to me. IMHO, it may produce severe
>> misunderstanding.
>> 
>> The "ifvarclass" attribute does NOT allows one to treat a variable as
>> a class, it only allows to check whether different classes were
>> defined using a variable.
>> 
>> 2011/7/19 Aleksey Tsalolikhin <atsaloli.t...@gmail.com>:
>>> Hi, jordy.  Also check out "ifvarclass" promise attribute -- it's for
>>> using variables as classes.
>>> It's recommended to use it with the canonify function.
>>> 
>>> Best,
>>> -at
>>> _______________________________________________
>>> Help-cfengine mailing list
>>> Help-cfengine@cfengine.org
>>> https://cfengine.org/mailman/listinfo/help-cfengine
>>> 
>> 
>> 
>> 
>> --
>> SY, Seva Gluschenko.
>> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to