From: Nikos Skalkotos Date: Fri, 22 Mar 2013 12:57:06 +0000 (+0200) Subject: Clean-up the code using flake8 X-Git-Tag: v0.2.8~5 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/61d1432341c988c45edc2d54e6dae3e3843d8eb7 Clean-up the code using flake8 --- diff --git a/image_creator/bundle_volume.py b/image_creator/bundle_volume.py index 9a9a366..aca14b3 100644 --- a/image_creator/bundle_volume.py +++ b/image_creator/bundle_volume.py @@ -380,9 +380,10 @@ class BundleVolume(object): target = tempfile.mkdtemp() try: - absmpoints = self._mount(target, - [(mapped[i], filesystem[i].mpoint) - for i in mapped.keys()]) + self._mount( + target, + [(mapped[i], filesystem[i].mpoint) for i in mapped.keys()]) + excluded = self._to_exclude() rsync = Rsync(self.out) diff --git a/image_creator/dialog_menu.py b/image_creator/dialog_menu.py index 55bcd4e..07fa205 100644 --- a/image_creator/dialog_menu.py +++ b/image_creator/dialog_menu.py @@ -33,7 +33,6 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -import sys import os import textwrap import StringIO @@ -65,7 +64,7 @@ CONFIGURATION_TASKS = [ ] -class metadata_monitor(object): +class MetadataMonitor(object): def __init__(self, session, meta): self.session = session self.meta = meta @@ -554,7 +553,7 @@ def sysprep(session): del session['checksum'] # Monitor the metadata changes during syspreps - with metadata_monitor(session, image_os.meta): + with MetadataMonitor(session, image_os.meta): image_os.do_sysprep() infobox.finalize() @@ -590,7 +589,7 @@ def shrink(session): if not d.yesno("%s\n\nDo you want to continue?" % msg, width=WIDTH, height=12, title="Image Shrinking"): - with metadata_monitor(session, dev.meta): + with MetadataMonitor(session, dev.meta): infobox = InfoBoxOutput(d, "Image Shrinking", height=4) dev.out.add(infobox) try: @@ -640,7 +639,6 @@ def customization_menu(session): def main_menu(session): d = session['dialog'] - dev = session['device'] update_background_title(session) diff --git a/image_creator/dialog_wizard.py b/image_creator/dialog_wizard.py index 0b1b1d7..31aa4a2 100644 --- a/image_creator/dialog_wizard.py +++ b/image_creator/dialog_wizard.py @@ -33,7 +33,6 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -import dialog import time import StringIO diff --git a/image_creator/disk.py b/image_creator/disk.py index a51611e..9017d45 100644 --- a/image_creator/disk.py +++ b/image_creator/disk.py @@ -43,7 +43,6 @@ import os import tempfile import uuid import re -import sys import guestfs import shutil from sendfile import sendfile diff --git a/image_creator/kamaki_wrapper.py b/image_creator/kamaki_wrapper.py index 5963990..f5a40c7 100644 --- a/image_creator/kamaki_wrapper.py +++ b/image_creator/kamaki_wrapper.py @@ -39,8 +39,6 @@ from kamaki.clients.image import ImageClient from kamaki.clients.pithos import PithosClient from kamaki.clients.astakos import AstakosClient -from image_creator.util import FatalError - class Kamaki(object): diff --git a/image_creator/main.py b/image_creator/main.py index 42b480e..497fedf 100644 --- a/image_creator/main.py +++ b/image_creator/main.py @@ -34,7 +34,6 @@ # or implied, of GRNET S.A. from image_creator import __version__ as version -from image_creator import util from image_creator.disk import Disk from image_creator.util import FatalError, MD5 from image_creator.output.cli import SilentOutput, SimpleOutput, \ @@ -196,7 +195,6 @@ def image_creator(): except ClientError as e: raise FatalError("Astakos client: %d %s" % (e.status, e.message)) - disk = Disk(options.source, out, options.tmp) def signal_handler(signum, frame): diff --git a/image_creator/os_type/freebsd.py b/image_creator/os_type/freebsd.py index b5e7491..33ba887 100644 --- a/image_creator/os_type/freebsd.py +++ b/image_creator/os_type/freebsd.py @@ -31,7 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -from image_creator.os_type.unix import Unix, sysprep +from image_creator.os_type.unix import Unix class Freebsd(Unix): diff --git a/image_creator/os_type/hurd.py b/image_creator/os_type/hurd.py index 98c65e5..a294ca1 100644 --- a/image_creator/os_type/hurd.py +++ b/image_creator/os_type/hurd.py @@ -31,7 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -from image_creator.os_type.unix import Unix, sysprep +from image_creator.os_type.unix import Unix class Hurd(Unix): diff --git a/image_creator/os_type/netbsd.py b/image_creator/os_type/netbsd.py index 57e50e4..bfb94d6 100644 --- a/image_creator/os_type/netbsd.py +++ b/image_creator/os_type/netbsd.py @@ -31,7 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -from image_creator.os_type.unix import Unix, sysprep +from image_creator.os_type.unix import Unix class Netbsd(Unix): diff --git a/image_creator/os_type/ubuntu.py b/image_creator/os_type/ubuntu.py index 6a048e5..cc6e973 100644 --- a/image_creator/os_type/ubuntu.py +++ b/image_creator/os_type/ubuntu.py @@ -31,7 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -from image_creator.os_type.linux import Linux, sysprep +from image_creator.os_type.linux import Linux class Ubuntu(Linux): diff --git a/image_creator/os_type/unix.py b/image_creator/os_type/unix.py index 2cd8452..a1ef905 100644 --- a/image_creator/os_type/unix.py +++ b/image_creator/os_type/unix.py @@ -32,7 +32,6 @@ # or implied, of GRNET S.A. import re -import sys from image_creator.os_type import OSBase, sysprep diff --git a/image_creator/os_type/windows.py b/image_creator/os_type/windows.py index 405a7d9..7ba6767 100644 --- a/image_creator/os_type/windows.py +++ b/image_creator/os_type/windows.py @@ -31,7 +31,7 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -from image_creator.os_type import OSBase, sysprep +from image_creator.os_type import OSBase class Windows(OSBase): diff --git a/image_creator/util.py b/image_creator/util.py index 8730143..b4d5000 100644 --- a/image_creator/util.py +++ b/image_creator/util.py @@ -31,7 +31,6 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. -import sys import sh import hashlib import time