64 |
|
if (self.node.find('T1_') + self.node.find('T2_')+self.node.find('T3_')) == -3: self.usePhedex = False |
65 |
|
|
66 |
|
if not self.usePhedex and ( self.user_remote_dir == '' or self.user_se_path == '' ): |
67 |
< |
msg = 'You are asking to stage out without using CMS Storage Name convention. In this case you \n' |
68 |
< |
msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n ' |
69 |
< |
msg += '\t For further information please visit : \n\t%s'%self.stage_out_faq |
67 |
> |
####### FEDE FOR BUG 73010 ############ |
68 |
> |
msg = 'Error: you are asking to stage out without using CMS Storage Name convention. In this case you \n' |
69 |
> |
msg += ' must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n' |
70 |
> |
msg += ' For further information please visit : \n\t%s'%self.stage_out_faq |
71 |
> |
task = common._db.getTask() |
72 |
> |
add = '\n\n' |
73 |
> |
import shutil |
74 |
> |
try: |
75 |
> |
add += ' Task not correctly created: removing the working_dir ' + common.work_space._top_dir + ' \n' |
76 |
> |
shutil.rmtree(common.work_space._top_dir) |
77 |
> |
except OSError: |
78 |
> |
add += ' Warning: problems removing the working_dir ' + common.work_space._top_dir + ' \n' |
79 |
> |
add += ' Please remove it by hand' |
80 |
> |
msg += add |
81 |
|
raise CrabException(msg) |
82 |
|
|
83 |
|
self.forced_path = '/store/user/' |
84 |
< |
if self.sched in ['CAF','LSF','PBS']: |
84 |
> |
if self.sched in ['LSF','PBS']: |
85 |
|
self.srm_version = 'direct' |
86 |
< |
self.SE = {'CAF':'caf.cern.ch', 'LSF':'', 'PBS':''} |
76 |
< |
if self.sched == 'CAF': self.forced_path = '/store/caf/user/' |
86 |
> |
self.SE = {'LSF':'', 'PBS':''} |
87 |
|
|
88 |
+ |
if self.sched == 'CAF': |
89 |
+ |
#### FEDE TEST FOR XROOTD |
90 |
+ |
######### first solution ################ |
91 |
+ |
#eos = cfg_params.get("USER.caf_eos_area", 0) |
92 |
+ |
#if eos == 0: |
93 |
+ |
# self.forced_path = '/store/caf/user/' |
94 |
+ |
#else: |
95 |
+ |
# self.forced_path = '/store/eos/user' |
96 |
+ |
######################################### |
97 |
+ |
######### second solution ############### |
98 |
+ |
self.forced_path = cfg_params.get("USER.caf_lfn", '/store/caf/user') |
99 |
+ |
######################################### |
100 |
+ |
print "--->>> FORCING THE FIRST PART OF LFN WITH ", self.forced_path |
101 |
+ |
self.SE = {'CAF':'caf.cern.ch'} |
102 |
+ |
self.srm_version = 'stageout' |
103 |
+ |
print "--->>> query with 'stageout' " |
104 |
+ |
######################################### |
105 |
+ |
|
106 |
|
if not self.usePhedex: |
107 |
|
self.forced_path = self.user_remote_dir |
108 |
|
return |
120 |
|
#extract SE name an SE_PATH (needed for publication) |
121 |
|
SE, SE_PATH, User = self.splitEndpoint(endpoint) |
122 |
|
|
123 |
+ |
#### FEDE FOR XROOTD ##### |
124 |
+ |
#print "in getEndpoint di PhEDExDatasvcInfo.py: " |
125 |
+ |
#print " SE = ", SE |
126 |
+ |
#print " SE_PATH = ", SE_PATH |
127 |
+ |
#print " User = ", User |
128 |
+ |
#print " endpoint = ", endpoint |
129 |
+ |
############################## |
130 |
+ |
|
131 |
|
return endpoint, self.lfn , SE, SE_PATH, User |
132 |
|
|
133 |
|
def splitEndpoint(self, endpoint): |
138 |
|
SE_PATH = '' |
139 |
|
USER = getUserName() |
140 |
|
if self.usePhedex: |
141 |
< |
if self.protocol == 'direct': |
142 |
< |
query=endpoint |
107 |
< |
SE_PATH = endpoint |
141 |
> |
### FEDE PER TEST WITH XROOTD |
142 |
> |
if (self.protocol == 'direct' or self.protocol == 'stageout'): |
143 |
|
SE = self.SE[self.sched] |
144 |
+ |
SE_PATH = endpoint |
145 |
+ |
############################# |
146 |
+ |
#print " SE_PATH = ", SE_PATH |
147 |
|
else: |
148 |
|
url = 'http://'+endpoint.split('://')[1] |
149 |
|
scheme, host, path, params, query, fragment = urlparse(url) |
150 |
|
SE = self.getAuthoritativeSE() |
151 |
|
SE_PATH = endpoint.split(host)[1] |
152 |
|
else: |
115 |
– |
#### to test ##### |
116 |
– |
# url = 'http://'+endpoint.split('://')[1] |
117 |
– |
# scheme, host, path, params, query, fragment = urlparse(url) |
118 |
– |
# SE = host.split(':')[0] |
119 |
– |
# SE_PATH = endpoint.split(host)[1] |
153 |
|
SE = self.node |
154 |
|
SE_PATH = self.user_se_path + self.user_remote_dir |
155 |
|
if self.lfn.find('group') != -1: |
263 |
|
params = {'node' : self.node , 'lfn': self.lfn , 'protocol': self.protocol} |
264 |
|
datasvc_lfn2pfn="%s/lfn2pfn"%self.datasvc_url |
265 |
|
fullurl="%s/lfn2pfn?node=%s&lfn=%s&protocol=%s"%(self.datasvc_url,self.node,self.lfn,self.protocol) |
266 |
+ |
print "--->>> fullurl = ", fullurl |
267 |
|
domlfn2pfn = self.domPhedex(params,datasvc_lfn2pfn) |
268 |
|
if not domlfn2pfn : |
269 |
|
msg="Unable to get info from %s"%fullurl |