7 |
|
from LFNBaseName import * |
8 |
|
|
9 |
|
class PhEDExDatasvcInfo: |
10 |
< |
def __init__( self , cfg_params=None, config=None ): |
10 |
> |
def __init__( self , cfg_params ): |
11 |
|
|
12 |
|
## PhEDEx Data Service URL |
13 |
< |
self.datasvc_url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod" |
13 |
> |
url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod" |
14 |
> |
self.datasvc_url = cfg_params.get("USER.datasvc_url",url) |
15 |
|
|
16 |
|
self.FacOps_savannah = 'https://savannah.cern.ch/support/?func=additem&group=cmscompinfrasup' |
17 |
|
stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabHowTo#Stageout_and_publication' |
18 |
|
self.dataPub_faq = 'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabForPublication' |
19 |
|
|
19 |
– |
self.usePhedex = True |
20 |
– |
self.sched = common.scheduler.name().upper() |
21 |
– |
|
22 |
– |
if config!=None: |
23 |
– |
self.checkConfig(config) |
24 |
– |
else: |
25 |
– |
self.checkCfgConfig(cfg_params) |
26 |
– |
|
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) |
20 |
|
self.srm_version = cfg_params.get("USER.srm_version",'srmv2') |
21 |
|
self.node = cfg_params.get('USER.storage_element',None) |
22 |
+ |
|
23 |
+ |
|
24 |
|
|
25 |
+ |
self.user_lfn = cfg_params.get("USER.lfn",'') |
26 |
|
self.publish_data = cfg_params.get("USER.publish_data",0) |
27 |
|
self.usenamespace = cfg_params.get("USER.usenamespace",0) |
28 |
|
self.user_remote_dir = cfg_params.get("USER.user_remote_dir",'') |
29 |
|
if self.user_remote_dir: |
30 |
|
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) |
36 |
|
|
37 |
|
self.datasetpath = cfg_params.get("CMSSW.datasetpath") |
38 |
|
self.publish_data_name = cfg_params.get('USER.publish_data_name','') |
43 |
|
if ( self.user_se_path[-1] != '/' ) : self.user_se_path = self.user_se_path + '/' |
44 |
|
|
45 |
|
#check if using "private" Storage |
46 |
+ |
self.usePhedex = True |
47 |
|
if not self.node : |
48 |
|
msg = 'Please specify the storage_element name in your crab.cfg section [USER].\n' |
49 |
|
msg +='\tFor further information please visit : %s'%stage_out_faq |
55 |
|
msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n ' |
56 |
|
msg += '\t For further information please visit : \n\t%s'%stage_out_faq |
57 |
|
raise CrabException(msg) |
58 |
+ |
self.sched = common.scheduler.name().upper() |
59 |
+ |
self.protocol = self.srm_version |
60 |
|
|
61 |
|
self.forced_path = '/store/user/' |
62 |
|
if self.sched in ['CAF','LSF']: |
63 |
< |
self.srm_version= 'direct' |
63 |
> |
self.protocol = 'direct' |
64 |
|
self.SE = {'CAF':'caf.cern.ch', 'LSF':''} |
65 |
|
if self.sched == 'CAF': self.forced_path = '/store/caf/user/' |
66 |
|
|
113 |
|
# SE_PATH = endpoint.split(host)[1] |
114 |
|
SE = self.node |
115 |
|
SE_PATH = self.user_se_path + self.user_remote_dir |
116 |
< |
if self.lfn.find('user'): |
117 |
< |
try: |
118 |
< |
USER = (self.lfn.split('user')[1]).split('/')[1] |
119 |
< |
except: |
120 |
< |
pass |
131 |
< |
if self.lfn.find('group'): |
132 |
< |
try: |
133 |
< |
USER = (self.lfn.split('group')[1]).split('/')[1] |
134 |
< |
except: |
135 |
< |
pass |
116 |
> |
try: |
117 |
> |
USER = (self.lfn.split('user')[1]).split('/')[1] |
118 |
> |
except: |
119 |
> |
pass |
120 |
> |
|
121 |
|
return SE, SE_PATH, USER |
122 |
|
|
123 |
|
|