]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix `simple scan` 46992/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 6 Jul 2022 11:42:02 +0000 (13:42 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 7 Jul 2022 20:25:52 +0000 (22:25 +0200)
`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 <gabrioux@redhat.com>
src/ceph-volume/ceph_volume/util/disk.py

index 0fd74b7e20eb0ab8740ddfd53235042deecc58b9..2ad4bd1ba311fd50316796f257f1bd18472fa1f8 100644 (file)
@@ -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):
     """