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

Comparing COMP/CRAB/python/DLSInfo.py (file contents):
Revision 1.26 by spiga, Fri Dec 5 10:42:27 2008 UTC vs.
Revision 1.36 by spiga, Wed Feb 10 21:35:34 2010 UTC

# Line 38 | Line 38 | class DLSInfo:
38      def __init__(self, type, cfg_params):
39          self.cfg_params = cfg_params
40          self.showCAF = False
41 +        self.showProd = False
42 +        self.subscribed = False    
43 +        subscribed =int(self.cfg_params.get('CMSSW.subscribed', 0))  
44 +        if subscribed == 1: self.subscribed = True
45 +        showProd = int(self.cfg_params.get('CMSSW.show_prod', 0))
46 +        if showProd == 1: self.showProd = True
47  
48          phedexURL='http://cmsweb.cern.ch/phedex/datasvc/xml/prod/'
49          global_url="http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet"
50          caf_url = "http://cmsdbsprod.cern.ch/cms_dbs_caf_analysis_01/servlet/DBSServlet"
51          dbs_url_map  =   {'glite':    global_url,
46                          'glitecoll':global_url,\
52                            'condor':   global_url,\
53                            'condor_g': global_url,\
54                            'glidein':  global_url,\
55                            'lsf':      global_url,\
56                            'caf':      caf_url,\
57 <                          'sge':      global_url
57 >                          'sge':      global_url,\
58 >                          'arc':      global_url,\
59 >                          'pbs':      global_url
60                            }
61          dbs_url_default = dbs_url_map[(common.scheduler.name()).lower()]
62  
# Line 62 | Line 69 | class DLSInfo:
69          else:
70              msg = "DLS type %s not among the supported DLS ( DLS_TYPE_DLI and DLS_TYPE_MYSQL ) "%type
71              raise CrabException(msg)
72 <        common.logger.debug(5,"DLS interface: %s Server %s"%(type,endpoint))      
72 >        common.logger.debug("DLS interface: %s Server %s"%(type,endpoint))      
73          try:
74              self.api = dlsClient.getDlsApi(dls_type=type,dls_endpoint=endpoint)
75          except dlsApi.DlsApiError, inst:
76              msg = "Error when binding the DLS interface: %s  Server %s"%(str(inst),endpoint)
77              #print msg
78              raise CrabException(msg)
72
79  
80      def getReplicasBulk(self,fileblocks):
81          """
82 <        query DLS to g    et replicas
82 >        query DLS to get replicas
83          """              
84          ##
85          try:
86 <            entryList=self.api.getLocations(fileblocks,longList=True,showCAF=self.showCAF)
86 >            entryList=self.api.getLocations(fileblocks,longList=True,showCAF=self.showCAF,showProd=self.showProd,subscribed=self.subscribed)
87          except dlsApi.DlsApiError, inst:
88              raise DLSNoReplicas(fileblocks)
89          results = {}
# Line 98 | Line 104 | class DLSInfo:
104          """
105          ##
106          try:
107 <            entryList=self.api.getLocations([fileblocks],showCAF=self.showCAF)
107 >            entryList=self.api.getLocations([fileblocks],showCAF=self.showCAF,subscribed=self.subscribed)
108          except dlsApi.DlsApiError, inst:
109              raise DLSNoReplicas(fileblocks)
110  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines