]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix error when listing RBD while deleting or moving 34120/head
authorTiago Melo <tmelo@suse.com>
Mon, 23 Mar 2020 13:40:19 +0000 (12:40 -0100)
committerTiago Melo <tmelo@suse.com>
Mon, 23 Mar 2020 13:40:19 +0000 (12:40 -0100)
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 <tmelo@suse.com>
src/pybind/mgr/dashboard/services/rbd.py

index bb21e0abed8668e6da59117eb6e233577db670c2..ec35a50f814601d251c3a2ad9c45574da7f94c36 100644 (file)
@@ -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)