On Fri, 11 May 2018 08:24:51 -0700 (PDT) "ole.elgesem via dev-cfengine" <[email protected]> wrote:
oevd> I would like feedback on a new feature. To enable policy which can both be oevd> imported as a library (inputs) and executed on it's own, I've introduced oevd> the *__main__* name for bundles. When the entry policy file has a *__main__* oevd> bundle it will be defined as main, however if it is in another imported oevd> file, it will be removed before evaluation (to avoid conflicting names). oevd> The old main bundle will still work as is. oevd> Please tell me if you think this is useful, or if you have opinions on the oevd> syntax/semantics of this. The current C implementation might be changed. I found names in CFEngine's evaluator to be tricky because of the way variable names and resolution work, and preferred using tags. It's less surprising for the users. So in this case I wonder if adding a `runnable` tag to a bundle would be better than requiring the name to be __main__. Or maybe even support `autorun` in the C code, since it's already fairly standard and users like it. As an added benefit, the tag approach allows multiple bundles in one file to be runnable. Ted -- You received this message because you are subscribed to the Google Groups "dev-cfengine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dev-cfengine/874liru59j.fsf%40lifelogs.com. For more options, visit https://groups.google.com/d/optout.
