]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: exclude zram and cdrom from device list
authorPaul Cuzner <pcuzner@redhat.com>
Fri, 22 Oct 2021 02:29:30 +0000 (15:29 +1300)
committerPaul Cuzner <pcuzner@redhat.com>
Fri, 22 Oct 2021 02:29:30 +0000 (15:29 +1300)
When compiling eligible block devices, we need to
exclude zram* and cdrom (srX) devices.

Fixes: https://tracker.ceph.com/issues/52905
Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
src/cephadm/cephadm

index e068e52498dd29fa9c4f0ff137dd391ef7914199..f05e33e3751f6de42784b9aae5a016348b51f68d 100755 (executable)
@@ -6743,6 +6743,7 @@ class HostFacts():
     _disk_vendor_workarounds = {
         '0x1af4': 'Virtio Block Device'
     }
+    _excluded_block_devices = ('sr', 'zram', 'dm-')
 
     def __init__(self, ctx: CephadmContext):
         self.ctx: CephadmContext = ctx
@@ -6782,7 +6783,7 @@ class HostFacts():
         # type: () -> List[str]
         """Determine the list of block devices by looking at /sys/block"""
         return [dev for dev in os.listdir('/sys/block')
-                if not dev.startswith('dm')]
+                if not dev.startswith(HostFacts._excluded_block_devices)]
 
     def _get_devs_by_type(self, rota='0'):
         # type: (str) -> List[str]