summaryrefslogtreecommitdiffstats
path: root/src/utils/fstab.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/fstab.py')
-rw-r--r--src/utils/fstab.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/fstab.py b/src/utils/fstab.py
index b419aa2..05b94bc 100644
--- a/src/utils/fstab.py
+++ b/src/utils/fstab.py
@@ -158,11 +158,11 @@ def configure_swap(disk, mountpoint, fstab):
swap_entry = entry
diskname = get_disks()[disk-1]
- cxt = fdisk.Context(f'/dev/{diskname}')
+ partitions = get_partition_data(device=f'/dev/{diskname}')
swap_device = ''
- for pa in cxt.partitions:
- if cxt.partition_to_string(pa, fdisk.FDISK_FIELD_FSTYPE) == 'swap':
+ for pa in partitions:
+ if pa.fstype == 'swap':
swap_device = get_formatted_device(disk, pa.partno + 1)
break