From edb9352c143f03f1421eb14cb0d5f353a093d069 Mon Sep 17 00:00:00 2001 From: Auke Klazema <klazema@astron.nl> Date: Mon, 17 Jul 2017 08:25:38 +0000 Subject: [PATCH] Task #11032: Renamed function for readability --- MAC/Services/TaskManagement/Server/lib/taskmanagement.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MAC/Services/TaskManagement/Server/lib/taskmanagement.py b/MAC/Services/TaskManagement/Server/lib/taskmanagement.py index 53e3ee228e1..48d7c1529d1 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) -- GitLab