38 |
|
def __init__(self, type, cfg_params): |
39 |
|
self.cfg_params = cfg_params |
40 |
|
self.showCAF = False |
41 |
+ |
self.showProd = False |
42 |
+ |
subscribed =int(self.cfg_params.get('CMSSW.subscribed', 0)) |
43 |
+ |
if subscribed == 1: self.subscribed = True |
44 |
+ |
showProd = int(self.cfg_params.get('CMSSW.show_prod', 0)) |
45 |
+ |
if showProd == 1: self.showProd = True |
46 |
|
|
47 |
|
phedexURL='http://cmsweb.cern.ch/phedex/datasvc/xml/prod/' |
48 |
|
global_url="http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet" |
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 |
|
} |
60 |
|
dbs_url_default = dbs_url_map[(common.scheduler.name()).lower()] |
61 |
|
|
68 |
|
else: |
69 |
|
msg = "DLS type %s not among the supported DLS ( DLS_TYPE_DLI and DLS_TYPE_MYSQL ) "%type |
70 |
|
raise CrabException(msg) |
71 |
< |
common.logger.debug(5,"DLS interface: %s Server %s"%(type,endpoint)) |
71 |
> |
common.logger.debug("DLS interface: %s Server %s"%(type,endpoint)) |
72 |
|
try: |
73 |
|
self.api = dlsClient.getDlsApi(dls_type=type,dls_endpoint=endpoint) |
74 |
|
except dlsApi.DlsApiError, inst: |
75 |
|
msg = "Error when binding the DLS interface: %s Server %s"%(str(inst),endpoint) |
76 |
|
#print msg |
77 |
|
raise CrabException(msg) |
72 |
– |
|
78 |
|
|
79 |
|
def getReplicasBulk(self,fileblocks): |
80 |
|
""" |
81 |
< |
query DLS to g et replicas |
81 |
> |
query DLS to get replicas |
82 |
|
""" |
83 |
|
## |
84 |
|
try: |
85 |
< |
entryList=self.api.getLocations(fileblocks,longList=True,showCAF=self.showCAF) |
85 |
> |
entryList=self.api.getLocations(fileblocks,longList=True,showCAF=self.showCAF,showProd=self.showProd,subscribed=self.subscribed) |
86 |
|
except dlsApi.DlsApiError, inst: |
87 |
|
raise DLSNoReplicas(fileblocks) |
88 |
|
results = {} |
103 |
|
""" |
104 |
|
## |
105 |
|
try: |
106 |
< |
entryList=self.api.getLocations([fileblocks],showCAF=self.showCAF) |
106 |
> |
entryList=self.api.getLocations([fileblocks],showCAF=self.showCAF,subscribed=self.subscribed) |
107 |
|
except dlsApi.DlsApiError, inst: |
108 |
|
raise DLSNoReplicas(fileblocks) |
109 |
|
|