From eb4ffe737e55240759ff69c2ffb0108bb4a52d47 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 7 Jul 2021 12:57:08 +0200 Subject: [PATCH] [mount] Fix logic - filter() returns the items for which the predicate is True; we want to keep the subvolumes that do not have an explicit partition already associated. - need list() to hammer it back into a list for appending swap subvol. --- src/modules/mount/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index f5faad7d1..2e96b6036 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -51,7 +51,7 @@ def get_btrfs_subvolumes(partitions): # Filter out the subvolumes which have a dedicated partition non_root_partition_mounts = [ m for m in [ p.get("mountPoint", None) for p in partitions ] if m is not None and m != '/' ] - btrfs_subvolumes = filter(lambda s : s["mountPoint"] in non_root_partition_mounts, btrfs_subvolumes) + btrfs_subvolumes = list(filter(lambda s : s["mountPoint"] not in non_root_partition_mounts, btrfs_subvolumes)) # If we have a swap **file**, give it a separate subvolume. swap_choice = libcalamares.globalstorage.value( "partitionChoices" )