275 |
|
seName = siteCfg.localStageOut.get("se-name", None) |
276 |
|
catalog = siteCfg.localStageOut.get("catalog", None) |
277 |
|
implName = siteCfg.localStageOut.get("command", None) |
278 |
+ |
option = siteCfg.localStageOut.get("option", None) |
279 |
+ |
|
280 |
|
if (implName == 'srm'): |
281 |
< |
implName='srmv1' |
282 |
< |
self.params['srm_version']=implName |
283 |
< |
##### to be improved ############### |
284 |
< |
if (implName == 'rfcp'): |
285 |
< |
self.params['middleware']='lsf' |
286 |
< |
#### FEDE for hadoop |
287 |
< |
if implName == 'hadoop': |
288 |
< |
self.params['middleware'] = 'hadoop' |
287 |
< |
#################################### |
281 |
> |
protocol = 'srmv2' |
282 |
> |
elif (implName == 'srmv2-lcg'): |
283 |
> |
protocol = 'srm-lcg' |
284 |
> |
elif (implName == 'rfcp-CERN'): |
285 |
> |
protocol = 'rfio' |
286 |
> |
elif (implName == 'rfcp'): |
287 |
> |
protocol = 'rfio' |
288 |
> |
else: protocol = implName |
289 |
|
|
289 |
– |
self.params['protocol']=implName |
290 |
|
tfc = siteCfg.trivialFileCatalog() |
291 |
|
|
292 |
|
if self.debug: |
293 |
|
print '\t siteCFG %s \n'%siteCfg |
294 |
|
print '\t seName %s \n'%seName |
295 |
|
print '\t catalog %s \n'%catalog |
296 |
< |
print "\t self.params['protocol'] %s \n"%self.params['protocol'] |
296 |
> |
print "\t fallback protocol %s \n"%protocol |
297 |
> |
print "\t fallback option %s \n"%option |
298 |
|
print '\t tfc %s '%tfc |
299 |
|
print "\t self.params['inputFileList'] %s \n"%self.params['inputFileList'] |
300 |
|
|
316 |
|
|
317 |
|
destination=os.path.dirname(file_backup[0]) |
318 |
|
if ( destination[-1] != '/' ) : destination = destination + '/' |
318 |
– |
|
319 |
|
self.params['destination']=destination |
320 |
– |
|
320 |
|
self.params['se_name']=seName |
321 |
|
|
322 |
|
if self.debug: |
323 |
|
print "\t self.params['destination']%s \n"%self.params['destination'] |
324 |
< |
print "\t self.params['protocol'] %s \n"%self.params['protocol'] |
325 |
< |
print "\t self.params['option']%s \n"%self.params['option'] |
326 |
< |
|
327 |
< |
for prot, opt in self.setProtocol( self.params['middleware'] ): |
328 |
< |
if self.debug: print '\tIn LocalCopy trying the stage out with %s utils \n'%prot |
329 |
< |
localCopy_results = self.copy( self.params['inputFileList'], prot, opt, backup='yes' ) |
330 |
< |
if localCopy_results.keys() == [''] or localCopy_results.keys() == '' : |
331 |
< |
results.update(localCopy_results) |
332 |
< |
else: |
333 |
< |
localCopy_results, list_ok, list_retry, list_fallback = self.checkCopy(localCopy_results, len(list_files), prot) |
334 |
< |
results.update(localCopy_results) |
335 |
< |
if len(list_fallback) == len(list_files) : |
336 |
< |
break |
337 |
< |
if len(list_retry): |
338 |
< |
list_files = list_retry |
339 |
< |
else: break |
341 |
< |
if self.debug: |
342 |
< |
print "\t localCopy_results = %s \n"%localCopy_results |
343 |
< |
|
324 |
> |
print "\t protocol %s \n"%protocol |
325 |
> |
print "\t optionn%s \n"%option |
326 |
> |
|
327 |
> |
if self.debug: print '\tIn LocalCopy trying the stage out with %s utils \n'%protocol |
328 |
> |
if self.debug: print '\tUsing as option %s \n'%option |
329 |
> |
|
330 |
> |
localCopy_results = self.copy( self.params['inputFileList'], protocol, option, backup='yes' ) |
331 |
> |
|
332 |
> |
if localCopy_results.keys() == [''] or localCopy_results.keys() == '' : |
333 |
> |
results.update(localCopy_results) |
334 |
> |
else: |
335 |
> |
localCopy_results, list_ok, list_retry, list_fallback = self.checkCopy(localCopy_results, len(list_files), protocol) |
336 |
> |
|
337 |
> |
results.update(localCopy_results) |
338 |
> |
if self.debug: |
339 |
> |
print "\t localCopy_results = %s \n"%localCopy_results |
340 |
|
return results |
341 |
|
|
342 |
|
def stager( self, middleware, list_files ): |