From 33b5cefebba03cd49cc0676fb8e0c5777170181d Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Wed, 29 Mar 2017 21:09:25 +0200 Subject: [PATCH 1/2] Fixed pep8 whining in module mount Added myself to copyright --- src/modules/mount/main.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index c1abe0910..d69a9b1dc 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -4,6 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2014, Aurélien Gâteau +# Copyright 2017, Alf Gaida # # Calamares is free software: you can redistribute it and/or modify # 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): - """ Pass back mount point and filesystem for each partition. + """ + Pass back mount point and filesystem for each partition. :param root_mount_point: :param partitions: @@ -42,8 +44,10 @@ def mount_partitions(root_mount_point, partitions): fstype = "vfat" if "luksMapperName" in partition: - libcalamares.utils.debug("about to mount {!s}".format(partition["luksMapperName"])) - libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), + libcalamares.utils.debug("about to mount " + + partition["luksMapperName"]) + libcalamares.utils.mount("/dev/mapper/" + + partition["luksMapperName"], mount_point, fstype, partition.get("options", ""), @@ -80,37 +84,44 @@ def mount_partitions(root_mount_point, partitions): subprocess.check_call(["umount", "-v", root_mount_point]) if "luksMapperName" in partition: - libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), + libcalamares.utils.mount("/dev/mapper/" + + partition["luksMapperName"], mount_point, fstype, ",".join(["subvol=@", - partition.get("options", "")]), + partition.get("options", + "")]), ) if not has_home_mount_point: - libcalamares.utils.mount("/dev/mapper/{!s}".format(partition["luksMapperName"]), + libcalamares.utils.mount("/dev/mapper/" + + partition["luksMapperName"], root_mount_point + "/home", fstype, ",".join(["subvol=@home", - partition.get("options", "")]), + partition.get("options", + "")]), ) else: libcalamares.utils.mount(partition["device"], mount_point, fstype, ",".join(["subvol=@", - partition.get("options", "")]), + partition.get("options", + "")]), ) if not has_home_mount_point: libcalamares.utils.mount(partition["device"], root_mount_point + "/home", fstype, ",".join(["subvol=@home", - partition.get("options", "")]), + partition.get("options", + "")]), ) def run(): - """ Define mountpoints. + """ + Define mountpoints. :return: """ @@ -132,7 +143,8 @@ def run(): # Remember the extra mounts for the unpackfs module if fw_type == 'efi': - libcalamares.globalstorage.insert("extraMounts", extra_mounts + extra_mounts_efi) + libcalamares.globalstorage.insert("extraMounts", + extra_mounts + extra_mounts_efi) else: libcalamares.globalstorage.insert("extraMounts", extra_mounts) From 5ed51bc5b0a730408e13eac26c02c4e64da387ae Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Fri, 2 Jun 2017 19:58:36 +0200 Subject: [PATCH 2/2] reworked intendation --- src/modules/mount/main.py | 77 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index d69a9b1dc..68f042af9 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -44,14 +44,14 @@ def mount_partitions(root_mount_point, partitions): fstype = "vfat" if "luksMapperName" in partition: - libcalamares.utils.debug("about to mount " - + partition["luksMapperName"]) - libcalamares.utils.mount("/dev/mapper/" - + partition["luksMapperName"], - mount_point, - fstype, - partition.get("options", ""), - ) + libcalamares.utils.debug( + "about to mount {!s}".format(partition["luksMapperName"])) + libcalamares.utils.mount( + "/dev/mapper/{!s}".format(partition["luksMapperName"]), + mount_point, + fstype, + partition.get("options", ""), + ) else: libcalamares.utils.mount(partition["device"], @@ -84,39 +84,36 @@ def mount_partitions(root_mount_point, partitions): subprocess.check_call(["umount", "-v", root_mount_point]) if "luksMapperName" in partition: - libcalamares.utils.mount("/dev/mapper/" - + partition["luksMapperName"], - mount_point, - fstype, - ",".join(["subvol=@", - partition.get("options", - "")]), - ) + libcalamares.utils.mount( + "/dev/mapper/{!s}".format(partition["luksMapperName"]), + mount_point, + fstype, + ",".join( + ["subvol=@", partition.get("options", "")]), + ) if not has_home_mount_point: - libcalamares.utils.mount("/dev/mapper/" - + partition["luksMapperName"], - root_mount_point + "/home", - fstype, - ",".join(["subvol=@home", - partition.get("options", - "")]), - ) + libcalamares.utils.mount( + "/dev/mapper/{!s}".format(partition["luksMapperName"]), + root_mount_point + "/home", + fstype, + ",".join( + ["subvol=@home", partition.get("options", "")]), + ) else: - libcalamares.utils.mount(partition["device"], - mount_point, - fstype, - ",".join(["subvol=@", - partition.get("options", - "")]), - ) + libcalamares.utils.mount( + partition["device"], + mount_point, + fstype, + ",".join(["subvol=@", partition.get("options", "")]), + ) if not has_home_mount_point: - libcalamares.utils.mount(partition["device"], - root_mount_point + "/home", - fstype, - ",".join(["subvol=@home", - partition.get("options", - "")]), - ) + libcalamares.utils.mount( + partition["device"], + root_mount_point + "/home", + fstype, + ",".join( + ["subvol=@home", partition.get("options", "")]), + ) def run(): @@ -143,8 +140,8 @@ def run(): # Remember the extra mounts for the unpackfs module if fw_type == 'efi': - libcalamares.globalstorage.insert("extraMounts", - extra_mounts + extra_mounts_efi) + libcalamares.globalstorage.insert( + "extraMounts", extra_mounts + extra_mounts_efi) else: libcalamares.globalstorage.insert("extraMounts", extra_mounts)