From 4dbb097fd33c3dd928b780552cc3d5e075059beb Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Wed, 29 Mar 2017 19:03:56 +0200 Subject: [PATCH 1/2] Fixed pep8 whining for module fstab compact the fstab line added myself to copyright --- src/modules/fstab/main.py | 43 ++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 622f55c44..384dadbb6 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -5,6 +5,7 @@ # # Copyright 2014, Aurélien Gâteau # Copyright 2016, Teo Mrnjavac +# 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 @@ -32,7 +33,7 @@ FSTAB_HEADER = """# /etc/fstab: static file system information. # be used with UUID= as a more robust way to name devices that works even if # disks are added and removed. See fstab(5). # -# """ +# """ CRYPTTAB_HEADER = """# /etc/crypttab: mappings for encrypted partitions. # @@ -46,7 +47,7 @@ CRYPTTAB_HEADER = """# /etc/crypttab: mappings for encrypted partitions. # to encrypted swap, which should be set up with mkinitcpio-openswap # for resume support. # -# """ +# """ # Turn Parted filesystem names into fstab names FS_MAP = { @@ -168,7 +169,7 @@ class FstabGenerator(object): dct["device"], dct["password"], dct["options"], - ) + ) print(line, file=file) @@ -181,8 +182,10 @@ class FstabGenerator(object): print(FSTAB_HEADER, file=fstab_file) for partition in self.partitions: - # Special treatment for a btrfs root with @ and @home subvolumes - if partition["fs"] == "btrfs" and partition["mountPoint"] == "/": + # Special treatment for a btrfs root with @ and @home + # subvolumes + if (partition["fs"] == "btrfs" + and partition["mountPoint"] == "/"): output = subprocess.check_output(['btrfs', 'subvolume', 'list', @@ -216,7 +219,7 @@ class FstabGenerator(object): fs="tmpfs", options="defaults,noatime,mode=1777", check=0, - ) + ) self.print_fstab_line(dct, file=fstab_file) def generate_fstab_line_info(self, partition): @@ -249,13 +252,15 @@ class FstabGenerator(object): self.root_is_ssd = is_ssd if filesystem == "btrfs" and "subvol" in partition: - return dict(device="UUID=" + partition["uuid"], - mount_point=mount_point, - fs=filesystem, - options=",".join(["subvol={}".format(partition["subvol"]), - options]), - check=check, - ) + return dict( + device="UUID=" + partition["uuid"], + mount_point=mount_point, + fs=filesystem, + options=",".join( + ["subvol={}".format(partition["subvol"]), options] + ), + check=check, + ) return dict(device="UUID=" + partition["uuid"], mount_point=mount_point or "swap", @@ -266,12 +271,12 @@ class FstabGenerator(object): def print_fstab_line(self, dct, file=None): """ Prints line to '/etc/fstab' file. """ - line = "{:41} {:<14} {:<7} {:<10} 0 {}".format(dct["device"], - dct["mount_point"], - dct["fs"], - dct["options"], - dct["check"], - ) + line = "{:41} {:<14} {:<7} {:<10} 0 {}".format(dct["device"], + dct["mount_point"], + dct["fs"], + dct["options"], + dct["check"], + ) print(line, file=file) def create_mount_points(self): From 536054b0cd2e9e1d1cbb8fe61c3a624fd03b3491 Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Wed, 29 Mar 2017 16:44:53 +0200 Subject: [PATCH 2/2] Fixed pep8 whining in modulde initramfs added myself to copyright --- src/modules/initramfs/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/initramfs/main.py b/src/modules/initramfs/main.py index 58fb296b9..947c034ea 100644 --- a/src/modules/initramfs/main.py +++ b/src/modules/initramfs/main.py @@ -4,6 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2014, Philip Müller +# 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 @@ -29,4 +30,7 @@ def run(): return_code = target_env_call(["update-initramfs", "-k", "all", "-u"]) if return_code != 0: - return "Failed to run update-initramfs on the target", "The exit code was {}".format(return_code) + return ( + "Failed to run update-initramfs on the target", + "The exit code was {}".format(return_code) + )