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.25 by spiga, Tue May 26 10:23:01 2009 UTC vs.
Revision 1.29 by spiga, Sat Sep 19 11:11:01 2009 UTC

# Line 7 | Line 7 | from urlparse import urlparse
7   from LFNBaseName import *
8  
9   class PhEDExDatasvcInfo:
10 <    def __init__( self , cfg_params ):
10 >    def __init__( self , cfg_params=None, config=None ):
11  
12          ## PhEDEx Data Service URL
13 <        url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod"
14 <        self.datasvc_url = cfg_params.get("USER.datasvc_url",url)
13 >        self.datasvc_url="https://cmsweb.cern.ch/phedex/datasvc/xml/prod"
14  
15          self.FacOps_savannah = 'https://savannah.cern.ch/support/?func=additem&group=cmscompinfrasup'
16          stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabHowTo#Stageout_and_publication'
17          self.dataPub_faq = 'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabForPublication'
18  
19 +        self.usePhedex = True
20 +        self.sched = common.scheduler.name().upper()
21 +
22 +        if config!=None:
23 +            self.checkConfig(config)  
24 +        else:
25 +            self.checkCfgConfig(cfg_params)  
26 +
27 +        self.protocol = self.srm_version
28 +
29 +
30 +    def checkConfig(self,config):
31 +        """
32 +        """
33 +        self.srm_version = config.get("srm_version",'srmv2')
34 +        self.node = config.get('storage_element',None)
35 +        self.lfn='/store/'
36 +
37 +    def checkCfgConfig(self,cfg_params):
38 +        """
39 +        """
40 +        self.datasvc_url = cfg_params.get("USER.datasvc_url",self.datasvc_url)
41          self.srm_version = cfg_params.get("USER.srm_version",'srmv2')
42          self.node = cfg_params.get('USER.storage_element',None)
22        
43  
24
25        self.user_lfn = cfg_params.get("USER.lfn",'')
44          self.publish_data = cfg_params.get("USER.publish_data",0)
45          self.usenamespace = cfg_params.get("USER.usenamespace",0)
46          self.user_remote_dir = cfg_params.get("USER.user_remote_dir",'')
47          if self.user_remote_dir:
48              if ( self.user_remote_dir[-1] != '/' ) : self.user_remote_dir = self.user_remote_dir + '/'
31        if self.user_lfn:    
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.info(msg)
49            
50          self.datasetpath = cfg_params.get("CMSSW.datasetpath")
51          self.publish_data_name = cfg_params.get('USER.publish_data_name','')
# Line 43 | Line 56 | class PhEDExDatasvcInfo:
56              if ( self.user_se_path[-1] != '/' ) : self.user_se_path = self.user_se_path + '/'
57                                                      
58          #check if using "private" Storage
46        self.usePhedex = True
59          if not self.node :
60              msg = 'Please specify the storage_element name in your crab.cfg section [USER].\n'
61              msg +='\tFor further information please visit : %s'%stage_out_faq
# Line 55 | Line 67 | class PhEDExDatasvcInfo:
67              msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n '
68              msg += '\t For further information please visit : \n\t%s'%stage_out_faq
69              raise CrabException(msg)
58        self.sched = common.scheduler.name().upper()
59        self.protocol = self.srm_version
70  
71          self.forced_path = '/store/user/'
72          if self.sched in ['CAF','LSF']:
# Line 76 | Line 86 | class PhEDExDatasvcInfo:
86  
87          #extract the PFN for the given node,LFN,protocol
88          endpoint = self.getStageoutPFN()
89 +        ### FEDE added a check for the final /
90 +        if ( endpoint[-1] != '/' ) : endpoint = endpoint + '/'
91 +        ######################################
92    
93          #extract SE name an SE_PATH (needed for publication)
94          SE, SE_PATH, User = self.splitEndpoint(endpoint)
# Line 137 | Line 150 | class PhEDExDatasvcInfo:
150              raise CrabException(msg)
151          if self.publish_data_name == '' and int(self.usenamespace) == 1:
152             self.publish_data_name = "DefaultDataset"
153 <        if int(self.publish_data) == 1 or int(self.usenamespace) == 1:
153 >        if int(self.publish_data) == 1:
154 >            if self.sched in ['CAF']: l_User=True
155 >            primaryDataset = self.computePrimaryDataset()
156 >            ### added the case lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True)
157 >            ### for the publication in order to be able to check the lfn length  
158 >            lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, publish=True)  + '/${PSETHASH}/'    
159 >        elif int(self.usenamespace) == 1:
160              if self.sched in ['CAF']: l_User=True
161              primaryDataset = self.computePrimaryDataset()
162              lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name)  + '/${PSETHASH}/'    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines