From 694abd784b09a3767ed1796348f12ebdc71d4bb6 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Mon, 23 Mar 2020 12:40:19 -0100 Subject: [PATCH] mgr/dashboard: Fix error when listing RBD while deleting or moving This fix is based on a commit made to octopus, that fixed this problem in octopus/master: 5627919c016785a27666b1992d336f8ff378a072. Since the codebase is very different and a backport is not recommended or even possible, I have created this commit with only the minimal code necessary. Fixes: https://tracker.ceph.com/issues/42330 Signed-off-by: Tiago Melo --- src/pybind/mgr/dashboard/services/rbd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/services/rbd.py b/src/pybind/mgr/dashboard/services/rbd.py index bb21e0abed86..ec35a50f8146 100644 --- a/src/pybind/mgr/dashboard/services/rbd.py +++ b/src/pybind/mgr/dashboard/services/rbd.py @@ -79,8 +79,11 @@ class RbdConfiguration(object): # type: () -> [dict] def _list(ioctx): if self._image_name: # image config - with rbd.Image(ioctx, self._image_name) as image: - result = image.config_list() + try: + with rbd.Image(ioctx, self._image_name) as image: + result = image.config_list() + except rbd.ImageNotFound: + result = [] else: # pool config result = self._rbd.config_list(ioctx) return list(result) -- 2.47.3