ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/cmscp.py
(Generate patch)

Comparing COMP/CRAB/python/cmscp.py (file contents):
Revision 1.68 by fanzago, Thu Jan 28 13:02:03 2010 UTC vs.
Revision 1.68.2.3 by spiga, Thu Apr 22 14:40:14 2010 UTC

# Line 119 | Line 119 | class cmscp:
119                      'srmv2':'-b -D srmv2 --srm-timeout 2400 --sendreceive-timeout 2400 --connect-timeout 2400 --verbose'}
120  
121          srmOpt={'srmv1':' -report ./srmcp.report -retry_timeout 480000 -retry_num 3 -streams_num=1 ',
122 <                'srmv2':' -report=./srmcp.report -retry_timeout=480000 -retry_num=3 '}
122 >                'srmv2':' -report=./srmcp.report -retry_timeout=480000 -retry_num=3 -storagetype=permanent '}
123          rfioOpt=''
124  
125          supported_protocol = None
# Line 223 | Line 223 | class cmscp:
223              print '\t tfc %s '%tfc
224              print "\t self.params['inputFilesList'] %s \n"%self.params['inputFilesList']
225                  
226 <        if (str(self.params['lfn']).find("/store/") != -1):
227 <            temp = str(self.params['lfn']).split("/store/")
228 <            self.params['lfn']= "/store/temp/" + temp[1]
226 >        #if (str(self.params['lfn']).find("/store/") != -1):
227 >        #    temp = str(self.params['lfn']).split("/store/")
228 >        #    self.params['lfn']= "/store/temp/" + temp[1]
229 >        if (str(self.params['lfn']).find("/store/") == 0):
230 >            temp = str(self.params['lfn']).replace("/store/","/store/temp/",1)
231 >            self.params['lfn']= temp
232 >        
233 >        if ( self.params['lfn'][-1] != '/' ) : self.params['lfn'] = self.params['lfn'] + '/'
234              
235          file_backup=[]
236          for input in self.params['inputFilesList']:
# Line 328 | Line 333 | class cmscp:
333          try:
334              Source_SE, Destination_SE = self.initializeApi( protocol )
335          except Exception, ex:
336 <            return self.updateReport('', '-1', str(ex))
336 >            for filetocopy in list_file:
337 >                results.update( self.updateReport(filetocopy, '-1', str(ex)))
338 >            return results
339  
340          # create remote dir
341          if Destination_SE.protocol in ['gridftp','rfio','srmv2']:
342              try:
343                  self.createDir( Destination_SE, Destination_SE.protocol )
344              except OperationException, ex:
345 <                return self.updateReport('', '60316', str(ex))
345 >                for filetocopy in list_file:
346 >                    results.update( self.updateReport(filetocopy, '60316', str(ex)))
347 >                return results
348              ## when the client commands are not found (wrong env or really missing)
349              except MissingCommand, ex:
350                  msg = "ERROR %s %s" %(str(ex), str(ex.detail))
351 <                return self.updateReport('', '10041', msg)
351 >                for filetocopy in list_file:
352 >                    results.update( self.updateReport(filetocopy, '10041', msg))
353 >                return results
354 >            except Exception, ex:
355 >                msg = "ERROR %s" %(str(ex))
356 >                for filetocopy in list_file:
357 >                    results.update( self.updateReport(filetocopy, '-1', msg))
358 >                return results
359  
360          ## prepare for real copy  ##
361          try :
# Line 349 | Line 365 | class cmscp:
365          except ProtocolMismatch, ex:
366              msg  = "ERROR : Unable to create SBinterface with %s protocol"%protocol
367              msg += str(ex)
368 <            return self.updateReport('', '-1', msg)
368 >            for filetocopy in list_file:
369 >                results.update( self.updateReport(filetocopy, '-1', msg))
370 >            return results
371  
372          results = {}
373          ## loop over the complete list of files
# Line 663 | Line 681 | class cmscp:
681  
682                  txt += 'export endpoint='+self.params['destination']+'\n'
683                  
684 <                #if dict['erCode'] != '0':
685 <                cmscp_exit_status = dict['erCode']
684 >                if dict['erCode'] != '0':
685 >                    cmscp_exit_status = dict['erCode']
686              else:
687                  txt += 'echo "StageOutExitStatusReason = %s" | tee -a $RUNTIME_AREA/$repo\n'%reason
688                  cmscp_exit_status = dict['erCode']

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines