]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix `simple scan` 47149/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 6 Jul 2022 11:42:02 +0000 (13:42 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 29 Jul 2022 06:17:06 +0000 (08:17 +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>
(cherry picked from commit 2630a50acb4654332c0b6801e9214564bd09d3d0)

src/ceph-volume/ceph_volume/util/disk.py

index 31d9edd690d0f93a4aa81664b8154cfc7c1ebb3c..b8f013bcc47a83939463ba0b8aee20b4efa111bb 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):
     """