51 |
|
self.datasetpath = cfg_params.get("CMSSW.datasetpath") |
52 |
|
self.publish_data_name = cfg_params.get('USER.publish_data_name','') |
53 |
|
|
54 |
+ |
self.pset = cfg_params.get('CMSSW.pset',None) |
55 |
+ |
|
56 |
|
self.user_port = cfg_params.get("USER.storage_port",'8443') |
57 |
|
self.user_se_path = cfg_params.get("USER.storage_path",'') |
58 |
|
if self.user_se_path: |
67 |
|
|
68 |
|
if not self.usePhedex and ( self.user_remote_dir == '' or self.user_se_path == '' ): |
69 |
|
####### FEDE FOR BUG 73010 ############ |
70 |
< |
msg = 'Error: you are asking to stage out without using CMS Storage Name convention. In this case you \n' |
70 |
> |
msg = 'Error: task ' + common.work_space._top_dir + ' not correctly created. Please remove it. \n' |
71 |
> |
msg += ' You are asking to stage out without using CMS Storage Name convention. In this case you \n' |
72 |
|
msg += ' must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n' |
73 |
|
msg += ' For further information please visit : \n\t%s'%self.stage_out_faq |
74 |
|
task = common._db.getTask() |
75 |
< |
add = '\n\n' |
76 |
< |
import shutil |
77 |
< |
try: |
78 |
< |
add += ' Task not correctly created: removing the working_dir ' + common.work_space._top_dir + ' \n' |
79 |
< |
shutil.rmtree(common.work_space._top_dir) |
80 |
< |
except OSError: |
81 |
< |
add += ' Warning: problems removing the working_dir ' + common.work_space._top_dir + ' \n' |
82 |
< |
add += ' Please remove it by hand' |
83 |
< |
msg += add |
75 |
> |
#add = '\n\n' |
76 |
> |
#import shutil |
77 |
> |
#try: |
78 |
> |
# add += ' Task not correctly created: removing the working_dir ' + common.work_space._top_dir + ' \n' |
79 |
> |
# shutil.rmtree(common.work_space._top_dir) |
80 |
> |
#except OSError: |
81 |
> |
# add += ' Warning: problems removing the working_dir ' + common.work_space._top_dir + ' \n' |
82 |
> |
# add += ' Please remove it by hand' |
83 |
> |
#msg += add |
84 |
|
raise CrabException(msg) |
85 |
|
|
86 |
|
self.forced_path = '/store/user/' |
100 |
|
######### second solution ############### |
101 |
|
self.forced_path = cfg_params.get("USER.caf_lfn", '/store/caf/user') |
102 |
|
######################################### |
103 |
< |
print "--->>> FORCING THE FIRST PART OF LFN WITH ", self.forced_path |
103 |
> |
#print "--->>> FORCING THE FIRST PART OF LFN WITH ", self.forced_path |
104 |
|
self.SE = {'CAF':'caf.cern.ch'} |
105 |
|
self.srm_version = 'stageout' |
106 |
< |
print "--->>> query with 'stageout' " |
106 |
> |
#print "--->>> query with 'stageout' " |
107 |
|
######################################### |
108 |
|
|
109 |
|
if not self.usePhedex: |
119 |
|
#extract the PFN for the given node,LFN,protocol |
120 |
|
endpoint = self.getStageoutPFN() |
121 |
|
if ( endpoint[-1] != '/' ) : endpoint = endpoint + '/' |
122 |
+ |
|
123 |
+ |
if int(self.publish_data) == 1 or int(self.usenamespace) == 1: |
124 |
+ |
self.lfn = self.lfn + '/${PSETHASH}/' |
125 |
+ |
endpoint = endpoint + '/${PSETHASH}/' |
126 |
|
|
127 |
|
#extract SE name an SE_PATH (needed for publication) |
128 |
|
SE, SE_PATH, User = self.splitEndpoint(endpoint) |
190 |
|
primaryDataset = self.computePrimaryDataset() |
191 |
|
### added the case lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True) |
192 |
|
### for the publication in order to be able to check the lfn length |
193 |
< |
lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True) + '/${PSETHASH}/' |
193 |
> |
lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True) |
194 |
|
elif int(self.usenamespace) == 1: |
195 |
|
if self.sched in ['CAF']: l_User=True |
196 |
|
primaryDataset = self.computePrimaryDataset() |
197 |
< |
lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name) + '/${PSETHASH}/' |
197 |
> |
lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name) |
198 |
|
else: |
199 |
|
if self.sched in ['CAF','LSF']: l_User=True |
200 |
|
lfn = LFNBase(self.forced_path,self.user_remote_dir) |
201 |
+ |
|
202 |
|
if ( lfn[-1] != '/' ) : lfn = lfn + '/' |
203 |
+ |
|
204 |
|
return lfn |
205 |
|
|
206 |
|
def computePrimaryDataset(self): |
272 |
|
params = {'node' : self.node , 'lfn': self.lfn , 'protocol': self.protocol} |
273 |
|
datasvc_lfn2pfn="%s/lfn2pfn"%self.datasvc_url |
274 |
|
fullurl="%s/lfn2pfn?node=%s&lfn=%s&protocol=%s"%(self.datasvc_url,self.node,self.lfn,self.protocol) |
275 |
< |
print "--->>> fullurl = ", fullurl |
275 |
> |
#print "--->>> fullurl = ", fullurl |
276 |
|
domlfn2pfn = self.domPhedex(params,datasvc_lfn2pfn) |
277 |
|
if not domlfn2pfn : |
278 |
|
msg="Unable to get info from %s"%fullurl |