From: Guillaume Abrioux Date: Wed, 6 Jul 2022 11:42:02 +0000 (+0200) Subject: ceph-volume: fix `simple scan` X-Git-Tag: v17.2.4~148^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a154babea5bffd0751bfb8702aed5a361afcec1c;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 31d9edd690d0..b8f013bcc47a 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): """