help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

methods - is it possible to get some sort of return value?


From: Knut Auvor Grythe
Subject: methods - is it possible to get some sort of return value?
Date: Mon, 13 Jun 2005 14:40:35 +0200
User-agent: Mutt/1.4.2i

In our cfengine setup we have a few tasks we do a lot of different
places in our config directory. I would like to abstract this in some
way, and methods seen to be designed for the purpose.

Inside this method I would like some tests to be performed, and classes
to be defined accordingly. However, I would like to be able to define
what class to be returned on a per-invocation basis, like the define= in
copy. In other words, I need a return value.

I am thinking about something like this:

   methods:
       all::
           whatever(/local/foo,bar,baz)
               action=whatever.cfm
               define=foo_whatevered

        linux:
           whatever(/local/linux,blorb,w00t)
              action=whatever.cfm
              define=linux_whatevered

For a while I thought returnclasses would be the thing I wanted, but I
then realized I would probably need to enter all possible defines in the
method file, and that would probably cancel out the gain of using the
method in the first place.

Is there some way to do this? Perhaps by defining classes dynamically
in some way? 

-- 
Knut Auvor Grythe
ITEA Systemdrift




reply via email to

[Prev in Thread] Current Thread [Next in Thread]