5 |
|
from crab_util import * |
6 |
|
from crab_logger import Logger |
7 |
|
from crab_exceptions import * |
8 |
< |
from FwkJobRep.ReportParser import readJobReport |
8 |
> |
from ProdCommon.FwkJobRep.ReportParser import readJobReport |
9 |
|
from ProdCommon.MCPayloads.WorkflowSpec import WorkflowSpec |
10 |
|
from ProdCommon.DataMgmt.DBS.DBSWriter import DBSWriter |
11 |
|
from ProdCommon.DataMgmt.DBS.DBSErrors import DBSWriterError, formatEx,DBSReaderError |
27 |
|
self.processedData = cfg_params['USER.publish_data_name'] |
28 |
|
except KeyError: |
29 |
|
raise CrabException('Cannot publish output data, because you did not specify USER.publish_data_name parameter in the crab.cfg file') |
30 |
+ |
|
31 |
|
try: |
32 |
|
if (int(cfg_params['USER.copy_data']) != 1): raise KeyError |
33 |
|
except KeyError: |
48 |
|
msg = msg + "Please write your local one in the [USER] section 'dbs_url_for_publication'" |
49 |
|
raise CrabException(msg) |
50 |
|
except KeyError: |
51 |
< |
msg = "Error. The [USER] section does not have 'dbs_url_for_publication'" |
52 |
< |
msg = msg + " entry, necessary to publish the data" |
51 |
> |
msg = "Warning. The [USER] section does not have 'dbs_url_for_publication'" |
52 |
> |
msg = msg + " entry, necessary to publish the data.\n" |
53 |
> |
msg = msg + "Use the command **crab -publish -USER.dbs_url_for_publication=dbs_url_for_publication*** \nwhere dbs_url_for_publication is your local dbs instance." |
54 |
|
raise CrabException(msg) |
55 |
|
|
56 |
|
self.content=file(self.pset).read() |
57 |
|
self.resDir = common.work_space.resDir() |
58 |
+ |
|
59 |
+ |
self.dataset_to_import=[] |
60 |
+ |
|
61 |
|
self.datasetpath=cfg_params['CMSSW.datasetpath'] |
62 |
+ |
if (self.datasetpath.upper() != 'NONE'): |
63 |
+ |
self.dataset_to_import.append(self.datasetpath) |
64 |
+ |
|
65 |
+ |
### Added PU dataset |
66 |
+ |
tmp = cfg_params.get('CMSSW.dataset_pu',None) |
67 |
+ |
if tmp : |
68 |
+ |
datasets = tmp.split(',') |
69 |
+ |
for dataset in datasets: |
70 |
+ |
dataset=string.strip(dataset) |
71 |
+ |
self.dataset_to_import.append(dataset) |
72 |
+ |
### |
73 |
+ |
|
74 |
|
self.SEName='' |
75 |
|
self.CMSSW_VERSION='' |
76 |
|
self.exit_status='' |
85 |
|
dbsWriter = DBSWriter(self.DBSURL,level='ERROR') |
86 |
|
|
87 |
|
try: |
88 |
< |
dbsWriter.importDataset(globalDBS, self.datasetpath, self.DBSURL) |
88 |
> |
dbsWriter.importDatasetWithoutParentage(globalDBS, self.datasetpath, self.DBSURL) |
89 |
|
except DBSWriterError, ex: |
90 |
|
msg = "Error importing dataset to be processed into local DBS\n" |
91 |
|
msg += "Source Dataset: %s\n" % datasetpath |
106 |
|
msg = "Error: Problem with "+file+" file" |
107 |
|
common.logger.message(msg) |
108 |
|
return self.exit_status |
109 |
< |
|
110 |
< |
if (self.datasetpath != 'None'): |
111 |
< |
common.logger.message("--->>> Importing parent dataset in the dbs") |
112 |
< |
status_import=self.importParentDataset(self.globalDBS, self.datasetpath) |
113 |
< |
if (status_import == 1): |
114 |
< |
common.logger.message('Problem with parent import from the global DBS '+self.globalDBS+ 'to the local one '+self.DBSURL) |
115 |
< |
self.exit_status='1' |
116 |
< |
return self.exit_status |
117 |
< |
common.logger.message("Parent import ok") |
109 |
> |
|
110 |
> |
if (len(self.dataset_to_import) != 0): |
111 |
> |
for dataset in self.dataset_to_import: |
112 |
> |
common.logger.message("--->>> Importing parent dataset in the dbs: " +dataset) |
113 |
> |
status_import=self.importParentDataset(self.globalDBS, dataset) |
114 |
> |
if (status_import == 1): |
115 |
> |
common.logger.message('Problem with parent '+ dataset +' import from the global DBS '+self.globalDBS+ 'to the local one '+self.DBSURL) |
116 |
> |
self.exit_status='1' |
117 |
> |
return self.exit_status |
118 |
> |
else: |
119 |
> |
common.logger.message('Import ok of dataset '+dataset) |
120 |
|
|
121 |
|
#// DBS to contact |
122 |
|
dbswriter = DBSWriter(self.DBSURL) |