From ceb9ec4115e9038b1faa0869fe4d1e6c1034f008 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 4 Dec 2021 02:15:33 +0100 Subject: [PATCH] [fstab] Avoid KeyError when no subvol is set (from dalto8) --- src/modules/fstab/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 426761453..6a771a24b 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -237,7 +237,7 @@ class FstabGenerator(object): return None # If this is btrfs subvol a dedicated to a swapfile, use different options than a normal btrfs subvol - if filesystem == "btrfs" and partition["subvol"] == "/@swap": + if filesystem == "btrfs" and partition.get("subvol", None) == "/@swap": options = self.get_mount_options("btrfs_swap", mount_point) else: options = self.get_mount_options(filesystem, mount_point)