From 3bbfdef1ceff95d005e102f2cd12e953e2bc653c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 25 Jun 2024 16:01:42 +0200 Subject: [PATCH] [mount] Split overly-long one-liner --- src/modules/mount/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 1a389f4e6..4a16f8872 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -345,8 +345,10 @@ def run(): _("No partitions are defined for
{!s}
to use.").format("mount")) # Find existing swap partitions that are part of the installation and enable them now - swap_devices = [p["device"] for p in partitions if (p["fs"] == "linuxswap" and p.get("claimed", False) and p["fsName"] == "linuxswap")] \ - + ["/dev/mapper/" + p["luksMapperName"] for p in partitions if (p["fs"] == "linuxswap" and p.get("claimed", False) and (p["fsName"] == "luks" or p["fsName"] == "luks2"))] + claimed_swap_partitions = [p for p in partitions if p["fs"] == "linuxswap" and p.get("claimed", False)] + plain_swap = [p for p in claimed_swap_partitions if p["fsName"] == "linuxswap"] + luks_swap = [p for p in claimed_swap_partitions if p["fsName"] == "luks" or p["fsName"] == "luks2"] + swap_devices = [p["device"] for p in plain_swap] + ["/dev/mapper/" + p["luksMapperName"] for p in luks_swap] enable_swap_partition(swap_devices)