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

Task #9607: handle obsolete status

parent a113624e
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,8 @@ class OTDBBusListener(AbstractBusListener):
self.onObservationFinished(treeId, modificationTime)
elif msg.content['state'] == 'aborted':
self.onObservationAborted(treeId, modificationTime)
elif msg.content['state'] == 'obsolete':
self.onObservationObsolete(treeId, modificationTime)
def onObservationDescribed(self, treeId, modificationTime):
pass
......@@ -130,4 +132,7 @@ class OTDBBusListener(AbstractBusListener):
def onObservationAborted(self, treeId, modificationTime):
pass
def onObservationObsolete(self, treeId, modificationTime):
pass
__all__ = ["OTDBBusListener"]
......@@ -47,8 +47,8 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
def _update_radb_task_status(self, otdb_id, task_status):
try:
if task_status in ['approved', 'prescheduled']:
radb_task = self.radb.getTask(otdb_id=treeId)
if task_status in ['approved', 'prescheduled', 'obsolete']:
radb_task = self.radb.getTask(otdb_id=otdb_id)
if (radb_task and
radb_task['cluster'] == 'CEP4' and
radb_task['status'] in ['queued', 'active', 'completing']):
......@@ -105,6 +105,9 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
def onObservationConflict(self, treeId, modificationTime):
self._update_radb_task_status(treeId, 'conflict')
def onObservationObsolete(self, treeId, modificationTime):
self._update_radb_task_status(treeId, 'obsolete')
def onObservationPrescheduled(self, treeId, modificationTime):
self._update_radb_task_status(treeId, 'prescheduled')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment