11 |
|
import common |
12 |
|
import os |
13 |
|
import socket |
14 |
< |
import sha |
14 |
> |
|
15 |
> |
# FUTURE: for python 2.4 & 2.6 |
16 |
> |
try: |
17 |
> |
from hashlib import sha1 |
18 |
> |
except: |
19 |
> |
from sha import sha as sha1 |
20 |
|
|
21 |
|
class SchedulerCondor(SchedulerLocal) : |
22 |
|
""" |
30 |
|
SchedulerLocal.__init__(self,"CONDOR") |
31 |
|
self.datasetPath = None |
32 |
|
self.selectNoInput = None |
28 |
– |
self.return_data = 0 |
29 |
– |
self.copy_data = 0 |
33 |
|
|
34 |
|
self.environment_unique_identifier = None |
35 |
|
return |
42 |
|
|
43 |
|
SchedulerLocal.configure(self, cfg_params) |
44 |
|
|
45 |
+ |
self.proxyValid=0 |
46 |
+ |
self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0)) |
47 |
+ |
self.space_token = cfg_params.get("USER.space_token",None) |
48 |
+ |
try: |
49 |
+ |
self.proxyServer = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/").config("myproxy_server.conf") |
50 |
+ |
self.proxyServer = self.proxyServer.strip() |
51 |
+ |
if self.proxyServer is None: |
52 |
+ |
raise CrabException("myproxy_server.conf retrieved but empty") |
53 |
+ |
except Exception, e: |
54 |
+ |
common.logger.info("Problem setting myproxy server endpoint: using myproxy.cern.ch") |
55 |
+ |
common.logger.debug(e) |
56 |
+ |
self.proxyServer= 'myproxy.cern.ch' |
57 |
+ |
self.group = cfg_params.get("GRID.group", None) |
58 |
+ |
self.role = cfg_params.get("GRID.role", None) |
59 |
+ |
self.VO = cfg_params.get('GRID.virtual_organization','cms') |
60 |
+ |
|
61 |
|
try: |
62 |
|
tmp = cfg_params['CMSSW.datasetpath'] |
63 |
|
if tmp.lower() == 'none': |
70 |
|
msg = "Error: datasetpath not defined " |
71 |
|
raise CrabException(msg) |
72 |
|
|
54 |
– |
self.return_data = cfg_params.get('USER.return_data', 0) |
55 |
– |
self.copy_data = cfg_params.get("USER.copy_data", 0) |
56 |
– |
|
57 |
– |
self.proxyValid = 0 |
58 |
– |
self.dontCheckProxy = int(cfg_params.get("GRID.dont_check_proxy", 0)) |
59 |
– |
self.proxyServer = cfg_params.get("GRID.proxy_server", 'myproxy.cern.ch') |
60 |
– |
common.logger.debug('Setting myproxy server to ' + self.proxyServer) |
61 |
– |
|
62 |
– |
self.group = cfg_params.get("GRID.group", None) |
63 |
– |
self.role = cfg_params.get("GRID.role", None) |
64 |
– |
self.VO = cfg_params.get('GRID.virtual_organization', 'cms') |
65 |
– |
|
73 |
|
self.checkProxy() |
74 |
|
|
75 |
|
return |
76 |
|
|
77 |
|
def envUniqueID(self): |
78 |
< |
taskHash = sha.new(common._db.queryTask('name')).hexdigest() |
78 |
> |
taskHash = sha1(common._db.queryTask('name')).hexdigest() |
79 |
|
id = "https://" + socket.gethostname() + '/' + taskHash + "/${NJob}" |
80 |
|
return id |
81 |
|
|