1 |
|
#!/usr/bin/env python |
2 |
– |
import sys, os, string, re |
2 |
|
from DBSInfo import * |
3 |
|
|
4 |
|
|
5 |
|
# #################################### |
6 |
|
class DataDiscoveryError(exceptions.Exception): |
7 |
|
def __init__(self, errorMessage): |
8 |
< |
args=errorMessage |
9 |
< |
exceptions.Exception.__init__(self, args) |
8 |
> |
self.args=errorMessage |
9 |
> |
exceptions.Exception.__init__(self, self.args) |
10 |
|
pass |
11 |
|
|
12 |
|
def getErrorMessage(self): |
16 |
|
# #################################### |
17 |
|
class NotExistingDatasetError(exceptions.Exception): |
18 |
|
def __init__(self, errorMessage): |
19 |
< |
args=errorMessage |
20 |
< |
exceptions.Exception.__init__(self, args) |
19 |
> |
self.args=errorMessage |
20 |
> |
exceptions.Exception.__init__(self, self.args) |
21 |
|
pass |
22 |
|
|
23 |
|
def getErrorMessage(self): |
27 |
|
# #################################### |
28 |
|
class NoDataTierinProvenanceError(exceptions.Exception): |
29 |
|
def __init__(self, errorMessage): |
30 |
< |
args=errorMessage |
31 |
< |
exceptions.Exception.__init__(self, args) |
30 |
> |
self.args=errorMessage |
31 |
> |
exceptions.Exception.__init__(self, self.args) |
32 |
|
pass |
33 |
|
|
34 |
|
def getErrorMessage(self): |
38 |
|
# #################################### |
39 |
|
# class to find and extact info from published data |
40 |
|
class DataDiscovery: |
41 |
< |
def __init__(self, datasetPath, dataTiers, cfg_params): |
41 |
> |
def __init__(self, datasetPath, cfg_params): |
42 |
|
|
43 |
|
# Attributes |
44 |
|
self.datasetPath = datasetPath |
46 |
– |
self.dataTiers = dataTiers |
45 |
|
self.cfg_params = cfg_params |
46 |
|
|
47 |
|
self.eventsPerBlock = {} # DBS output: map fileblocks-events for collection |
59 |
|
try: |
60 |
|
dbs_url=self.cfg_params['CMSSW.dbs_url'] |
61 |
|
except KeyError: |
62 |
< |
dbs_url="http://cmsdoc.cern.ch/cms/test/aprom/DBS/CGIServer/prodquery" |
62 |
> |
dbs_url="http://cmsdbs.cern.ch/cms/prod/comp/DBS/CGIServer/prodquery" |
63 |
|
|
64 |
|
## get info about the requested dataset |
65 |
|
try: |
70 |
|
dbs = DBSInfo(dbs_url, dbs_instance) |
71 |
|
try: |
72 |
|
self.datasets = dbs.getMatchingDatasets(self.datasetPath) |
73 |
< |
except dbsCgiApi.DbsCgiExecutionError, msg: |
73 |
> |
except DBSAPIOLD.dbsCgiApi.DbsCgiExecutionError, msg: |
74 |
|
raise DataDiscoveryError(msg) |
75 |
|
except DBSError, msg: |
76 |
|
raise DataDiscoveryError(msg) |