From: Jason Dillaman Date: Fri, 26 Jul 2019 11:01:59 +0000 (-0400) Subject: pybind/mgr: don't log exception when cannot find RBD task by id X-Git-Tag: v14.2.3~13^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8e8d63575f70dfd44b48cc87f4d8f9dd0f8a031e;p=ceph.git pybind/mgr: don't log exception when cannot find RBD task by id Signed-off-by: Jason Dillaman (cherry picked from commit 7ccf0b3229e674b625e396ca3b1e6f737214e125) --- 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: