41 |
|
self.globalDBS="http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet" |
42 |
|
try: |
43 |
|
self.DBSURL=cfg_params['USER.dbs_url_for_publication'] |
44 |
< |
common.logger.message('dbs url = '+self.DBSURL) |
45 |
< |
if (self.DBSURL == "http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet"): |
44 |
> |
common.logger.message('<dbs_url_for_publication> = '+self.DBSURL) |
45 |
> |
if (self.DBSURL == "http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet") or (self.DBSURL == "https://cmsdbsprod.cern.ch:8443/cms_dbs_prod_global_writer/servlet/DBSServlet"): |
46 |
|
msg = "You can not publish your data in the globalDBS = " + self.DBSURL + "\n" |
47 |
|
msg = msg + "Please write your local one in the [USER] section 'dbs_url_for_publication'" |
48 |
|
raise CrabException(msg) |
114 |
|
common.logger.debug(6,"FileInfo = " + str(fileinfo)) |
115 |
|
common.logger.debug(6,"DatasetInfo = " + str(datasets)) |
116 |
|
for dataset in datasets: |
117 |
+ |
#### for production data |
118 |
+ |
if (dataset['PrimaryDataset'] == 'null'): |
119 |
+ |
dataset['PrimaryDataset'] = dataset['ProcessedDataset'] |
120 |
+ |
|
121 |
|
dataset['PSetContent']=self.content |
118 |
– |
#cfgMeta = {'name' : 'usercfg' , 'Type' : 'user' , 'annotation': 'user cfg', 'version' : 'private version'} # add real name of user cfg |
122 |
|
cfgMeta = {'name' : self.pset , 'Type' : 'user' , 'annotation': 'user cfg', 'version' : 'private version'} # add real name of user cfg |
123 |
|
common.logger.message("PrimaryDataset = %s"%dataset['PrimaryDataset']) |
124 |
|
common.logger.message("ProcessedDataset = %s"%dataset['ProcessedDataset']) |
125 |
< |
common.logger.message("--->>> Inserting primary: %s processed : %s"%(dataset['PrimaryDataset'],dataset['ProcessedDataset'])) |
125 |
> |
common.logger.message("<User Dataset Name> = /"+dataset['PrimaryDataset']+"/"+dataset['ProcessedDataset']+"/USER") |
126 |
> |
|
127 |
> |
common.logger.debug(6,"--->>> Inserting primary: %s processed : %s"%(dataset['PrimaryDataset'],dataset['ProcessedDataset'])) |
128 |
|
|
129 |
|
primary = DBSWriterObjects.createPrimaryDataset( dataset, dbswriter.dbs) |
130 |
|
common.logger.debug(6,"Primary: %s "%primary) |
135 |
|
processed = DBSWriterObjects.createProcessedDataset(primary, algo, dataset, dbswriter.dbs) |
136 |
|
common.logger.debug(6,"Processed: %s "%processed) |
137 |
|
|
138 |
< |
common.logger.message("Inserted primary %s processed %s"%(primary,processed)) |
138 |
> |
common.logger.debug(6,"Inserted primary %s processed %s"%(primary,processed)) |
139 |
|
|
140 |
|
common.logger.debug(6,"exit_status = %s "%self.exit_status) |
141 |
|
return self.exit_status |
166 |
|
file.lumisections = {} |
167 |
|
for ds in file.dataset: |
168 |
|
ds['ProcessedDataset']=procdataset |
169 |
+ |
### Fede for production |
170 |
+ |
if (ds['PrimaryDataset'] == 'null'): |
171 |
+ |
ds['PrimaryDataset']=procdataset |
172 |
|
filestopublish.append(file) |
173 |
|
else: |
174 |
|
self.noEventsFiles.append(file['LFN']) |
214 |
|
[BlocksList.append(x) for x in Blocks] |
215 |
|
|
216 |
|
# close the blocks |
217 |
< |
common.logger.message("BlocksList = %s"%BlocksList) |
217 |
> |
common.logger.debug(6, "BlocksList = %s"%BlocksList) |
218 |
|
# dbswriter = DBSWriter(self.DBSURL,level='ERROR') |
219 |
|
dbswriter = DBSWriter(self.DBSURL) |
220 |
|
|
221 |
|
for BlockName in BlocksList: |
222 |
|
try: |
223 |
|
closeBlock=dbswriter.manageFileBlock(BlockName,maxFiles= 1) |
224 |
< |
common.logger.message("closeBlock %s"%closeBlock) |
224 |
> |
common.logger.debug(6, "closeBlock %s"%closeBlock) |
225 |
|
#dbswriter.dbs.closeBlock(BlockName) |
226 |
|
except DBSWriterError, ex: |
227 |
|
common.logger.message("Close block error %s"%ex) |
228 |
|
|
221 |
– |
common.logger.message("--->>> End files publication") |
229 |
|
if (len(self.noEventsFiles)>0): |
230 |
|
common.logger.message("--->>> WARNING: "+str(len(self.noEventsFiles))+" files not published because they contain 0 events are:") |
231 |
|
for lfn in self.noEventsFiles: |
238 |
|
common.logger.message("--->>> WARNING: "+str(len(self.problemFiles))+" files not published because they had problem with copy to SE") |
239 |
|
for lfn in self.problemFiles: |
240 |
|
common.logger.message("------ LFN: %s"%lfn) |
241 |
+ |
common.logger.message("--->>> End files publication") |
242 |
+ |
common.logger.message("--->>> To check data publication please use: InspectDBS2.py --DBSURL=<dbs_url_for_publication> --datasetPath=<User Dataset Name>") |
243 |
|
return self.exit_status |
244 |
|
|
245 |
|
else: |