From: Guillaume Abrioux Date: Wed, 6 Jul 2022 11:42:02 +0000 (+0200) Subject: ceph-volume: fix `simple scan` X-Git-Tag: v16.2.11~391^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc0198288d009fc82a0f7ba66fc1c9f6ca300d0d;p=ceph.git ceph-volume: fix `simple scan` `lsblk_all()` should return an empty dict `{}` if nothing was found. If we raise `RuntimeError()` then the loop in `scan.Scan.main` will stop and make ceph-volume fails because we don't try to catch this exception. `scan.Scan.main()` has its own logic in order to detect the given path is a ceph-disk created OSD anyway. Fixes: https://tracker.ceph.com/issues/56482 Signed-off-by: Guillaume Abrioux (cherry picked from commit 2630a50acb4654332c0b6801e9214564bd09d3d0) --- diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index 0fd74b7e20eb..2ad4bd1ba311 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -329,7 +329,7 @@ def lsblk_all(device='', columns=None, abspath=False): if dev['NAME'] == os.path.basename(device): return dev - raise RuntimeError(f"{device} not found in lsblk output") + return {} def is_device(dev): """