Skip to content
Snippets Groups Projects
Commit 1d1013fd authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8887: set task to conflict upon error

parent ddd0bfa1
No related branches found
No related tags found
No related merge requests found
...@@ -108,17 +108,21 @@ class RAtoOTDBPropagator(): ...@@ -108,17 +108,21 @@ class RAtoOTDBPropagator():
self.otdbrpc.taskSetStatus(otdb_id, 'conflict') self.otdbrpc.taskSetStatus(otdb_id, 'conflict')
def doTaskScheduled(self, ra_id, otdb_id, mom_id): def doTaskScheduled(self, ra_id, otdb_id, mom_id):
logger.info('doTaskScheduled: otdb_id=%s mom_id=%s' % (otdb_id, mom_id)) try:
if not otdb_id: logger.info('doTaskScheduled: otdb_id=%s mom_id=%s' % (otdb_id, mom_id))
logger.warning('doTaskScheduled no valid otdb_id: otdb_id=%s' % (otdb_id,)) if not otdb_id:
return logger.warning('doTaskScheduled no valid otdb_id: otdb_id=%s' % (otdb_id,))
ra_info = self.getRAinfo(ra_id) return
project = self.momrpc.getProjectDetails(mom_id) ra_info = self.getRAinfo(ra_id)
logger.info(project) project = self.momrpc.getProjectDetails(mom_id)
project_name = "_".join(project[str(mom_id)]['project_name'].split()) logger.info(project)
otdb_info = self.translator.CreateParset(otdb_id, ra_info, project_name) project_name = "_".join(project[str(mom_id)]['project_name'].split())
logger.debug("Parset info for OTDB: %s" %otdb_info) otdb_info = self.translator.CreateParset(otdb_id, ra_info, project_name)
self.setOTDBinfo(otdb_id, otdb_info, 'scheduled') logger.debug("Parset info for OTDB: %s" %otdb_info)
self.setOTDBinfo(otdb_id, otdb_info, 'scheduled')
except Exception as e:
logger.error(e)
self.doTaskConflict(ra_id, otdb_id, mom_id)
def getRAinfo(self, ra_id): def getRAinfo(self, ra_id):
info = {} info = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment