From: Tiago Melo Date: Mon, 23 Mar 2020 13:40:19 +0000 (-0100) Subject: mgr/dashboard: Fix error when listing RBD while deleting or moving X-Git-Tag: v14.2.10~153^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34120%2Fhead;p=ceph.git 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 --- 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)