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>
# 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)