7 |
|
from LFNBaseName import * |
8 |
|
|
9 |
|
class PhEDExDatasvcInfo: |
10 |
< |
def __init__( self , cfg_params ): |
10 |
> |
def __init__( self , cfg_params=None, config=None ): |
11 |
|
|
12 |
|
## PhEDEx Data Service URL |
13 |
< |
url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod" |
14 |
< |
self.datasvc_url = cfg_params.get("USER.datasvc_url",url) |
13 |
> |
self.datasvc_url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod" |
14 |
|
|
15 |
|
self.FacOps_savannah = 'https://savannah.cern.ch/support/?func=additem&group=cmscompinfrasup' |
16 |
|
stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabHowTo#Stageout_and_publication' |
17 |
|
self.dataPub_faq = 'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabForPublication' |
18 |
|
|
19 |
+ |
self.usePhedex = True |
20 |
+ |
|
21 |
+ |
if config!=None: |
22 |
+ |
self.checkConfig(config) |
23 |
+ |
else: |
24 |
+ |
self.checkCfgConfig(cfg_params) |
25 |
+ |
|
26 |
+ |
self.sched = common.scheduler.name().upper() |
27 |
+ |
self.protocol = self.srm_version |
28 |
+ |
|
29 |
+ |
|
30 |
+ |
def checkConfig(self,config): |
31 |
+ |
""" |
32 |
+ |
""" |
33 |
+ |
self.srm_version = config.get("srm_version",'srmv2') |
34 |
+ |
self.node = config.get('storage_element',None) |
35 |
+ |
self.lfn='/store/' |
36 |
+ |
|
37 |
+ |
def checkCfgConfig(self,cfg_params): |
38 |
+ |
""" |
39 |
+ |
""" |
40 |
+ |
self.datasvc_url = cfg_params.get("USER.datasvc_url",self.datasvc_url) |
41 |
|
self.srm_version = cfg_params.get("USER.srm_version",'srmv2') |
42 |
|
self.node = cfg_params.get('USER.storage_element',None) |
22 |
– |
|
23 |
– |
|
43 |
|
|
25 |
– |
self.user_lfn = cfg_params.get("USER.lfn",'') |
44 |
|
self.publish_data = cfg_params.get("USER.publish_data",0) |
45 |
|
self.usenamespace = cfg_params.get("USER.usenamespace",0) |
46 |
|
self.user_remote_dir = cfg_params.get("USER.user_remote_dir",'') |
47 |
|
if self.user_remote_dir: |
48 |
|
if ( self.user_remote_dir[-1] != '/' ) : self.user_remote_dir = self.user_remote_dir + '/' |
31 |
– |
if self.user_lfn: |
32 |
– |
msg = 'Warning: lfn has been deprecated, CRAB will ignore it.\n' |
33 |
– |
msg += '\t Please use only user_remote_dir removing lfn from your crab.cfg\n' |
34 |
– |
msg += '\t For further information please visit : \n\t%s'%stage_out_faq |
35 |
– |
common.logger.info(msg) |
49 |
|
|
50 |
|
self.datasetpath = cfg_params.get("CMSSW.datasetpath") |
51 |
|
self.publish_data_name = cfg_params.get('USER.publish_data_name','') |
56 |
|
if ( self.user_se_path[-1] != '/' ) : self.user_se_path = self.user_se_path + '/' |
57 |
|
|
58 |
|
#check if using "private" Storage |
46 |
– |
self.usePhedex = True |
59 |
|
if not self.node : |
60 |
|
msg = 'Please specify the storage_element name in your crab.cfg section [USER].\n' |
61 |
|
msg +='\tFor further information please visit : %s'%stage_out_faq |
67 |
|
msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n ' |
68 |
|
msg += '\t For further information please visit : \n\t%s'%stage_out_faq |
69 |
|
raise CrabException(msg) |
58 |
– |
self.sched = common.scheduler.name().upper() |
59 |
– |
self.protocol = self.srm_version |
70 |
|
|
71 |
|
self.forced_path = '/store/user/' |
72 |
|
if self.sched in ['CAF','LSF']: |
86 |
|
|
87 |
|
#extract the PFN for the given node,LFN,protocol |
88 |
|
endpoint = self.getStageoutPFN() |
89 |
+ |
### FEDE added a check for the final / |
90 |
+ |
if ( endpoint[-1] != '/' ) : endpoint = endpoint + '/' |
91 |
+ |
###################################### |
92 |
|
|
93 |
|
#extract SE name an SE_PATH (needed for publication) |
94 |
|
SE, SE_PATH, User = self.splitEndpoint(endpoint) |