Merge pull request #43628 from pcuzner/cephadm-remove-zram-devices

cephadm: exclude zram and cdrom from device list

Reviewed-by: Michael Fritch <mfritch@suse.com>
This commit is contained in:
Sebastian Wagner 2021-11-02 09:50:35 +01:00 committed by GitHub
commit a5cdb21017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6805,6 +6805,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
@ -6844,7 +6845,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]