diff --git a/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py b/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py index 711f4721680b85da0bbeea28b02311d84d74c685..f2c904549c469541a4b4f3c3dea3ea5bf5d73805 100644 --- a/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py +++ b/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py @@ -137,9 +137,12 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener): def onObservationCompleting(self, treeId, modificationTime): self._update_radb_task_status(treeId, 'completing') - def _updateStopTime(self, treeId): + def _updateStopTime(self, treeId, only_pipelines=False): radb_task = self.radb.getTask(otdb_id=treeId) - if radb_task and radb_task['type'] == 'pipeline': + if radb_task: + if only_pipelines and radb_task['type'] != 'pipeline': + return + otdb_task = self.otdb.taskGetTreeInfo(otdb_id=treeId) if otdb_task and (otdb_task['starttime'] != radb_task['starttime'] or otdb_task['stoptime'] != radb_task['endtime']): new_endtime = otdb_task['stoptime'] @@ -152,14 +155,13 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener): # otdb adjusts stoptime when finishing, # reflect that in radb for pipelines - self._updateStopTime(treeId) + self._updateStopTime(treeId, only_pipelines=True) def onObservationAborted(self, treeId, modificationTime): self._update_radb_task_status(treeId, 'aborted') # otdb adjusts stoptime when aborted, - # reflect that in radb for pipelines - self._updateStopTime(treeId) + self._updateStopTime(treeId, only_pipelines=False) def main(): # Check the invocation arguments