ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/CleanerServer.py
Revision: 1.1
Committed: Tue Jul 17 17:56:09 2007 UTC (17 years, 9 months ago) by mcinquil
Content type: text/x-python
Branch: MAIN
CVS Tags: PRODCOMMON_0_10_7_testCS2, CRAB_2_2_1_pre3, CRAB_2_2_1_pre2, CRAB_2_2_1_pre1, CRAB_2_2_0, CRAB_2_2_0_pre21, CRAB_2_2_0_pre19, CRAB_2_2_0_pre18, CRAB_2_2_0_pre17, CRAB_2_2_0_pre16, CRAB_2_2_0_pre15, CRAB_2_2_0_pre13, CRAB_2_2_0_pre12, CRAB_2_2_0_pre11, CRAB_2_2_0_pre10, bp_osg_bdii, CRAB_2_2_0_pre9, CRAB_2_2_0_pre8, CRAB_2_2_0_pre7, CRAB_2_1_2, CRAB_2_2_0_pre5, CRAB_2_1_2_pre2, CRAB_2_1_2_pre1, CRAB_2_2_0_pre4, CRAB_2_2_0_pre2, CRAB_2_1_1, CRAB_2_1_1_pre3, CRAB_2_2_0_pre1, CRAB_2_1_1_pre1, CRAB_2_1_0, CRAB_2_1_0_pre6, CRAB_2_1_0_pre5, CRAB_2_1_0_pre4, CRAB_2_1_0_pre3, CRAB_2_1_0_pre2, CRAB_2_1_0_pre1, CRAB_2_0_4, CRAB_2_0_4_pre2, CRAB_2_0_4_pre1, CRAB_2_0_3, CRAB_2_0_3_pre1, CRAB_2_0_2, CRAB_2_0_2_pre6, CRAB_2_0_2_pre5, CRAB_2_0_2_pre4, CRAB_2_0_2_pre3, CRAB_1_5_4_SLC3, CRAB_1_5_4_SLC3_pre4, CRAB_2_0_2_pre2, CRAB_2_0_2_pre1, CRAB_1_5_4_SLC3_pre3, CRAB_2_0_1, CRAB_1_5_4_SLC3_pre2, CRAB_2_0_1_pre1, CRAB_1_5_4_SLC3_pre1, CRAB_2_0_0, CRAB_2_0_0_pre10, CRAB_2_0_0_pre9, CRAB_1_5_4, CRAB_1_5_4_pre2, CRAB_1_5_4_pre1, CRAB_2_0_0_pre7, CRAB_2_0_0_pre6, CRAB_1_5_3, CRAB_1_5_3_pre5, CRAB_1_5_3_pre4
Branch point for: osg_bdii, CRAB_2_1_2_br, CRAB_2_1_1_pre2, CRAB_1_5_4_SLC3_pre4_br, CRAB_1_5_4_SLC3_start
Log Message:
Cleaner for tasks submitted through the server

File Contents

# User Rev Content
1 mcinquil 1.1 from Actor import *
2     from crab_exceptions import *
3     from crab_logger import Logger
4     from StatusServer import StatusServer
5     import common
6     import string
7    
8     class CleanerServer(Actor):
9     def __init__(self, cfg_params):
10     """
11     constructor
12     """
13     self.cfg_params = cfg_params
14    
15     def check(self):
16     """
17     Check whether no job is still running or not yet retrieved
18     """
19     obj = StatusServer(self.cfg_params)
20     obj.run()
21    
22     pass
23    
24     def run(self):
25     """
26     remove all
27     """
28     if common.jobDB.nJobs()>0:
29     self.check()
30    
31     countEnded = 0
32     for nj in range(common.jobDB.nJobs()):
33     if common.jobDB.status(nj) in ['Y','K', 'A', 'C']:
34     countEnded += 1
35     if countEnded == common.jobDB.nJobs():
36     tempWorkSpace = common.work_space.topDir()
37     common.scheduler.clean()
38     common.work_space.delete()
39     print ( 'crab. directory '+tempWorkSpace+' removed' )
40     else:
41     common.logger.message ( 'Impossible to remove: not all jobs are yet finished\n (you maight kill these jobs and then clean the task)')