From 8e8d63575f70dfd44b48cc87f4d8f9dd0f8a031e Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 26 Jul 2019 07:01:59 -0400 Subject: [PATCH] pybind/mgr: don't log exception when cannot find RBD task by id Signed-off-by: Jason Dillaman (cherry picked from commit 7ccf0b3229e674b625e396ca3b1e6f737214e125) --- src/pybind/mgr/rbd_support/module.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/rbd_support/module.py b/src/pybind/mgr/rbd_support/module.py index bd18ea603d45e..bf6523de1acf3 100644 --- a/src/pybind/mgr/rbd_support/module.py +++ b/src/pybind/mgr/rbd_support/module.py @@ -1134,8 +1134,7 @@ class TaskHandler: self.log.info("task_cancel: {}".format(task_id)) if task_id not in self.tasks_by_id: - self.log.debug("tasks: {}".format(str(self.tasks_by_id))) - raise KeyError("No such task {}".format(task_id)) + return -errno.ENOENT, '', "No such task {}".format(task_id) task = self.tasks_by_id[task_id] task.cancel() @@ -1160,7 +1159,7 @@ class TaskHandler: if task_id: if task_id not in self.tasks_by_id: - raise KeyError("No such task {}".format(task_id)) + return -errno.ENOENT, '', "No such task {}".format(task_id) result = self.tasks_by_id[task_id].to_dict() else: -- 2.39.5