[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
order matters in "alerts" section of methods
From: |
Scott A. Woods |
Subject: |
order matters in "alerts" section of methods |
Date: |
27 Jun 2004 21:29:02 -0000 |
Hi,
I found the following unexpected behavior while working with methods:
"ReturnClasses" seems to get ignored if it's not the last item in the method's
alerts section.
This is perhaps an overgeneralization, since I haven't performed that many test
cases. However, here is a cfagent.conf and a cf.simple method that illustrate
the behavior:
#-------------------------------------
# cfagent.conf
control:
any::
actionsequence = ( methods )
AddInstallable = ( Simple_created_test_link )
methods:
any::
Simple(void)
action=cf.simple
returnvars=null
returnclasses=created_test_link
server=localhost
alerts:
Simple_created_test_link::
"Result class received by parent."
--------------------------------------
--------------------------------------
# cf.simple
control:
any::
MethodName = ( Simple )
MethodParameters = ( null )
actionsequence = ( links )
AddInstallable = ( created_test_link )
links:
any::
/tmp/simple_method_works ->! /dev/null
define=created_test_link
alerts:
created_test_link::
"child defined result class"
any::
ReturnVariables(void)
ReturnClasses(created_test_link)
--------------------------------------
This works as expected, and the parent receives the "created_test_link" class
as "Simple_created_test_link":
# rm /tmp/simple_method_works ; cfagent -q -D test_woods
cfengine:tessera:Simple: cfengine:: child defined result class
cfengine:tessera: Result class received by parent.
However, if I reverse the order of the two statements in the method's alert
section like this:
----------------
# [snip]
created_test_link::
"child defined result class"
any::
ReturnVariables(void)
ReturnClasses(created_test_link)
-----------------
Then the parent class does not receive the
"created_test_link" class:
# rm /tmp/simple_method_works ; cfagent -q -D test_woods
cfengine:tessera:Simple: cfengine:: child defined result class
The "-D test_woods" is just to tell update.conf to use my test tree rather than
the production tree.
This is using a snapshot of the source from yesterday (26 June 2004). The
machine is running linux; Fedora Core 1.
I've posted both files, and the verbose/debug output of cfagent for both cases
here:
http://mir.essc.psu.edu/tmp/cfengine/
-- Scott
- order matters in "alerts" section of methods,
Scott A. Woods <=