diff --git a/MAC/Services/TaskManagement/Server/lib/taskmanagement.py b/MAC/Services/TaskManagement/Server/lib/taskmanagement.py index 53e3ee228e14c73f8c3447316bcc8512a61ada6c..48d7c1529d114440b66fb770829ad4c2a297282e 100644 --- a/MAC/Services/TaskManagement/Server/lib/taskmanagement.py +++ b/MAC/Services/TaskManagement/Server/lib/taskmanagement.py @@ -59,14 +59,14 @@ class TaskManagementHandler(MessageHandlerInterface): :param otdb_id: :return: dict with aborted key saying if aborting was succesful and otdb_id key """ - if self._is_active_task(otdb_id): - aborted = self._abort_active_task(otdb_id) + if self._is_active_observation(otdb_id): + aborted = self._abort_active_observation(otdb_id) else: aborted = self._abort_inactive_task(otdb_id) return {"aborted": aborted, "otdb_id": otdb_id} - def _is_active_task(self, otdb_id): + def _is_active_observation(self, otdb_id): task_type, task_status = self._get_task_type_and_status(otdb_id) return task_type == "observation" and (task_status == "running" or task_status == "queued") @@ -81,7 +81,7 @@ class TaskManagementHandler(MessageHandlerInterface): aborted = False return aborted - def _abort_active_task(self, otdb_id): + def _abort_active_observation(self, otdb_id): logger.info("Aborting active task: %s", otdb_id) result = self.obs_ctrl.abort_observation(otdb_id)