def handleAnnounce(self, **kwargs): """ Handler for announcing requests """ requests = self.requestNamesFromCheckboxes(kwargs) # the distinction good/bad datasets was based upon contacting # wrong DBS url so it was always giving rubbish, # perhaps the entire page is just not used at all datasets = [] goodDatasets = [] badDatasets = [] for requestName in requests: WMCore.Lexicon.identifier(requestName) Utilities.changeStatus(requestName, 'announced', wmstatUrl=self.wmstatWriteURL, acdcUrl=self.acdcURL) datasets.extend(Utilities.getOutputForRequest(requestName)) for dataset in datasets: # was needed for the DBS call to wrong DBS URL # check code before 2013-04-04 #toks = dataset.split('/') #data = {'primary_ds_name': toks[0], 'processed_ds_name': toks[1], # 'data_tier_name': toks[2], 'is_dataset_valid': 1} goodDatasets.append(dataset) return self.templatepage("Announce", requests=requests, goodDatasets=goodDatasets, badDatasets=badDatasets)
def handleAnnounce(self, **kwargs): """ Handler for announcing requests """ requests = self.requestNamesFromCheckboxes(kwargs) datasets = [] goodDatasets = [] badDatasets = [] for requestName in requests: WMCore.Lexicon.identifier(requestName) ChangeState.changeRequestStatus(requestName, 'announced', wmstatUrl = self.wmstatWriteURL) datasets.extend(Utilities.getOutputForRequest(requestName)) for dataset in datasets: try: toks = dataset.split('/') data = {'primary_ds_name': toks[0], 'processed_ds_name': toks[1], 'data_tier_name': toks[2], 'is_dataset_valid': 1} dbsSender.post('/DBSWriter/datasets', data=data) goodDatasets.append(dataset) except: logging.warning("Could not update dataset into DBS:" +dataset) badDatasets.append(dataset) return self.templatepage("Announce", requests=requests, goodDatasets=goodDatasets, badDatasets=badDatasets)
def getOutputForRequest(self, requestName): """Return the datasets produced by this request.""" return Utilities.getOutputForRequest(requestName)