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

Comparing COMP/CRAB/python/Publisher.py (file contents):
Revision 1.7 by fanzago, Tue Dec 18 10:58:20 2007 UTC vs.
Revision 1.11.4.1 by fanzago, Fri Jul 4 14:01:01 2008 UTC

# Line 5 | Line 5 | from Actor import *
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
# Line 27 | Line 27 | class Publisher(Actor):
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:
# Line 47 | Line 48 | class Publisher(Actor):
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=''
# Line 68 | Line 85 | class Publisher(Actor):
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
# Line 89 | Line 106 | class Publisher(Actor):
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)                        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines