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

Comparing COMP/CRAB/python/PhEDExDatasvcInfo.py (file contents):
Revision 1.22 by spiga, Tue Mar 31 23:43:22 2009 UTC vs.
Revision 1.27 by fanzago, Wed Sep 16 15:49:01 2009 UTC

# Line 2 | Line 2 | from Actor import *
2   import urllib
3   from xml.dom.minidom import parse
4   from crab_exceptions import *
5 from crab_logger import Logger
5   from WorkSpace import *
6   from urlparse import urlparse
7   from LFNBaseName import *
# Line 15 | Line 14 | class PhEDExDatasvcInfo:
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/SWGuideCrabFaq#How_to_store_output_with_CRAB_2'
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  
20          self.srm_version = cfg_params.get("USER.srm_version",'srmv2')
# Line 33 | Line 32 | class PhEDExDatasvcInfo:
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.message(msg)
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','')
# Line 77 | Line 76 | class PhEDExDatasvcInfo:
76  
77          #extract the PFN for the given node,LFN,protocol
78          endpoint = self.getStageoutPFN()
79 +        ### FEDE added a check for the final /
80 +        if ( endpoint[-1] != '/' ) : endpoint = endpoint + '/'
81 +        ######################################
82    
83          #extract SE name an SE_PATH (needed for publication)
84          SE, SE_PATH, User = self.splitEndpoint(endpoint)
# Line 138 | Line 140 | class PhEDExDatasvcInfo:
140              raise CrabException(msg)
141          if self.publish_data_name == '' and int(self.usenamespace) == 1:
142             self.publish_data_name = "DefaultDataset"
143 <        if int(self.publish_data) == 1 or int(self.usenamespace) == 1:
143 >        if int(self.publish_data) == 1:
144 >            if self.sched in ['CAF']: l_User=True
145 >            primaryDataset = self.computePrimaryDataset()
146 >            ### added the case lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True)
147 >            ### for the publication in order to be able to check the lfn length  
148 >            lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True)  + '/${PSETHASH}/'    
149 >        elif int(self.usenamespace) == 1:
150              if self.sched in ['CAF']: l_User=True
151              primaryDataset = self.computePrimaryDataset()
152              lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name)  + '/${PSETHASH}/'    
# Line 167 | Line 175 | class PhEDExDatasvcInfo:
175          params = {'node' : self.node , 'lfn': self.lfn , 'protocol': self.protocol}
176          params = urllib.urlencode(params)
177          datasvc_lfn2pfn="%s/lfn2pfn"%self.datasvc_url
170        urlresults = urllib.urlopen(datasvc_lfn2pfn, params)
178          try:
179 +            urlresults = urllib.urlopen(datasvc_lfn2pfn, params)
180              urlresults = parse(urlresults)
181 +        except IOError:
182 +            msg="Unable to access PhEDEx Data Service at %s"%datasvc_lfn2pfn
183 +            raise CrabException(msg)
184          except:
185              urlresults = None
186  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines