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 execut
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 variabl
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 :
> Hi, jordy
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/list
This might help... I execute a command and wrap it up with the canonify
function.
vars:
"linux_machine_model" string =>
canonify(execresult("/usr/sbin/dmidecode -s system-product-name","noshell"));
Canonify is a function that will “sanitize” the input to make i
Forum: CFEngine Help
Subject: Variable Class Names
Author: jordy
Link to topic: https://cfengine.com/forum/read.php?3,22838,22838#msg-22838
Hi!!
I think this question can be a newbie question, but I've searched for answers
and I can't find any.
I have a variable that can have different strings