On 01/15/2015 12:26 PM, Kermit Short wrote:
> OK, I guess I'm not entirely straight in my head yet. When you set a
> soft class, is it available globally? I guess what I'm asking is, are
> classes like variables? Do they have lexical scope, or is a class a
> class, and once it is set, it is set and the agent can evaluate against
> it throughout any of the 3 run cycles, in any bundle or body?
Classes do have scopes.
Classes promises may be made in any bundle. By default Classes that are
set in common bundles are global in scope, while classes in all other
bundles are local.
https://docs.cfengine.com/latest/reference-promise-types-classes.html#scope
Classes set as the result of a promise outcome by default are global in
scope.
https://docs.cfengine.com/latest/reference-promise-types.html#scope
Note: global and namespace are used interchangeably.
By default a global class will persist until the end of the agent run or
it is specifically undefined.
https://docs.cfengine.com/latest/reference-promise-types-classes.html#persistence
https://docs.cfengine.com/latest/reference-promise-types.html#cancel_kept
>
> And Nick, you're right, of course. I guess it would be better to start
> documenting what I've got while the body of policies is small, so I
> don't have such an arduous task if I saved it for later. I hate doing
> documentation, but this seems pretty light on effort, so I better build
> good habits up front!
That's the idea, you don't have to write a huge document. Just add bits
of information so that later you can trace it.
> Thanks, and sorry for all the traffic on this issue!
Thats what the list is for!