help-cfengine
[Top][All Lists]
Advanced

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

upgrading from version 2.0.1 to 2.0.3


From: Sabrina Lautier
Subject: upgrading from version 2.0.1 to 2.0.3
Date: Fri, 02 Aug 2002 17:31:48 +0200

Hi !

Before upgrading to cfengine 2.0.3, with cfengine 2.0.1 my script 
worked fine, I mean, the way I wanted it to work...

Here is how it looks like:
*****************************************************
control:
  moduledirectory = ( /usr/local/cfengine/modules )
  AddInstallable = ( module_exec_ok )
  actionsequence = ( "module:test module_exec_ok" )

  # Echo a message to the screen depending on the previous
  # module execution
  module_exec_ok::
    actionsequence = ( shellcommands.ok )
  !module_exec_ok::
    actionsequence = ( shellcommands.error )

shellcommands:
  ok::
     "/bin/echo ok"
  error::
     "/bin/echo error"
*****************************************************
Here is the way I expect it to work: it calls the cfengine 
module 'module:test' with the class to be activated as argument.
This module activate the class 'module_exec_ok' if no error occured 
during its execution (Cf perl script below).
If no error, it executes the action shellcommands.ok which 
prints 'ok' to the screen otherwise it executes the action 
shellcommands.error which prints 'error'.

*****************************************************
#!/usr/bin/perl
#
# module:test
#
$specialclass = $ARGV[0];
# some computation....
if (<no error>) {
   print "+$specialclass";
   exit 0;
}
*****************************************************

This works perfectly with cfengine 2.0.1, but with version 2.0.3, 
cfengine always executes shellcommands.error even if the 
class 'module_exec_ok' has been activated.
It's like it parses the whole script once before its execution and 
then defines the action to be done without considering the further 
class activation.
As the class 'module_exec_ok' is not defined before the module call, 
cfengine simply considers that the actionsequence is:
actionsequence = ( "module:test module_exec_ok" shellcommands.error )

Well that's the way I've analysed it according to the traces of the 
verbose execution.

Is this a cfengine bug corrected in version 2.0.4 or is it the way 
you want it now to work ?
Any explanations will be greatly appreciated as my whole script is 
based on this principle...
Thanks.

Sabrina

---------------------------------------------
Powered by Alinto (http://www.alinto.net)
        for lavache.com (http://www.lavacheautomatique.com)



reply via email to

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