[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: method: returnclasses not working
From: |
Brian Elliott |
Subject: |
Re: method: returnclasses not working |
Date: |
14 Jul 2005 17:15:30 -0700 |
User-agent: |
G2/0.2 |
So I changed my first example based on the docs Knut linked above. It's
still not working for me.
----------------------
# test-method.cf
control:
any::
actionsequence = ( methods )
AddInstallable = ( TestMethod_class1 )
methods:
any::
TestMethod(null)
action=method:TestMethod.cf
returnclasses=class1
server=localhost
alerts:
TestMethod_class1::
"class1 was defined in method TestMethod"
----------------------------------
# method:TestMethod.cf
control:
any::
ModuleName = ( TestMethod )
MethodParameters = ( null )
actionsequence = ( shellcommands )
shellcommands:
any::
"/bin/echo foo" define=class1
alerts:
class1::
"class1 defined!"
ReturnClasses(class1)
---------------------------------------------------------
% cfagent -q -K -v -f ./method-test.cf
--[snip]--
cfengine:: Finished local method /var/cfengine/bin/cfagent -f
/var/cfengine/modules/method:TestMethod.cf -K -v -Z
MD5=37a6259cc0c1dae299a7866489dff0bd processing
---------------------------------------------------------------------
Fetching replies to finished methods
---------------------------------------------------------------------
Looking at method (TestMethod:Reply) from (localhost) intended for exec
on (localhost) with arghash MD5=37a6259cc0c1dae299a7866489dff0bd
Found a local approval to forward reply from local method
(TestMethod:Reply) to final destination sender localhost
New state
rpc_in_localhost_localhost_TestMethod_Reply_MD5_37a6259cc0c1dae299a7866489dff0bd_MD5_37a6259cc0c1dae299a7866489dff0bd
with expiry 1818193513, policy 1818321775
(Re)Set persistent state
rpc_in_localhost_localhost_TestMethod_Reply_MD5_37a6259cc0c1dae299a7866489dff0bd_MD5_37a6259cc0c1dae299a7866489dff0bd
for 1 minutes
Opening bundle
localhost_localhost_TestMethod:Reply_MD5=37a6259cc0c1dae299a7866489dff0bd
---------------------------------------------------------------------
Alerts
---------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++
Summary of objects involved
++++++++++++++++++++++++++++++++++++++++
global
main
As you can see, I'm still not getting the alert output from
method-test.cf. I even tried being extra thorough and added
AddInstallable = ( TestModule_class1 ) to method-test.cf and classes:
class1 = ( any ) to method:TestModule.cf with no success.
I'm using cfengine-2.1.15 and I can provide complete debug logs if
anyone is interested.
BTW, I was using http://www.cfengine.org/docs/cfengine-Reference.html
as my reference doc (go figure...) and I don't see where it says I need
to prefix the class with 'modulename_'. There's mention about prefixing
variables, but that's it. So at the very least, there's a document bug.
I'd love to get some real evidence that this feature works, rather than
bickering over how it's _supposed_ to work ;)
Thanks,
-Brian