ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/CleanerServer.py
Revision: 1.2
Committed: Thu May 29 10:46:41 2008 UTC (16 years, 11 months ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_4_1, CRAB_2_4_1_pre4, CRAB_2_4_1_pre3, CRAB_2_4_1_pre2, CRAB_2_4_1_pre1, CRAB_2_4_0_Tutorial, CRAB_2_4_0_Tutorial_pre1, CRAB_2_4_0, CRAB_2_4_0_pre9, CRAB_2_4_0_pre8, CRAB_2_4_0_pre7, CRAB_2_4_0_pre6, CRAB_2_4_0_pre5, CRAB_2_4_0_pre4, CRAB_2_4_0_pre3, CRAB_2_4_0_pre2, CRAB_2_4_0_pre1, CRAB_DLS_PHED1, CRAB_DLS_PHED, CRAB_2_3_2_Fnal, CRAB_2_3_2, CRAB_2_3_2_pre7, CRAB_2_3_2_pre5, CRAB_2_3_2_pre4, CRAB_2_3_2_pre3, CRAB_2_3_2_pre2, CRAB_2_3_2_pre1, CRAB_2_4_0_test, CRAB_2_3_1, CRAB_2_3_1_pre6, CRAB_2_3_1_pre5, CRAB_2_3_1_pre4, CRAB_2_3_1_pre3, CRAB_2_3_1_pre2, CRAB_2_3_1_pre1, CRAB_2_3_0, CRAB_2_3_0_pre6, CRAB_2_3_0_pre1, CRAB_2_2_2_pre5, CRAB_2_2_2_pre4, CRAB_2_2_2_pre3, CRAB_2_2_2_pre2, CRAB_2_2_2_pre1, CRAB_2_2_1, CRAB_2_2_1_pre6, CRAB_2_2_1_pre5, CRAB_2_2_1_pre4
Branch point for: AnaDataSet, CRAB_2_3_0_br
Changes since 1.1: +6 -1 lines
Log Message:
cleaner Server not yet ready.

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 spiga 1.2
28 mcinquil 1.1 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)')
42 spiga 1.2 """
43     msg=''
44     msg+='functionality not yet available for the server. Work in progres \n'
45     msg+='planned for CRAB_2_2_3'
46     common.logger.message(msg)