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.16 by spiga, Fri Nov 21 14:08:17 2008 UTC vs.
Revision 1.20 by spiga, Fri Mar 6 17:01:52 2009 UTC

# Line 15 | Line 15 | class PhEDExDatasvcInfo:
15          self.datasvc_url = cfg_params.get("USER.datasvc_url",url)
16  
17          self.FacOps_savannah = 'https://savannah.cern.ch/support/?func=additem&group=cmscompinfrasup'
18 <
18 >        stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#How_to_store_output_with_CRAB_2'
19 >        self.dataPub_faq = 'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabForPublication'
20  
21          self.srm_version = cfg_params.get("USER.srm_version",'srmv2')
22          self.node = cfg_params.get('USER.storage_element',None)
23          
24 +
25 +
26 +        self.user_lfn = cfg_params.get("USER.lfn",'')
27          self.publish_data = cfg_params.get("USER.publish_data",0)
28          self.usenamespace = cfg_params.get("USER.usenamespace",0)
29          self.user_remote_dir = cfg_params.get("USER.user_remote_dir",'')
30          if self.user_remote_dir:
31              if ( self.user_remote_dir[-1] != '/' ) : self.user_remote_dir = self.user_remote_dir + '/'
32 <            
32 >        if self.user_lfn:    
33 >            msg  = 'Warning: lfn has been deprecated, CRAB will ignore it.\n'
34 >            msg += '\t Please use only user_remote_dir removing lfn from your crab.cfg\n'
35 >            msg += '\t For further information please visit : \n\t%s'%stage_out_faq
36 >            common.logger.message(msg)
37 >          
38          self.datasetpath = cfg_params.get("CMSSW.datasetpath")
39          self.publish_data_name = cfg_params.get('USER.publish_data_name','')
40  
# Line 36 | Line 45 | class PhEDExDatasvcInfo:
45                                                      
46          #check if using "private" Storage
47          self.usePhedex = True
39        stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#How_to_store_output_with_CRAB_2'
48          if not self.node :
49              msg = 'Please specify the storage_element name in your crab.cfg section [USER].\n'
50 <            msg +='      For further information please visit : %s'%stage_out_faq
50 >            msg +='\tFor further information please visit : %s'%stage_out_faq
51              raise CrabException(msg)
52          if (self.node.find('T1_') + self.node.find('T2_')+self.node.find('T3_')) == -3: self.usePhedex = False
45        if not self.usePhedex :
46             self.user_lfn = cfg_params.get("USER.lfn",'')
47             if self.user_lfn:
48                 if self.user_remote_dir:
49                         msg =  'ERROR: In your crab.cfg you are specifying both lfn and user_remote_dir parameters giving different values. \n'
50                         msg += '\t lfn is now deprecated. Please use only user_remote_dir removing lfn from your crab.cfg'
51                         raise CrabException(msg)
53  
54          if not self.usePhedex and ( self.user_remote_dir == '' or self.user_se_path == '' ):
55              msg = 'You are asking to stage out without using CMS Storage Name convention. In this case you \n'
56              msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n '
57 <            msg += '\t For further information please visit : %s'%stage_out_faq
57 >            msg += '\t For further information please visit : \n\t%s'%stage_out_faq
58              raise CrabException(msg)
59          self.sched = common.scheduler.name().upper()
60          self.protocol = self.srm_version
61 <        if self.sched in ['CAF','LSF']:self.protocol = 'direct'
61 >        if self.sched in ['CAF','LSF']:
62 >            self.protocol = 'direct'
63 >            self.SE = {'CAF':'caf.cern.ch', 'LSF':''}
64  
65          self.forced_path = '/store/user/'
66          if not self.usePhedex:
# Line 89 | Line 92 | class PhEDExDatasvcInfo:
92              if self.protocol == 'direct':
93                  query=endpoint
94                  SE_PATH = endpoint
95 <                SE = self.sched
95 >                SE = self.SE[self.sched]
96              else:
97                  url = 'http://'+endpoint.split('://')[1]
98                  # python > 2.4
# Line 99 | Line 102 | class PhEDExDatasvcInfo:
102                  SE_PATH = endpoint.split(host)[1]
103              USER = (query.split('user')[1]).split('/')[1]
104          else:
105 +            #### to test #####
106 +            #url = 'http://'+endpoint.split('://')[1]
107 +            #scheme, host, path, params, query, fragment = urlparse(url)
108 +            #SE = host.split(':')[0]
109 +            #SE_PATH = endpoint.split(host)[1]
110              SE = self.node
111              SE_PATH = self.user_se_path + self.user_remote_dir
112              try:
# Line 123 | Line 131 | class PhEDExDatasvcInfo:
131              lfn = self.user_remote_dir
132              return lfn
133          if self.publish_data_name == '' and int(self.publish_data) == 1:
134 <            msg = "Eeror. The [USER] section does not have 'publish_data_name'"
134 >            msg = "Error. The [USER] section does not have 'publish_data_name'\n"
135 >            msg += '\tFor further information please visit : \n\t%s'%self.dataPub_faq
136              raise CrabException(msg)
137          if self.publish_data_name == '' and int(self.usenamespace) == 1:
138             self.publish_data_name = "DefaultDataset"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines