Skip to content

Commit

Permalink
Merge pull request #28 from katlapinka/kasiat/lvm-os-disk-filter
Browse files Browse the repository at this point in the history
Add OS disk filters to LVM config file
  • Loading branch information
katlapinka authored Nov 26, 2024
2 parents 5a16cd1 + 9feb5a7 commit 8739a78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion storage_devices/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from storage_devices.device import Device
from storage_devices.disk import Disk
from test_tools.fs_utils import readlink
from test_utils.disk_finder import resolve_to_by_id_link
from test_utils.disk_finder import resolve_to_by_id_link, get_system_disks
from test_utils.filesystem.symlink import Symlink
from test_utils.size import Size

Expand Down Expand Up @@ -146,6 +146,14 @@ def configure_filters(
TestRun.LOGGER.info(f"Preparing configuration for LVMs - filters.")
LvmConfiguration.add_filters_to_lvm_config(lvm_filters)

os_disk_filters = [
f"a|/dev/{disk}|" for disk in get_system_disks()
] if Lvm.get_os_vg() else None

if os_disk_filters:
TestRun.LOGGER.info(f"Add OS disks to LVM filters.")
LvmConfiguration.add_filters_to_lvm_config(os_disk_filters)

@staticmethod
def remove_global_filter_from_config():
cmd = f"sed -i '/{global_filter_prototype_regex}/d' {lvm_config_path}"
Expand Down

0 comments on commit 8739a78

Please sign in to comment.