Merge pull request #717 from siduction/pep8-mount

Fixed pep8 whining in module mount
This commit is contained in:
adriaandegroot 2017-06-04 11:12:03 +02:00 committed by GitHub
commit 65834b019c

View File

@ -4,6 +4,7 @@
# === This file is part of Calamares - <http://github.com/calamares> === # === This file is part of Calamares - <http://github.com/calamares> ===
# #
# Copyright 2014, Aurélien Gâteau <agateau@kde.org> # Copyright 2014, Aurélien Gâteau <agateau@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -25,7 +26,8 @@ import libcalamares
def mount_partitions(root_mount_point, partitions): def mount_partitions(root_mount_point, partitions):
""" Pass back mount point and filesystem for each partition. """
Pass back mount point and filesystem for each partition.
:param root_mount_point: :param root_mount_point:
:param partitions: :param partitions:
@ -42,12 +44,14 @@ def mount_partitions(root_mount_point, partitions):
fstype = "vfat" fstype = "vfat"
if "luksMapperName" in partition: if "luksMapperName" in partition:
libcalamares.utils.debug("about to mount {!s}".format(partition["luksMapperName"])) libcalamares.utils.debug(
libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), "about to mount {!s}".format(partition["luksMapperName"]))
mount_point, libcalamares.utils.mount(
fstype, "/dev/mapper/{!s}".format(partition["luksMapperName"]),
partition.get("options", ""), mount_point,
) fstype,
partition.get("options", ""),
)
else: else:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(partition["device"],
@ -80,37 +84,41 @@ def mount_partitions(root_mount_point, partitions):
subprocess.check_call(["umount", "-v", root_mount_point]) subprocess.check_call(["umount", "-v", root_mount_point])
if "luksMapperName" in partition: if "luksMapperName" in partition:
libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), libcalamares.utils.mount(
mount_point, "/dev/mapper/{!s}".format(partition["luksMapperName"]),
fstype, mount_point,
",".join(["subvol=@", fstype,
partition.get("options", "")]), ",".join(
) ["subvol=@", partition.get("options", "")]),
)
if not has_home_mount_point: if not has_home_mount_point:
libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), libcalamares.utils.mount(
root_mount_point + "/home", "/dev/mapper/{!s}".format(partition["luksMapperName"]),
fstype, root_mount_point + "/home",
",".join(["subvol=@home", fstype,
partition.get("options", "")]), ",".join(
) ["subvol=@home", partition.get("options", "")]),
)
else: else:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(
mount_point, partition["device"],
fstype, mount_point,
",".join(["subvol=@", fstype,
partition.get("options", "")]), ",".join(["subvol=@", partition.get("options", "")]),
) )
if not has_home_mount_point: if not has_home_mount_point:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(
root_mount_point + "/home", partition["device"],
fstype, root_mount_point + "/home",
",".join(["subvol=@home", fstype,
partition.get("options", "")]), ",".join(
) ["subvol=@home", partition.get("options", "")]),
)
def run(): def run():
""" Define mountpoints. """
Define mountpoints.
:return: :return:
""" """
@ -132,7 +140,8 @@ def run():
# Remember the extra mounts for the unpackfs module # Remember the extra mounts for the unpackfs module
if fw_type == 'efi': if fw_type == 'efi':
libcalamares.globalstorage.insert("extraMounts", extra_mounts + extra_mounts_efi) libcalamares.globalstorage.insert(
"extraMounts", extra_mounts + extra_mounts_efi)
else: else:
libcalamares.globalstorage.insert("extraMounts", extra_mounts) libcalamares.globalstorage.insert("extraMounts", extra_mounts)