ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/CleanerServer.py
Revision: 1.10
Committed: Wed Aug 26 12:57:22 2009 UTC (15 years, 8 months ago) by farinafa
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_7_2_p1, CRAB_2_7_1_branch_firstMERGE, CRAB_2_7_2, CRAB_2_7_2_pre4, CRAB_2_7_2_pre3, CRAB_2_7_2_pre2, CRAB_2_7_2_pre1, CRAB_2_7_1, fede_170310, CRAB_2_7_1_pre12, CRAB_2_7_1_pre11, CRAB_2_7_1_pre10, CRAB_2_7_1_pre9, CRAB_LumiMask, CRAB_2_7_lumi, from_LimiMask, CRAB_2_7_1_pre8, CRAB_2_7_1_pre6, CRAB_2_7_1_pre5, CRAB_2_7_1_wmbs_pre4, CRAB_2_7_1_pre4, CRAB_2_7_1_pre3, CRAB_2_6_6_pre6, CRAB_2_7_1_pre2, CRAB_2_6_6_pre5, CRAB_2_7_1_pre1, CRAB_2_6_6_pre4, CRAB_2_6_6_pre3, CRAB_2_6_6_pre2, CRAB_2_6_6_check, CRAB_2_6_6, CRAB_2_6_6_pre1, CRAB_2_7_0, CRAB_2_6_5, CRAB_2_7_0_pre8, CRAB_2_6_5_pre1, CRAB_2_7_0_pre7, CRAB_2_6_4, CRAB_2_7_0_pre6, CRAB_2_6_4_pre1, CRAB_2_7_0_pre5, CRAB_2_6_3_patch_2, CRAB_2_6_3_patch_2_pre2, CRAB_2_6_3_patch_2_pre1, CRAB_2_6_3_patch_1, CRAB_2_7_0_pre4, CRAB_2_7_0_pre3, CRAB_2_6_3, CRAB_2_6_3_pre5, CRAB_2_6_3_pre4, CRAB_2_6_3_pre3, CRAB_2_6_3_pre2, CRAB_2_7_0_pre2, CRAB_2_6_3_pre1, test_1, CRAB_2_7_0_pre1, CRAB_2_6_2, CRAB_2_6_2_pre2
Branch point for: CRAB_multiout, CRAB_2_7_1_branch, Lumi2_8, CRAB_2_6_X_br
Changes since 1.9: +2 -1 lines
Log Message:
Bugfix on CleanerServer client-side. Added a missing catch clause in workspace delete method.

File Contents

# User Rev Content
1 mcinquil 1.1 from Actor import *
2     from crab_exceptions import *
3 farinafa 1.10 from crab_util import *
4 mcinquil 1.1 import common
5     import string
6 farinafa 1.7 from ServerCommunicator import ServerCommunicator
7     from StatusServer import StatusServer
8 farinafa 1.9 from Cleaner import Cleaner
9 farinafa 1.7
10     class CleanerServer(Cleaner):
11 mcinquil 1.1
12     def __init__(self, cfg_params):
13     """
14     constructor
15     """
16 farinafa 1.7 Cleaner.__init__(self, cfg_params)
17 mcinquil 1.1 self.cfg_params = cfg_params
18    
19 farinafa 1.7 # init client server params...
20     CliServerParams(self)
21     return
22    
23     def run(self):
24     # get updated status from server
25 spiga 1.3 try:
26     stat = StatusServer(self.cfg_params)
27     stat.resynchClientSide()
28     except:
29     pass
30 farinafa 1.7
31     # check whether the action is allowable
32 farinafa 1.10 self.check()
33 mcinquil 1.1
34 farinafa 1.7 # notify the server to clean the task
35     csCommunicator = ServerCommunicator(self.server_name, self.server_port, self.cfg_params)
36     taskuuid = str(common._db.queryTask('name'))
37 spiga 1.2
38 farinafa 1.7 try:
39     csCommunicator.cleanTask(taskuuid)
40     except Exception, e:
41 farinafa 1.9 msg = "Client Server comunication failed about cleanJobs: task \n" + taskuuid
42     msg += "Only local working directory will be removed."
43 farinafa 1.7 common.logger.debug( msg)
44     pass
45 mcinquil 1.1
46 farinafa 1.8 # TODO remove these lines once the integration completed
47     msg=''
48     msg+='functionality not yet available for the server. Work in progres \n'
49     msg+='only local working directory will be removed'
50     common.logger.info(msg)
51     # TODO - end
52    
53 farinafa 1.7 # remove local structures
54 slacapra 1.4 common.work_space.delete()
55     print 'directory '+common.work_space.topDir()+' removed'
56 farinafa 1.7 return
57