Update main.py

This commit is contained in:
Masato TOYOSHIMA 2023-02-26 07:48:51 +09:00 committed by GitHub
parent 5513ffcd1c
commit c296f67356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -310,7 +310,7 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun
def enable_swap_partition(swap_device):
try:
for d in swap_device:
subprocess.check_call(["swapon", d])
libcalamares.utils.host_env_process_output(["swapon", d])
except subprocess.CalledProcessError:
raise Exception(_("Failed to swapon " + swap_device))
@ -327,7 +327,7 @@ def run():
return (_("Configuration Error"),
_("No partitions are defined for <pre>{!s}</pre> to use.").format("mount"))
swap_partitions = [p['device'] for p in partitions if ( p['fs'] == 'linuxswap' and p['claimed'] == True ) ]
swap_partitions = [p['device'] for p in partitions if ( p['fs'] == 'linuxswap' and p['claimed'] ) ]
if swap_partitions != [] :
enable_swap_partition(swap_partitions)