ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Checker.py
Revision: 1.15
Committed: Thu Jan 8 16:08:47 2009 UTC (16 years, 3 months ago) by slacapra
Content type: text/x-python
Branch: MAIN
Changes since 1.14: +7 -1 lines
Log Message:
input of cleanForBlackWhiteList is a list!

File Contents

# User Rev Content
1 slacapra 1.1 from Actor import *
2     import common
3    
4     class Checker(Actor):
5     def __init__(self, cfg_params, nj_list):
6     self.cfg_params = cfg_params
7     self.nj_list = nj_list
8 slacapra 1.14 from WMCore.SiteScreening.BlackWhiteListParser import SEBlackWhiteListParser
9     seWhiteList = cfg_params.get('EDG.se_white_list',[])
10     seBlackList = cfg_params.get('EDG.se_black_list',[])
11     self.blackWhiteListParser = SEBlackWhiteListParser(seWhiteList, seBlackList, common.logger)
12 slacapra 1.1 return
13 ewv 1.9
14 slacapra 1.1 def run(self):
15     """
16     The main method of the class.
17     """
18     common.logger.debug(5, "Checker::run() called")
19    
20     if len(self.nj_list)==0:
21     common.logger.debug(5, "No jobs to check")
22     return
23 slacapra 1.10
24 spiga 1.11 task=common._db.getTask(self.nj_list)
25 slacapra 1.10 allMatch={}
26 slacapra 1.15 # datasetpath=self.cfg_params['CMSSW.datasetpath']
27     # if string.lower(datasetpath)=='none':
28     # datasetpath = None
29    
30 spiga 1.11 for job in task.jobs:
31 spiga 1.12 id_job = job['jobId']
32 slacapra 1.15 jobDest = job['dlsDestination']
33     if not jobDest: jobDest=[]
34     dest = self.blackWhiteListParser.cleanForBlackWhiteList(jobDest, True)
35 slacapra 1.14
36 slacapra 1.10 if dest in allMatch.keys():
37     common.logger.message("As previous job: "+str(allMatch[dest]))
38 ewv 1.9 else:
39 spiga 1.13 match = common.scheduler.listMatch(dest, True)
40 spiga 1.11 # allMatch[job['dlsDestination']]= match
41 slacapra 1.10 if len(match)>0:
42     common.logger.message("Found "+str(len(match))+" compatible site(s) for job "+str(id_job)+" : "+str(match))
43     else:
44     common.logger.message("No compatible site found, will not submit jobs "+str(id_job))
45 slacapra 1.1
46     return