[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.
main
Adriaan de Groot 4 years ago
parent 995646936f
commit eb4ffe737e

@ -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" )

Loading…
Cancel
Save