Hi,

I'm unearthing this old subject because I'm facing a similar issue. I'm 
reading a list of data from a file, and using the values read to copy 
some files. I'd like to have a fine tuned control and report for each 
file (it's a resource consuming process, that I don't want to be done 
over again and again for files that has been already dealt with), and 
i'm using persistant classes named "filename_kept" and "filename_fail" 
to know which file was copied and modified, and which couldn't (so that 
i can try again on them)

I would have expect to be able to do
reports:
    "File $(filename) copied and modified",
       ifvarclass => "$(filename)_kept";

If there is an ifvarclass, then it's not a risk of report explosion (if 
i did my classes well ..)

So I use this work-around, but it doesn't please me much
reports:
    linux|!linux::
        "File $(filename) copied and modified",
           ifvarclass => "$(filename)_kept";

Do you have a more subtile solution ?


nwat...@symcor.com wrote:
> mega...@gmail.com wrote on 2009-09-03 19:11:55:
>   
>> You must use a 'classes' body on the promise in question, and use 
>> that body to set a specific class for 'promise_repaired' action, 
>> lets say 'process_killed'. Then is your reports, you use 
>> 'process_killed", e.g. 
>>
>> reports: 
>>
>> process_killed:: # do this 
>>
>> "Process \'${banned}\' was found to be running and was killed." 
>>
>> ifvarclass => "process_killed"; # OR this 
>> } 
>>     
>
> The problem I'm seeing with list iteration is that the classes defined 
> stay defined throughout the remander of the run.  For example, I have two 
> processes, xfs and sendmail.  During the first iteration xfs is found to 
> be running and is stopped.  Thus the classes process_killed and xfs_killed 
> are set.  These classes are still defined for the next increment from xfs 
> to sendmail.  Thus when ${banned} is equal to sendmail the 'xfs was 
> killed' report will again be reported.
>  
> Sincerely,
> --
> Neil Watson
> 416-673-3465
>
>   
>>>       

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to