ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/CleanerServer.py
Revision: 1.11
Committed: Wed Apr 28 15:15:28 2010 UTC (15 years ago) by mcinquil
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_9_1, CRAB_2_9_1_pre2, CRAB_2_9_1_pre1, CRAB_2_9_0, CRAB_2_9_0_pre2, CRAB_2_9_0_pre1, CRAB_2_8_8, CRAB_2_8_8_pre1, CRAB_2_8_7_patch3, CRAB_2_8_7_patch2, CRAB_2_8_7_patch1, CRAB_2_8_7, CRAB_2_8_7_pre2, CRAB_2_8_7_pre1, CRAB_2_8_6, CRAB_2_8_6_pre1, CRAB_2_8_5_patch3, CRAB_2_8_5_patch2, CRAB_2_8_5_patch1, CRAB_2_8_5, CRAB_2_8_5_pre5, CRAB_2_8_5_pre4, CRAB_2_8_5_pre3, CRAB_2_8_4_patch3, CRAB_2_8_5_pre2, CRAB_2_8_4_patch2, CRAB_2_8_5_pre1, CRAB_2_8_4_patch1, CRAB_2_8_4, CRAB_2_8_4_pre5, CRAB_2_8_4_pre4, CRAB_2_8_4_pre3, CRAB_2_8_4_pre2, CRAB_2_8_4_pre1, CRAB_2_8_3, CRAB_2_8_3_pre4, CRAB_2_8_3_pre3, CRAB_2_8_3_pre2, CRAB_2_8_3_pre1, CRAB_2_8_2_patch1, CRAB_2_8_2, CRAB_2_8_2_pre5, CRAB_2_8_2_pre4, CRAB_2_8_2_pre3, CRAB_2_8_2_pre2, CRAB_2_8_2_pre1, CRAB_2_8_1, CRAB_2_8_0, CRAB_2_8_0_pre1, CRAB_2_7_10_pre3, CRAB_2_7_9_patch2_pre1, CRAB_2_7_10_pre2, CRAB_2_7_10_pre1, CRAB_2_7_9_patch1, CRAB_2_7_9, CRAB_2_7_9_pre5, CRAB_2_7_9_pre4, CRAB_2_7_9_pre3, CRAB_2_7_9_pre2, CRAB_2_7_8_patch2, CRAB_2_7_9_pre1, CRAB_2_7_8_patch2_pre1, CRAB_2_7_8_patch1, CRAB_2_7_8_patch1_pre1, CRAB_2_7_8, CRAB_2_7_8_pre3, CRAB_2_7_8_pre2, CRAB_2_7_8_dash3, CRAB_2_7_8_dash2, CRAB_2_7_8_dash, CRAB_2_7_7_patch1, CRAB_2_7_7_patch1_pre1, CRAB_2_7_8_pre1, CRAB_2_7_7, CRAB_2_7_7_pre2, CRAB_2_7_7_pre1, CRAB_2_7_6_patch1, CRAB_2_7_6, CRAB_2_7_6_pre1, CRAB_2_7_5_patch1, CRAB_2_7_5, CRAB_2_7_5_pre3, CRAB_2_7_5_pre2, CRAB_2_7_5_pre1, CRAB_2_7_4_patch1, CRAB_2_7_4, CRAB_2_7_4_pre6, CRAB_2_7_4_pre5, CRAB_2_7_4_pre4, CRAB_2_7_4_pre3, CRAB_2_7_4_pre2, CRAB_2_7_4_pre1, CRAB_2_7_3, CRAB_2_7_3_pre3, CRAB_2_7_3_pre3_beta, CRAB_2_7_3_pre2, CRAB_2_7_3_pre2_beta, CRAB_2_7_3_pre1, CRAB_2_7_3_beta3, CRAB_2_7_3_beta2, CRAB_2_7_3_beta1, CRAB_2_7_3_beta, HEAD
Changes since 1.10: +3 -1 lines
Log Message:
warning message on c-s communication at the end

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 mcinquil 1.11 warning_msg = stat.resynchClientSide()
28     if warning_msg is not None:
29     common.logger.info(warning_msg)
30 spiga 1.3 except:
31     pass
32 farinafa 1.7
33     # check whether the action is allowable
34 farinafa 1.10 self.check()
35 mcinquil 1.1
36 farinafa 1.7 # notify the server to clean the task
37     csCommunicator = ServerCommunicator(self.server_name, self.server_port, self.cfg_params)
38     taskuuid = str(common._db.queryTask('name'))
39 spiga 1.2
40 farinafa 1.7 try:
41     csCommunicator.cleanTask(taskuuid)
42     except Exception, e:
43 farinafa 1.9 msg = "Client Server comunication failed about cleanJobs: task \n" + taskuuid
44     msg += "Only local working directory will be removed."
45 farinafa 1.7 common.logger.debug( msg)
46     pass
47 mcinquil 1.1
48 farinafa 1.8 # TODO remove these lines once the integration completed
49     msg=''
50     msg+='functionality not yet available for the server. Work in progres \n'
51     msg+='only local working directory will be removed'
52     common.logger.info(msg)
53     # TODO - end
54    
55 farinafa 1.7 # remove local structures
56 slacapra 1.4 common.work_space.delete()
57     print 'directory '+common.work_space.topDir()+' removed'
58 farinafa 1.7 return
59