[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: method: returnclasses not working
From: |
Mark Burgess |
Subject: |
Re: method: returnclasses not working |
Date: |
Thu, 14 Jul 2005 23:40:32 +0200 |
There is nothing wrong with the examples, The class is referred to as
BackupLapTop_done
as it shows in AddInstallable, or
GetEnvironmentAnalysis_class1::
"Method got returnval : $(GetEnvironmentAnalysis.a)"
in the other example. You have to read the whole example. But I admit
that the reference manual is unclear.
M
On Thu, 2005-07-14 at 23:14 +0200, Knut Auvor Grythe wrote:
> On Thu, Jul 14, 2005 at 09:49:39PM +0200, Mark Burgess wrote:
> > Brian - read the docs. Your class has to be prefixed with
> > the module name
>
> Oh, so the last example in http://www.cfengine.org/confdir/methods.html
> is simply wrong? Relevant snippets:
>
> control:
> MethodName = ( GetEnvironmentAnalysis )
>
> classes:
> class1 = ( any )
>
> alerts:
> ReturnClasses(class1,class2)
>
> I used that example to make my method, but couldn't manage to get it
> working. I saw "# Note that the return variables are prefixed with the
> method space" in the example before that, and based on that I assumed
> this was done automatically. After all, the term used was "are", not
> "must be". I therefore tried various combinations of prefixing in the
> cfagent.conf file calling the method, with no luck.
>
> In another example, http://www.cfengine.org/confdir/backup.html, the
> class "done" is returned from a method called BackupLapTop. Is this also
> wrong?
>
> I must say that these particular sites are kind of confusing. Are there
> some other docs on methods one should rather read? If not, isn't it kind
> of silly to criticise people for not reading the docs if the docs are
> filled with malfunctioning examples?
>
> Oh well, enough whining, let's be a bit constructive instead =)
> It would be really nice if cfengine could issue a warning about this
> instead of just silently omitting the class. It would certainly be
> helpful for debugging.
>