From 9e9e1e655008fc83f18bfd6ee8ed024d24e0adfb Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Fri, 2 Jun 2017 23:34:14 +0200 Subject: [PATCH] Fixed pep8 whining in module initramfscfg added myself to copyright --- src/modules/initramfscfg/main.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/modules/initramfscfg/main.py b/src/modules/initramfscfg/main.py index f889b7b16..21dcaee9d 100644 --- a/src/modules/initramfscfg/main.py +++ b/src/modules/initramfscfg/main.py @@ -7,6 +7,7 @@ # Copyright 2015, Philip Müller # Copyright 2016, David McKinney # Copyright 2016, Kevin Kofler +# 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,8 +26,10 @@ import libcalamares import os import shutil + def copy_initramfs_hooks(partitions, root_mount_point): - """ Copies initramfs hooks so they are picked up by update-initramfs + """ + Copies initramfs hooks so they are picked up by update-initramfs :param partitions: :param root_mount_point: @@ -38,18 +41,31 @@ def copy_initramfs_hooks(partitions, root_mount_point): if partition["mountPoint"] == "/" and "luksMapperName" in partition: encrypt_hook = True - if partition["mountPoint"] == "/boot" and "luksMapperName" not in partition: + if (partition["mountPoint"] == "/boot" + and "luksMapperName" not in partition): unencrypted_separate_boot = True if encrypt_hook: if unencrypted_separate_boot: - shutil.copy2("/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey", "{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(root_mount_point)) + shutil.copy2( + "/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey", + "{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format( + root_mount_point) + ) else: - shutil.copy2("/usr/lib/calamares/modules/initramfscfg/encrypt_hook", "{!s}/usr/share/initramfs-tools/hooks/".format(root_mount_point)) - os.chmod("{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(root_mount_point), 0o755) + shutil.copy2( + "/usr/lib/calamares/modules/initramfscfg/encrypt_hook", + "{!s}/usr/share/initramfs-tools/hooks/".format( + root_mount_point) + ) + os.chmod("{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format( + root_mount_point), 0o755 + ) + def run(): - """ Calls routine with given parameters to configure initramfs + """ + Calls routine with given parameters to configure initramfs :return: """