[master 2/4] Fix the easy PEP8 violations.

dwlehman installerbot-noreply at redhat.com
Wed Oct 28 20:05:36 UTC 2015


From: David Lehman <dlehman at redhat.com>

This is mostly adding blank lines, removing unneeded spaces, &c.

I ran the following command to generate these changes:

  python3-autopep8 --ignore E501,E1 --in-place $(find . -name \*.py)
---
 blivet/__init__.py                           |  42 ++++++----
 blivet/actionlist.py                         |   2 +
 blivet/arch.py                               |  61 +++++++++------
 blivet/autopart.py                           |   7 +-
 blivet/blivet.py                             |  21 +++--
 blivet/callbacks.py                          |   1 +
 blivet/deviceaction.py                       |  28 +++++--
 blivet/devicefactory.py                      |  50 ++++++++----
 blivet/devicelibs/crypto.py                  |   2 +-
 blivet/devicelibs/edd.py                     |  39 ++++++----
 blivet/devicelibs/lvm.py                     |  15 +++-
 blivet/devicelibs/mdraid.py                  |   2 +
 blivet/devicelibs/raid.py                    |  44 ++++++++---
 blivet/devices/btrfs.py                      |   7 ++
 blivet/devices/cache.py                      |   5 ++
 blivet/devices/container.py                  |   2 +
 blivet/devices/device.py                     |   6 +-
 blivet/devices/disk.py                       |  29 ++++---
 blivet/devices/dm.py                         |   5 +-
 blivet/devices/file.py                       |   9 ++-
 blivet/devices/lib.py                        |   8 +-
 blivet/devices/loop.py                       |   2 +
 blivet/devices/luks.py                       |   2 +
 blivet/devices/lvm.py                        |  62 +++++++++++----
 blivet/devices/md.py                         |  10 ++-
 blivet/devices/network.py                    |   2 +
 blivet/devices/nfs.py                        |   2 +
 blivet/devices/nodev.py                      |   4 +
 blivet/devices/optical.py                    |   4 +-
 blivet/devices/partition.py                  |  14 ++--
 blivet/devices/raid.py                       |   8 +-
 blivet/devices/storage.py                    |  10 ++-
 blivet/devicetree.py                         |  21 ++---
 blivet/errors.py                             |  65 ++++++++++++++++
 blivet/fcoe.py                               |   5 +-
 blivet/flags.py                              |   2 +
 blivet/formats/__init__.py                   |  17 +++-
 blivet/formats/biosboot.py                   |   4 +-
 blivet/formats/disklabel.py                  |  13 ++--
 blivet/formats/dmraid.py                     |   3 +-
 blivet/formats/fs.py                         |  45 +++++++----
 blivet/formats/fslib.py                      |   3 +-
 blivet/formats/luks.py                       |   3 +-
 blivet/formats/lvmpv.py                      |   1 +
 blivet/formats/mdraid.py                     |   1 +
 blivet/formats/multipath.py                  |   6 +-
 blivet/formats/prepboot.py                   |   2 +
 blivet/formats/swap.py                       |   5 +-
 blivet/i18n.py                               |   5 +-
 blivet/iscsi.py                              |  30 ++++----
 blivet/mounts.py                             |   4 +
 blivet/osinstall.py                          |  51 ++++++++----
 blivet/partitioning.py                       |  46 +++++++++--
 blivet/partspec.py                           |   2 +
 blivet/platform.py                           |  16 +++-
 blivet/populator.py                          |  19 +++--
 blivet/size.py                               |  13 +++-
 blivet/storage_log.py                        |   4 +
 blivet/tasks/availability.py                 |  20 +++++
 blivet/tasks/fsck.py                         |   5 ++
 blivet/tasks/fsinfo.py                       |   8 ++
 blivet/tasks/fslabeling.py                   |  10 +++
 blivet/tasks/fsminsize.py                    |   6 +-
 blivet/tasks/fsmkfs.py                       |  16 ++++
 blivet/tasks/fsmount.py                      |  14 ++++
 blivet/tasks/fsreadlabel.py                  |   7 ++
 blivet/tasks/fsresize.py                     |  10 ++-
 blivet/tasks/fssize.py                       |   8 ++
 blivet/tasks/fssync.py                       |   5 ++
 blivet/tasks/fstask.py                       |   4 +
 blivet/tasks/fswritelabel.py                 |   9 +++
 blivet/tasks/task.py                         |   6 ++
 blivet/tsort.py                              |   5 +-
 blivet/udev.py                               |  94 +++++++++++++++++++++--
 blivet/util.py                               |  72 +++++++++++++++--
 blivet/zfcp.py                               |  67 ++++++++--------
 doc/conf.py                                  |   5 +-
 setup.py                                     |   8 +-
 tests/action_test.py                         |   4 +-
 tests/clearpart_test.py                      |   2 +
 tests/devicefactory_test.py                  |  81 ++++++++++---------
 tests/devicelibs_test/edd_test.py            |  13 +++-
 tests/devicelibs_test/mdraid_test.py         |   3 +-
 tests/devicelibs_test/raid_test.py           |  38 ++++-----
 tests/devices_test/dependencies_test.py      |  10 ++-
 tests/devices_test/device_names_test.py      |   2 +
 tests/devices_test/device_packages_test.py   |   4 +-
 tests/devices_test/device_properties_test.py | 111 ++++++++++++++-------------
 tests/devices_test/lvm_test.py               |   2 +
 tests/devices_test/network_test.py           |   3 +
 tests/devices_test/partition_test.py         |   7 +-
 tests/devices_test/size_test.py              |  26 ++++---
 tests/devicetree_test.py                     |  30 ++++++--
 tests/formats_test/device_test.py            |   2 +
 tests/formats_test/disklabel_test.py         |   4 +-
 tests/formats_test/fs_test.py                |  30 +++++++-
 tests/formats_test/fslabeling.py             |   7 +-
 tests/formats_test/fstesting.py              |   2 +
 tests/formats_test/init_test.py              |  19 ++---
 tests/formats_test/labeling_test.py          |  19 ++++-
 tests/formats_test/selinux_test.py           |   2 +
 tests/imagebackedtestcase.py                 |   6 +-
 tests/loopbackedtestcase.py                  |   5 ++
 tests/parentlist_test.py                     |   2 +
 tests/partitioning_test.py                   |  14 ++--
 tests/pylint/runpylint.py                    |   6 +-
 tests/size_test.py                           |  63 +++++++--------
 tests/storagetestcase.py                     |   5 +-
 tests/tasks_test/basic_tests.py              |   4 +
 tests/tsort_test.py                          |   4 +-
 tests/udev_test.py                           |   1 +
 tests/util_test.py                           |   1 +
 112 files changed, 1317 insertions(+), 485 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 950fc40..1f06075 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -23,11 +23,11 @@
 __version__ = '1.15'
 
 ##
-## Default stub values for installer-specific stuff that gets set up in
-## enable_installer_mode.  These constants are only for use inside this file.
-## For use in other blivet files, they must either be passed to the function
-## in question or care must be taken so they are imported only after
-## enable_installer_mode is called.
+# Default stub values for installer-specific stuff that gets set up in
+# enable_installer_mode.  These constants are only for use inside this file.
+# For use in other blivet files, they must either be passed to the function
+# in question or care must be taken so they are imported only after
+# enable_installer_mode is called.
 ##
 iutil = None
 ROOT_PATH = '/'
@@ -36,7 +36,9 @@
 short_product_name = 'blivet'
 ERROR_RAISE = 0
 
+
 class ErrorHandler(object):
+
     def cb(self, exn):
         # pylint: disable=unused-argument
         return ERROR_RAISE
@@ -46,7 +48,7 @@ def cb(self, exn):
 get_bootloader = lambda: None
 
 ##
-## end installer stubs
+# end installer stubs
 ##
 
 import sys
@@ -90,10 +92,11 @@ def cb(self, exn):
 else:
     avail_plugs = set(avail_plugs)
 
-missing_plugs =  _REQUESTED_PLUGIN_NAMES - avail_plugs
+missing_plugs = _REQUESTED_PLUGIN_NAMES - avail_plugs
 for p in missing_plugs:
     log.info("Failed to load plugin %s", p)
 
+
 def enable_installer_mode():
     """ Configure the module for use by anaconda (OS installer). """
     global iutil
@@ -105,19 +108,19 @@ def enable_installer_mode():
     global error_handler
     global ERROR_RAISE
 
-    from pyanaconda import iutil # pylint: disable=redefined-outer-name
-    from pyanaconda.constants import shortProductName as short_product_name # pylint: disable=redefined-outer-name
-    from pyanaconda.bootloader import getBootloader as get_bootloader # pylint: disable=redefined-outer-name
-    from pyanaconda.errors import errorHandler as error_handler # pylint: disable=redefined-outer-name
-    from pyanaconda.errors import ERROR_RAISE # pylint: disable=redefined-outer-name
+    from pyanaconda import iutil  # pylint: disable=redefined-outer-name
+    from pyanaconda.constants import shortProductName as short_product_name  # pylint: disable=redefined-outer-name
+    from pyanaconda.bootloader import getBootloader as get_bootloader  # pylint: disable=redefined-outer-name
+    from pyanaconda.errors import errorHandler as error_handler  # pylint: disable=redefined-outer-name
+    from pyanaconda.errors import ERROR_RAISE  # pylint: disable=redefined-outer-name
 
     if hasattr(iutil, 'getTargetPhysicalRoot'):
         # For anaconda versions > 21.43
-        _storage_root = iutil.getTargetPhysicalRoot() # pylint: disable=no-name-in-module
+        _storage_root = iutil.getTargetPhysicalRoot()  # pylint: disable=no-name-in-module
         _sysroot = iutil.getSysroot()
     else:
         # For prior anaconda versions
-        from pyanaconda.constants import ROOT_PATH # pylint: disable=redefined-outer-name,no-name-in-module
+        from pyanaconda.constants import ROOT_PATH  # pylint: disable=redefined-outer-name,no-name-in-module
         _storage_root = _sysroot = ROOT_PATH
 
     from pyanaconda.anaconda_log import program_log_lock
@@ -125,6 +128,7 @@ def enable_installer_mode():
 
     flags.installer_mode = True
 
+
 def get_sysroot():
     """Returns the path to the target OS installation.
 
@@ -133,6 +137,7 @@ def get_sysroot():
     """
     return _sysroot
 
+
 def get_target_physical_root():
     """Returns the path to the "physical" storage root.
 
@@ -142,6 +147,7 @@ def get_target_physical_root():
     """
     return _storage_root
 
+
 def set_sysroot(storage_root, sysroot=None):
     """Change the OS root path.
        :param storage_root: The root of physical storage
@@ -153,7 +159,9 @@ def set_sysroot(storage_root, sysroot=None):
     if sysroot is not None:
         _sysroot = sysroot
 
+
 class _LazyImportObject(object):
+
     """
     A simple class that uses sys.modules and importlib to implement a
     lazy-imported object. Once it is called (or instantiated) or an attribute of
@@ -175,19 +183,19 @@ def __init__(self, name, real_mod):
         self._real_mod = real_mod
 
     def __call__(self, *args, **kwargs):
-        mod = importlib.import_module(__package__+"."+self._real_mod)
+        mod = importlib.import_module(__package__ + "." + self._real_mod)
         val = getattr(mod, self._name)
         sys.modules["%s.%s" % (__package__, self._name)] = val
         return val(*args, **kwargs)
 
     def __getattr__(self, attr):
-        mod = importlib.import_module(__package__+"."+self._real_mod)
+        mod = importlib.import_module(__package__ + "." + self._real_mod)
         val = getattr(mod, self._name)
         sys.modules["%s.%s" % (__package__, self._name)] = val
         return getattr(val, attr)
 
     def __dir__(self):
-        mod = importlib.import_module(__package__+"."+self._real_mod)
+        mod = importlib.import_module(__package__ + "." + self._real_mod)
         val = getattr(mod, self._name)
         sys.modules["%s.%s" % (__package__, self._name)] = val
         return dir(val)
diff --git a/blivet/actionlist.py b/blivet/actionlist.py
index 29af89b..915466d 100644
--- a/blivet/actionlist.py
+++ b/blivet/actionlist.py
@@ -33,7 +33,9 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 class ActionList(object):
+
     def __init__(self):
         self._actions = []
         self._completed_actions = []
diff --git a/blivet/arch.py b/blivet/arch.py
index ed81438..9a26e8f 100644
--- a/blivet/arch.py
+++ b/blivet/arch.py
@@ -43,6 +43,7 @@
 # DMI information paths
 DMI_CHASSIS_VENDOR = "/sys/class/dmi/id/chassis_vendor"
 
+
 def get_ppc_machine():
     """
     :return: The PPC machine type, or None if not PPC.
@@ -54,26 +55,26 @@ def get_ppc_machine():
 
     # ppc machine hash
     # Note: This is a substring match!
-    ppc_type = { 'Mac'      : 'PMac',
-                'Book'     : 'PMac',
-                'CHRP'     : 'pSeries',
-                'CHRP IBM' : 'pSeries', # @TODO the CHRP entry above should match this
-                'Pegasos'  : 'Pegasos',
-                'Efika'    : 'Efika',
-                'iSeries'  : 'iSeries',
-                'pSeries'  : 'pSeries',
-                'PReP'     : 'PReP',
-                'Amiga'    : 'APUS',
-                'Gemini'   : 'Gemini',
-                'Shiner'   : 'ANS',
-                'BRIQ'     : 'BRIQ',
-                'Teron'    : 'Teron',
-                'AmigaOne' : 'Teron',
-                'Maple'    : 'pSeries',
-                'Cell'     : 'pSeries',
-                'Momentum' : 'pSeries',
-                'PS3'      : 'PS3',
-                'PowerNV'  : 'pSeries'
+    ppc_type = {'Mac': 'PMac',
+                'Book': 'PMac',
+                'CHRP': 'pSeries',
+                'CHRP IBM': 'pSeries',  # @TODO the CHRP entry above should match this
+                'Pegasos': 'Pegasos',
+                'Efika': 'Efika',
+                'iSeries': 'iSeries',
+                'pSeries': 'pSeries',
+                'PReP': 'PReP',
+                'Amiga': 'APUS',
+                'Gemini': 'Gemini',
+                'Shiner': 'ANS',
+                'BRIQ': 'BRIQ',
+                'Teron': 'Teron',
+                'AmigaOne': 'Teron',
+                'Maple': 'pSeries',
+                'Cell': 'pSeries',
+                'Momentum': 'pSeries',
+                'PS3': 'PS3',
+                'PowerNV': 'pSeries'
                 }
     machine = None
     platform = None
@@ -97,6 +98,7 @@ def get_ppc_machine():
 
     return None
 
+
 def get_ppc_mac_id():
     """
     :return: The powermac machine type, or None if not PPC or a powermac.
@@ -117,6 +119,7 @@ def get_ppc_mac_id():
     log.warning("No Power Mac machine id")
     return None
 
+
 def get_ppc_mac_gen():
     """
     :return: The PPC generation, or None if not PPC or a powermac.
@@ -150,6 +153,7 @@ def get_ppc_mac_gen():
     log.warning("Unknown Power Mac generation: %s", gen)
     return None
 
+
 def get_ppc_mac_book():
     """
     :return: True if the hardware is an i_book or PowerBook, False otherwise.
@@ -169,6 +173,7 @@ def get_ppc_mac_book():
 
     return False
 
+
 def is_aarch64():
     """
     :return: True if the hardware supports Aarch64, False otherwise.
@@ -177,6 +182,7 @@ def is_aarch64():
     """
     return os.uname()[4] == 'aarch64'
 
+
 def get_arm_machine():
     """
     :return: The ARM processor variety type, or None if not ARM.
@@ -189,7 +195,7 @@ def get_arm_machine():
     if flags.arm_platform:
         return flags.arm_platform
 
-    arm_machine = os.uname()[2].rpartition('.' )[2]
+    arm_machine = os.uname()[2].rpartition('.')[2]
 
     if arm_machine.startswith('arm'):
         # @TBD - Huh? Don't you want the arm machine name here?
@@ -197,6 +203,7 @@ def get_arm_machine():
     else:
         return arm_machine
 
+
 def is_cell():
     """
     :return: True if the hardware is the Cell platform, False otherwise.
@@ -213,6 +220,7 @@ def is_cell():
 
     return False
 
+
 def is_mactel():
     """
     :return: True if the hardware is an Intel-based Apple Mac, False otherwise.
@@ -231,6 +239,7 @@ def is_mactel():
             mactel = False
     return mactel
 
+
 def is_efi():
     """
     :return: True if the hardware supports EFI, False otherwise.
@@ -245,6 +254,7 @@ def is_efi():
 
 # Architecture checking functions
 
+
 def is_x86(bits=None):
     """:return: True if the hardware supports X86, False otherwise.
     :rtype: boolean
@@ -275,6 +285,7 @@ def is_x86(bits=None):
 
     return False
 
+
 def is_ppc(bits=None):
     """
     :return: True if the hardware supports PPC, False otherwise.
@@ -297,6 +308,7 @@ def is_ppc(bits=None):
 
     return False
 
+
 def is_s390():
     """
     :return: True if the hardware supports PPC, False otherwise.
@@ -305,6 +317,7 @@ def is_s390():
     """
     return os.uname()[4].startswith('s390')
 
+
 def is_ia64():
     """
     :return: True if the hardware supports IA64, False otherwise.
@@ -313,6 +326,7 @@ def is_ia64():
     """
     return os.uname()[4] == 'ia64'
 
+
 def is_alpha():
     """
     :return: True if the hardware supports Alpha, False otherwise.
@@ -321,6 +335,7 @@ def is_alpha():
     """
     return os.uname()[4].startswith('alpha')
 
+
 def is_arm():
     """
     :return: True if the hardware supports ARM, False otherwise.
@@ -329,6 +344,7 @@ def is_arm():
     """
     return os.uname()[4].startswith('arm')
 
+
 def get_arch():
     """
     :return: The hardware architecture
@@ -353,6 +369,7 @@ def get_arch():
     else:
         return os.uname()[4]
 
+
 def num_bits():
     """ Return an integer representing the length
         of the "word" used by the current architecture
@@ -371,6 +388,6 @@ def num_bits():
         # number to an integer
         (nbits, _rest) = nbits.split("bit", 1)
         return int(nbits)
-    except Exception: # pylint: disable=broad-except
+    except Exception:  # pylint: disable=broad-except
         log_exception_info(log.error, "architecture word size detection failed")
         return None
diff --git a/blivet/autopart.py b/blivet/autopart.py
index c33f6e0..4532858 100644
--- a/blivet/autopart.py
+++ b/blivet/autopart.py
@@ -40,6 +40,7 @@
 # maximum ratio of swap size to disk size (10 %)
 MAX_SWAP_DISK_RATIO = Decimal('0.1')
 
+
 def swap_suggestion(quiet=False, hibernation=False, disk_space=None):
     """
     Suggest the size of the swap partition that will be created.
@@ -91,7 +92,7 @@ def swap_suggestion(quiet=False, hibernation=False, disk_space=None):
         if swap > max_swap:
             log.info("Suggested swap size (%(swap)s) exceeds %(percent)d %% of "
                      "disk space, using %(percent)d %% of disk space (%(size)s) "
-                     "instead.", {"percent": MAX_SWAP_DISK_RATIO*100,
+                     "instead.", {"percent": MAX_SWAP_DISK_RATIO * 100,
                                   "swap": swap,
                                   "size": max_swap})
             swap = max_swap
@@ -101,6 +102,7 @@ def swap_suggestion(quiet=False, hibernation=False, disk_space=None):
 
     return swap
 
+
 def _get_candidate_disks(storage):
     """ Return a list of disks to be used for autopart/reqpart.
 
@@ -133,6 +135,7 @@ def _get_candidate_disks(storage):
 
     return disks
 
+
 def _schedule_implicit_partitions(storage, disks, min_luks_entropy=0):
     """ Schedule creation of a lvm/btrfs member partitions for autopart.
 
@@ -179,6 +182,7 @@ def _schedule_implicit_partitions(storage, disks, min_luks_entropy=0):
 
     return devs
 
+
 def _schedule_partitions(storage, disks, implicit_devices, min_luks_entropy=0, requests=None):
     """ Schedule creation of autopart/reqpart partitions.
 
@@ -321,6 +325,7 @@ def _schedule_partitions(storage, disks, implicit_devices, min_luks_entropy=0, r
 
     return implicit_devices
 
+
 def _schedule_volumes(storage, devs):
     """ Schedule creation of autopart lvm/btrfs volumes.
 
diff --git a/blivet/blivet.py b/blivet/blivet.py
index e87d7a4..3d57cec 100644
--- a/blivet/blivet.py
+++ b/blivet/blivet.py
@@ -60,6 +60,7 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 def empty_device(device, devicetree):
     empty = True
     if device.partitioned:
@@ -70,8 +71,11 @@ def empty_device(device, devicetree):
 
     return empty
 
+
 class StorageDiscoveryConfig(object):
+
     """ Class to encapsulate various detection/initialization parameters. """
+
     def __init__(self):
         # storage configuration variables
         self.ignore_disk_interactive = False
@@ -103,8 +107,11 @@ def update(self, ksdata):
         self.initialize_disks = ksdata.clearpart.init_all
         self.zero_mbr = ksdata.zerombr.zerombr
 
+
 class Blivet(object):
+
     """ Top-level class for managing storage configuration. """
+
     def __init__(self, ksdata=None):
         """
             :keyword ksdata: kickstart data store
@@ -235,7 +242,7 @@ def shutdown(self):
 
         try:
             self.devicetree.teardown_all()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.error, "failure tearing down device tree")
 
     def reset(self, cleanup_only=False):
@@ -806,7 +813,6 @@ def new_partition(self, *args, **kwargs):
                 kwargs["weight"] = _platform.weight(mountpoint=mountpoint,
                                                         fstype=fmt.type)
 
-
         return PartitionDevice(name, *args, **kwargs)
 
     def new_mdarray(self, *args, **kwargs):
@@ -934,7 +940,7 @@ def new_lv(self, *args, **kwargs):
             full_name = "%s-%s" % (safe_vg_name, name)
             safe_name = self.safe_device_name(full_name)
             if safe_name != full_name:
-                new_name = safe_name[len(safe_vg_name)+1:]
+                new_name = safe_name[len(safe_vg_name) + 1:]
                 log.warning("using '%s' instead of specified name '%s'",
                                 new_name, name)
                 name = new_name
@@ -1291,6 +1297,7 @@ def suggest_device_name(self, parent=None, swap=None,
         template = self.safe_device_name(prefix + body)
         names = self.names
         name = template
+
         def full_name(name, parent):
             full = ""
             if parent:
@@ -1511,7 +1518,7 @@ def _check_valid_fstype(self, newtype):
             log.debug("invalid default fstype: %r", fmt)
             raise ValueError("new value %s is not valid as a default fs type" % fmt)
 
-        self._default_fstype = newtype # pylint: disable=attribute-defined-outside-init
+        self._default_fstype = newtype  # pylint: disable=attribute-defined-outside-init
 
     def set_default_boot_fstype(self, newtype):
         """ Set the default /boot fstype for this instance.
@@ -1535,7 +1542,7 @@ def set_default_fstype(self, newtype):
         log.debug("trying to set new default fstype to '%s'", newtype)
         # This will raise ValueError if it isn't valid
         self._check_valid_fstype(newtype)
-        self._default_fstype = newtype # pylint: disable=attribute-defined-outside-init
+        self._default_fstype = newtype  # pylint: disable=attribute-defined-outside-init
 
     @property
     def mountpoints(self):
@@ -1658,7 +1665,7 @@ def factory_device(self, device_type, size, **kwargs):
         log_method_call(self, device_type, size, **kwargs)
 
         # we can't do anything with existing devices
-        #if device and device.exists:
+        # if device and device.exists:
         #    log.info("factoryDevice refusing to change device %s", device)
         #    return
 
@@ -1677,7 +1684,7 @@ def factory_device(self, device_type, size, **kwargs):
         if not factory.disks:
             raise StorageError("no disks specified for new device")
 
-        self.size_sets = [] # clear this since there are no growable reqs now
+        self.size_sets = []  # clear this since there are no growable reqs now
         factory.configure()
         return factory.device
 
diff --git a/blivet/callbacks.py b/blivet/callbacks.py
index 23ac52e..52f59ab 100644
--- a/blivet/callbacks.py
+++ b/blivet/callbacks.py
@@ -38,6 +38,7 @@
                                  "wait_for_entropy",
                                  "report_progress"])
 
+
 def create_new_callbacks_register(create_format_pre=None,
                                   create_format_post=None,
                                   resize_format_pre=None,
diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
index 820a34f..ffb6c5f 100644
--- a/blivet/deviceaction.py
+++ b/blivet/deviceaction.py
@@ -70,33 +70,38 @@
 resize_strings = {RESIZE_SHRINK: "Shrink",
                   RESIZE_GROW: "Grow"}
 
+
 def action_type_from_string(type_string):
     if type_string is None:
         return None
 
-    for (k,v) in action_strings.items():
+    for (k, v) in action_strings.items():
         if v.lower() == type_string.lower():
             return k
 
     return resize_type_from_string(type_string)
 
+
 def action_object_from_string(type_string):
     if type_string is None:
         return None
 
-    for (k,v) in object_strings.items():
+    for (k, v) in object_strings.items():
         if v.lower() == type_string.lower():
             return k
 
+
 def resize_type_from_string(type_string):
     if type_string is None:
         return None
 
-    for (k,v) in resize_strings.items():
+    for (k, v) in resize_strings.items():
         if v.lower() == type_string.lower():
             return k
 
+
 class DeviceAction(util.ObjectID):
+
     """ An action that will be carried out in the future on a Device.
 
         These classes represent actions to be performed on devices or
@@ -196,11 +201,11 @@ def is_resize(self):
 
     @property
     def is_shrink(self):
-        return (self.is_resize and self.dir == RESIZE_SHRINK) # pylint: disable=no-member
+        return (self.is_resize and self.dir == RESIZE_SHRINK)  # pylint: disable=no-member
 
     @property
     def is_grow(self):
-        return (self.is_resize and self.dir == RESIZE_GROW) # pylint: disable=no-member
+        return (self.is_resize and self.dir == RESIZE_GROW)  # pylint: disable=no-member
 
     @property
     def is_add(self):
@@ -241,7 +246,7 @@ def resize_string(self):
         """ String representing the direction of a resize action. """
         s = ""
         if self.is_resize:
-            s = resize_strings[self.dir] # pylint: disable=no-member
+            s = resize_strings[self.dir]  # pylint: disable=no-member
 
         return s
 
@@ -295,6 +300,7 @@ def obsoletes(self, action):
 
 
 class ActionCreateDevice(DeviceAction):
+
     """ Action representing the creation of a new device. """
     type = ACTION_TYPE_CREATE
     obj = ACTION_OBJECT_DEVICE
@@ -349,6 +355,7 @@ def requires(self, action):
 
 
 class ActionDestroyDevice(DeviceAction):
+
     """ An action representing the deletion of an existing device. """
     type = ACTION_TYPE_DESTROY
     obj = ACTION_OBJECT_DEVICE
@@ -423,6 +430,7 @@ def obsoletes(self, action):
 
 
 class ActionResizeDevice(DeviceAction):
+
     """ An action representing the resizing of an existing device. """
     type = ACTION_TYPE_RESIZE
     obj = ACTION_OBJECT_DEVICE
@@ -505,6 +513,7 @@ def requires(self, action):
 
 
 class ActionCreateFormat(DeviceAction):
+
     """ An action representing creation of a new filesystem. """
     type = ACTION_TYPE_CREATE
     obj = ACTION_OBJECT_FORMAT
@@ -554,7 +563,7 @@ def execute(self, callbacks=None):
         if isinstance(self.device, PartitionDevice):
             for flag in partitionFlag.keys():
                 # Keep the LBA flag on pre-existing partitions
-                if flag in [ PARTITION_LBA, self.format.parted_flag ]:
+                if flag in [PARTITION_LBA, self.format.parted_flag]:
                     continue
                 self.device.unset_flag(flag)
 
@@ -647,6 +656,7 @@ def obsoletes(self, action):
 
 
 class ActionDestroyFormat(DeviceAction):
+
     """ An action representing the removal of an existing filesystem. """
     type = ACTION_TYPE_DESTROY
     obj = ACTION_OBJECT_FORMAT
@@ -738,7 +748,9 @@ def obsoletes(self, action):
 
         return retval
 
+
 class ActionResizeFormat(DeviceAction):
+
     """ An action representing the resizing of an existing filesystem.
 
         XXX Do we even want to support resizing of a filesystem without
@@ -829,6 +841,7 @@ def requires(self, action):
 
 
 class ActionAddMember(DeviceAction):
+
     """ An action representing addition of a member device to a container. """
     type = ACTION_TYPE_ADD
     obj = ACTION_OBJECT_CONTAINER
@@ -893,6 +906,7 @@ def obsoletes(self, action):
 
 
 class ActionRemoveMember(DeviceAction):
+
     """ An action representing removal of a member device from a container. """
     type = ACTION_TYPE_REMOVE
     obj = ACTION_OBJECT_CONTAINER
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 10e978e..f76496a 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -54,6 +54,7 @@
 DEVICE_TYPE_DISK = 4
 DEVICE_TYPE_LVM_THINP = 5
 
+
 def is_supported_device_type(device_type):
     """ Return True if blivet supports this device type.
 
@@ -77,6 +78,7 @@ def is_supported_device_type(device_type):
 
     return not any(c.unavailable_type_dependencies() for c in devices)
 
+
 def get_supported_raid_levels(device_type):
     """ Return the supported raid levels for this device type.
 
@@ -99,6 +101,7 @@ def get_supported_raid_levels(device_type):
     else:
         return set()
 
+
 def get_device_type(device):
     # the only time we should ever get a thin pool here is when we're removing
     # an empty pool after removing the last thin lv, so the only thing we'll be
@@ -121,7 +124,6 @@ def get_device_type(device):
     return device_type
 
 
-
 def get_device_factory(blivet, device_type, size, **kwargs):
     """ Return a suitable DeviceFactory instance for device_type. """
     disks = kwargs.pop("disks", [])
@@ -140,6 +142,7 @@ def get_device_factory(blivet, device_type, size, **kwargs):
 
 
 class DeviceFactory(object):
+
     """ Class for creation of devices based on a top-down specification
 
         DeviceFactory instances can be combined/stacked to create more complex
@@ -379,6 +382,7 @@ def container_raid_level(self, value):
     #
     # methods related to device size and disk space requirements
     #
+
     def _get_free_disk_space(self):
         free_info = self.storage.get_free_space(disks=self.disks)
         return sum(d[0] for d in free_info.values())
@@ -530,7 +534,6 @@ def _set_container(self):
         self.container = self.get_container(device=self.raw_device,
                                             name=self.container_name)
 
-
     def _create_container(self):
         """ Create the container device required by this factory device. """
         parents = self._get_parent_devices()
@@ -793,7 +796,7 @@ def _set_up_child_factory(self):
         log.debug("child factory class: %s", self.child_factory_class)
         log.debug("child factory args: %s", args)
         log.debug("child factory kwargs: %s", kwargs)
-        factory = self.child_factory_class(*args, **kwargs) # pylint: disable=not-callable
+        factory = self.child_factory_class(*args, **kwargs)  # pylint: disable=not-callable
         self.child_factory = factory
         factory.parent_factory = self
 
@@ -885,11 +888,14 @@ def _revert_devicetree(self):
         self.storage.devicetree.names = self.__names
         self.storage.roots = self.__roots
 
+
 class PartitionFactory(DeviceFactory):
+
     """ Factory class for creating a partition. """
     #
     # methods related to device size and disk space requirements
     #
+
     def _get_base_size(self):
         if self.device:
             min_format_size = self.device.format.min_size
@@ -959,8 +965,11 @@ def _post_create(self):
             log.error("failed to allocate partitions: %s", e)
             raise
 
+
 class PartitionSetFactory(PartitionFactory):
+
     """ Factory for creating a set of related partitions. """
+
     def __init__(self, storage, size, disks, fstype=None, encrypted=False,
                  devices=None):
         """ Create a new DeviceFactory instance.
@@ -1023,7 +1032,7 @@ def configure(self):
         log.debug("members: %s", [d.name for d in members])
 
         ##
-        ## Determine the target disk set.
+        # Determine the target disk set.
         ##
         # XXX how can we detect/handle failure to use one or more of the disks?
         if self.parent_factory.device:
@@ -1047,7 +1056,7 @@ def configure(self):
         log.debug("remove_disks: %s", [d.name for d in remove_disks])
 
         ##
-        ## Make a list of members we'll later remove from dropped disks.
+        # Make a list of members we'll later remove from dropped disks.
         ##
         removed = []
         for member in members[:]:
@@ -1056,7 +1065,7 @@ def configure(self):
                 members.remove(member)
 
         ##
-        ## Handle toggling of member encryption.
+        # Handle toggling of member encryption.
         ##
         for member in members[:]:
             member_encrypted = isinstance(member, LUKSDevice)
@@ -1086,7 +1095,7 @@ def configure(self):
                 continue
 
         ##
-        ## Prepare previously allocated member partitions for reallocation.
+        # Prepare previously allocated member partitions for reallocation.
         ##
         base_size = self._get_base_size()
         for member in members[:]:
@@ -1098,7 +1107,7 @@ def configure(self):
             member.req_grow = True
 
         ##
-        ## Define members on added disks.
+        # Define members on added disks.
         ##
         new_members = []
         for disk in add_disks:
@@ -1128,7 +1137,7 @@ def configure(self):
                 container.parents.append(member)
 
         ##
-        ## Remove members from dropped disks.
+        # Remove members from dropped disks.
         ##
         # Do this last to prevent tripping raid level constraints on the number
         # of members.
@@ -1143,12 +1152,12 @@ def configure(self):
             self.storage.destroy_device(member)
 
         ##
-        ## Determine target container size.
+        # Determine target container size.
         ##
         total_space = self.parent_factory._get_total_space()
 
         ##
-        ## Set up SizeSet to manage growth of member partitions.
+        # Set up SizeSet to manage growth of member partitions.
         ##
         log.debug("adding a %s with size %s",
                   self.parent_factory.size_set_class.__name__, total_space)
@@ -1159,11 +1168,13 @@ def configure(self):
             member.req_max_size = size_set.size
 
         ##
-        ## Allocate the member partitions.
+        # Allocate the member partitions.
         ##
         self._post_create()
 
+
 class LVMFactory(DeviceFactory):
+
     """ Factory for creating LVM logical volumes with partition PVs. """
     child_factory_class = PartitionSetFactory
     child_factory_fstype = "lvmpv"
@@ -1325,7 +1336,7 @@ def _set_name(self):
                 return
 
             # strip off the vg name before setting
-            safe_new_name = safe_new_name[len(self.container.name)+1:]
+            safe_new_name = safe_new_name[len(self.container.name) + 1:]
             log.debug("renaming device '%s' to '%s'",
                         self.device.name, safe_new_name)
             self.device.name = safe_new_name
@@ -1355,7 +1366,9 @@ def _configure(self):
 
         super(LVMFactory, self)._configure()
 
+
 class LVMThinPFactory(LVMFactory):
+
     """ Factory for creating LVM using thin provisioning.
 
         This class will be very similar to LVMFactory except that there are two
@@ -1396,6 +1409,7 @@ class will only support auto-sized pools.
             - the pool will need to be adjusted on device removal, which means
               pool management must not be hidden in device management routines
     """
+
     def __init__(self, *args, **kwargs):
         # pool name is for identification -- not renaming
         self.pool_name = kwargs.pop("pool_name", None)
@@ -1515,9 +1529,9 @@ def _get_pool_size(self):
 
         log.debug("requested size is %s", self.size)
         size = self.size    # projected size for the pool (not padded)
-        free = Size(0)# total space within the vg that is available to us
+        free = Size(0)  # total space within the vg that is available to us
         if self.pool:
-            free += self.pool.free_space # pools are always auto-sized
+            free += self.pool.free_space  # pools are always auto-sized
             # pool lv sizes go toward projected pool size and vg free space
             size += self.pool.used_space
             free += self.pool.used_space
@@ -1540,7 +1554,7 @@ def _get_pool_size(self):
         log.debug("size is %s ; pad is %s ; free is %s", size, pad, free)
         if free < (size + pad):
             pad = Size(blockdev.lvm.get_thpool_padding(free, self._pesize, included=True))
-            free = self.container.align(free - pad) # round down
+            free = self.container.align(free - pad)  # round down
             log.info("adjusting pool size from %s to %s so it fits "
                      "in container %s", size, free, self.container.name)
             size = free
@@ -1603,7 +1617,9 @@ def _get_new_device(self, *args, **kwargs):
         kwargs["thin_volume"] = True
         return super(LVMThinPFactory, self)._get_new_device(*args, **kwargs)
 
+
 class MDFactory(DeviceFactory):
+
     """ Factory for creating MD RAID devices. """
     child_factory_class = PartitionSetFactory
     child_factory_fstype = "mdmember"
@@ -1646,7 +1662,9 @@ def get_container(self, device=None, name=None, allow_existing=False):
     def _create_container(self, *args, **kwargs):
         pass
 
+
 class BTRFSFactory(DeviceFactory):
+
     """ BTRFS subvolume """
     child_factory_class = PartitionSetFactory
     child_factory_fstype = "btrfs"
diff --git a/blivet/devicelibs/crypto.py b/blivet/devicelibs/crypto.py
index 474c905..7d3bc15 100644
--- a/blivet/devicelibs/crypto.py
+++ b/blivet/devicelibs/crypto.py
@@ -24,6 +24,6 @@
 from ..tasks import availability
 
 LUKS_METADATA_SIZE = Size("2 MiB")
-MIN_CREATE_ENTROPY = 256 # bits
+MIN_CREATE_ENTROPY = 256  # bits
 
 EXTERNAL_DEPENDENCIES = [availability.BLOCKDEV_CRYPTO_PLUGIN]
diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index 2adb1ba..2de52ed 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -60,10 +60,13 @@
 
 fsroot = ""
 
+
 class EddEntry(object):
+
     """ This object merely collects what the /sys/firmware/edd/* entries can
         provide.
     """
+
     def __init__(self, sysfspath):
         # some misc data from various files...
         self._sysfspath = sysfspath
@@ -213,7 +216,7 @@ def _fmt(self, line_pad, separator):
             s += "%(nl)s%(t)susb_serial: %(usb_serial)s"
         if self.ieee1394_eui64 != None:
             s += "%(nl)s%(t)s1394_eui: %(ieee1394_eui64)s"
-        if any([self.fibre_wwid,self.fibre_lun]):
+        if any([self.fibre_wwid, self.fibre_lun]):
             s += "%(nl)s%(t)sfibre wwid: %(fibre_wwid)s lun: %s(fibre_lun)s"
         if self.i2o_identity != None:
             s += "%(nl)s%(t)si2o_identity: %(i2o_identity)s"
@@ -222,8 +225,8 @@ def _fmt(self, line_pad, separator):
 
         d = copy.copy(self.__dict__)
         d['_sysfspath'] = self._sysfspath
-        d['t']=line_pad
-        d['nl']=separator
+        d['t'] = line_pad
+        d['nl'] = separator
 
         return s % d
 
@@ -312,11 +315,14 @@ def load(self):
                 log.warning("edd: can not match host_bus for %s: %s",
                             self._sysfspath, hbus)
 
+
 class EddMatcher(object):
+
     """ This object tries to match given entry to a disk device name.
 
         Assuming, heuristic analysis and guessing hapens here.
     """
+
     def __init__(self, edd_entry):
         self.edd = edd_entry
 
@@ -371,11 +377,11 @@ def devname_from_ata_pci_dev(self):
                 # On SATA, "port_no" is the kernel's ata_port->print_id, which
                 # is awesomely ata_port->id + 1, where ata_port->id is edd's
                 # ata_device
-                if port_no != self.edd.ata_device+1:
+                if port_no != self.edd.ata_device + 1:
                     continue
 
-            fn = components[0:6] + ['link%d' % (ata_port_idx,),]
-            exp = [r'^']+fn+[r'dev%d\.(\d+)(\.(\d+)){0,1}$' % (ata_port_idx,)]
+            fn = components[0:6] + ['link%d' % (ata_port_idx,), ]
+            exp = [r'^'] + fn + [r'dev%d\.(\d+)(\.(\d+)){0,1}$' % (ata_port_idx,)]
             exp = os.path.join(*exp)
             expmatcher = re.compile(exp)
             pmp_glob = fn + ['dev%d.*.*' % (ata_port_idx,)]
@@ -415,11 +421,11 @@ def devname_from_scsi_pci_dev(self):
         tmpl1 = "%(fsroot)s/sys/devices/pci0000:00/0000:%(pci_dev)s/virtio*/" \
                 "host*/target*:0:%(dev)d/*:0:%(dev)d:%(lun)d/block"
         args = {
-            'fsroot' : fsroot,
-            'pci_dev' : self.edd.pci_dev,
-            'chan' : self.edd.channel,
-            'dev' : self.edd.scsi_id,
-            'lun' : self.edd.scsi_lun,
+            'fsroot': fsroot,
+            'pci_dev': self.edd.pci_dev,
+            'chan': self.edd.channel,
+            'dev': self.edd.scsi_id,
+            'lun': self.edd.scsi_lun,
             }
         path = tmpl0 % args
         pattern = tmpl1 % args
@@ -432,7 +438,7 @@ def devname_from_scsi_pci_dev(self):
                                 block_entries[0])
                 name = block_entries[0]
         elif len(matching_paths) > 1:
-            log.error("edd: Too many devices match for pci dev %s channel %s "\
+            log.error("edd: Too many devices match for pci dev %s channel %s "
                       "scsi id %s lun %s: ", self.edd.pci_dev, self.edd.channel,
                       self.edd.scsi_id, self.edd.scsi_lun)
             for matching_path in matching_paths:
@@ -445,15 +451,15 @@ def devname_from_scsi_pci_dev(self):
                                 block_entries[0])
                 name = block_entries[0]
         else:
-            log.warning("edd: Could not find SCSI device for pci dev %s "\
+            log.warning("edd: Could not find SCSI device for pci dev %s "
                         "channel %s scsi id %s lun %s", self.edd.pci_dev,
                         self.edd.channel, self.edd.scsi_id, self.edd.scsi_lun)
         return name
 
     def devname_from_virt_pci_dev(self):
         args = {
-            'fsroot' : fsroot,
-            'pci_dev' : self.edd.pci_dev
+            'fsroot': fsroot,
+            'pci_dev': self.edd.pci_dev
             }
         pattern = "%(fsroot)s/sys/devices/pci0000:00/0000:%(pci_dev)s/virtio*"
         matching_paths = glob.glob(pattern % args)
@@ -504,6 +510,7 @@ def match_via_mbrsigs(self, mbr_dict):
                 return name
         return None
 
+
 def collect_edd_data():
     edd_data_dict = {}
     exp = re.compile(r'.*/int13_dev(\d+)$')
@@ -515,6 +522,7 @@ def collect_edd_data():
         edd_data_dict[biosdev] = EddEntry(path[len(fsroot):])
     return edd_data_dict
 
+
 def collect_mbrs(devices):
     """ Read MBR signatures from devices.
 
@@ -555,6 +563,7 @@ def collect_mbrs(devices):
     log.info("edd: collected mbr signatures: %s", mbr_dict)
     return mbr_dict
 
+
 def get_edd_dict(devices):
     """ Generates the 'device name' -> 'edd number' mapping.
 
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index b591e8d..539d554 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -64,8 +64,9 @@
 # Theoretically we can handle all that can be handled with the LVM --config
 # argument.  For every time we call an lvm_cc (lvm compose config) funciton
 # we regenerate the config_args with all global info.
-config_args_data = { "filterRejects": [],    # regular expressions to reject.
-                     "filterAccepts": [] }   # regexp to accept
+config_args_data = {"filterRejects": [],    # regular expressions to reject.
+                     "filterAccepts": []}   # regexp to accept
+
 
 def _set_global_config():
     """lvm command accepts lvm.conf type arguments preceded by --config. """
@@ -87,7 +88,7 @@ def _set_global_config():
     # devices_string can have (inside the brackets) "dir", "scan",
     # "preferred_names", "filter", "cache_dir", "write_cache_state",
     # "types", "sysfs_scan", "md_component_detection".  see man lvm.conf.
-    config_string = " devices { %s } " % (devices_string) # strings can be added
+    config_string = " devices { %s } " % (devices_string)  # strings can be added
     if not flags.lvm_metadata_backup:
         config_string += "backup {backup=0 archive=0} "
     if flags.debug:
@@ -95,6 +96,7 @@ def _set_global_config():
 
     blockdev.lvm.set_global_config(config_string)
 
+
 def needs_config_refresh(fn):
     if not availability.BLOCKDEV_LVM_PLUGIN.available:
         return lambda *args, **kwargs: None
@@ -106,12 +108,14 @@ def fn_with_refresh(*args, **kwargs):
 
     return fn_with_refresh
 
+
 @needs_config_refresh
 def lvm_cc_addFilterRejectRegexp(regexp):
     """ Add a regular expression to the --config string."""
     log.debug("lvm filter: adding %s to the reject list", regexp)
     config_args_data["filterRejects"].append(regexp)
 
+
 @needs_config_refresh
 def lvm_cc_removeFilterRejectRegexp(regexp):
     """ Remove a regular expression from the --config string."""
@@ -122,11 +126,13 @@ def lvm_cc_removeFilterRejectRegexp(regexp):
         log.debug("%s wasn't in the reject list", regexp)
         return
 
+
 @needs_config_refresh
 def lvm_cc_resetFilter():
     config_args_data["filterRejects"] = []
     config_args_data["filterAccepts"] = []
 
+
 def determine_parent_lv(vg_name, internal_lv, lvs):
     """Try to determine which of the lvs is the parent of the internal_lv
 
@@ -143,7 +149,7 @@ def determine_parent_lv(vg_name, internal_lv, lvs):
 
         # check if the lv's name is the name of the internal LV without the suffix
         # e.g. 'pool' and 'pool_tmeta'
-        if re.match(lv.lvname+internal_lv.name_suffix+"$", internal_lv.lvname):
+        if re.match(lv.lvname + internal_lv.name_suffix + "$", internal_lv.lvname):
             return lv
 
     # now try checking relations between LVs
@@ -178,5 +184,6 @@ def determine_parent_lv(vg_name, internal_lv, lvs):
 
     return None
 
+
 def lvmetad_socket_exists():
     return os.path.exists(LVMETAD_SOCKET_PATH)
diff --git a/blivet/devicelibs/mdraid.py b/blivet/devicelibs/mdraid.py
index 7692d91..7ace310 100644
--- a/blivet/devicelibs/mdraid.py
+++ b/blivet/devicelibs/mdraid.py
@@ -31,7 +31,9 @@
 MD_SUPERBLOCK_SIZE = Size("2 MiB")
 MD_CHUNK_SIZE = Size("512 KiB")
 
+
 class MDRaidLevels(raid.RAIDLevels):
+
     @classmethod
     def is_raid_level(cls, level):
         return super(MDRaidLevels, cls).is_raid_level(level) and \
diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py
index 093181a..046a443 100644
--- a/blivet/devicelibs/raid.py
+++ b/blivet/devicelibs/raid.py
@@ -28,16 +28,19 @@
 from ..errors import RaidError
 from ..size import Size
 
-def div_up(a,b):
+
+def div_up(a, b):
     """Rounds up integer division.  For example, div_up(3, 2) is 2.
 
        :param int a: the dividend
        :param int b: the divisor
     """
-    return (a + (b - 1))//b
+    return (a + (b - 1)) // b
+
 
 @add_metaclass(abc.ABCMeta)
 class RAIDLevel(object):
+
     """An abstract class which is the parent of all classes which represent
        a RAID level.
 
@@ -47,8 +50,8 @@ class RAIDLevel(object):
 
     name = abc.abstractproperty(doc="The canonical name for this level")
     names = abc.abstractproperty(doc="List of recognized names for this level.")
-    min_members = abc.abstractproperty(doc=
-       "The minimum number of members required to make a fully functioning array.")
+    min_members = abc.abstractproperty(doc="The minimum number of members required to make a fully functioning array.")
+
     @abc.abstractmethod
     def has_redundancy(self):
         """ Whether this RAID level incorporates inherent redundancy.
@@ -61,8 +64,7 @@ def has_redundancy(self):
         """
         raise NotImplementedError()
 
-    is_uniform = abc.abstractproperty(doc=
-       "Whether data is uniformly distributed across all devices.")
+    is_uniform = abc.abstractproperty(doc="Whether data is uniformly distributed across all devices.")
 
     def __str__(self):
         return self.name
@@ -102,7 +104,6 @@ class RAIDn(RAIDLevel):
         singleton object of the class.
     """
 
-
     # ABSTRACT PROPERTIES
     level = abc.abstractproperty(doc="A code representing the level")
     nick = abc.abstractproperty(doc="A nickname for this level")
@@ -110,16 +111,16 @@ class RAIDn(RAIDLevel):
     # PROPERTIES
     is_uniform = property(lambda s: True)
 
-    number = property(lambda s : int(s.level),
+    number = property(lambda s: int(s.level),
        doc="A numeric code for this level")
 
-    name = property(lambda s : "raid" + s.level,
+    name = property(lambda s: "raid" + s.level,
        doc="The canonical name for this level")
 
-    alt_synth_names = property(lambda s : ["RAID" + s.level, s.level, s.number],
+    alt_synth_names = property(lambda s: ["RAID" + s.level, s.level, s.number],
        doc="names that can be synthesized from level but are not name")
 
-    names = property(lambda s :
+    names = property(lambda s:
        [n for n in [s.name] + [s.nick] + s.alt_synth_names if n is not None],
        doc="all valid names for this level")
 
@@ -311,8 +312,8 @@ def get_space(self, size, num_members, chunk_size=None, superblock_size_func=Non
         return size_per_member * num_members
 
 
-
 class RAIDLevels(object):
+
     """A class which keeps track of registered RAID levels. This class
        may be extended, overriding the is_raid method to include any
        additional properties that a client of this package may require
@@ -393,6 +394,7 @@ def __iter__(self):
 
 ALL_LEVELS = RAIDLevels()
 
+
 class RAID0(RAIDn):
 
     level = property(lambda s: "0")
@@ -423,6 +425,7 @@ def _get_recommended_stride(self, member_count):
 RAID0 = RAID0()
 ALL_LEVELS.add_raid_level(RAID0)
 
+
 class RAID1(RAIDn):
     level = property(lambda s: "1")
     min_members = property(lambda s: 2)
@@ -452,6 +455,7 @@ def _get_recommended_stride(self, member_count):
 RAID1 = RAID1()
 ALL_LEVELS.add_raid_level(RAID1)
 
+
 class RAID4(RAIDn):
     level = property(lambda s: "4")
     min_members = property(lambda s: 3)
@@ -481,6 +485,7 @@ def _get_recommended_stride(self, member_count):
 RAID4 = RAID4()
 ALL_LEVELS.add_raid_level(RAID4)
 
+
 class RAID5(RAIDn):
     level = property(lambda s: "5")
     min_members = property(lambda s: 3)
@@ -510,6 +515,7 @@ def _get_recommended_stride(self, member_count):
 RAID5 = RAID5()
 ALL_LEVELS.add_raid_level(RAID5)
 
+
 class RAID6(RAIDn):
     level = property(lambda s: "6")
     min_members = property(lambda s: 4)
@@ -539,6 +545,7 @@ def _get_recommended_stride(self, member_count):
 RAID6 = RAID6()
 ALL_LEVELS.add_raid_level(RAID6)
 
+
 class RAID10(RAIDn):
     level = property(lambda s: "10")
     min_members = property(lambda s: 4)
@@ -568,6 +575,7 @@ def _get_recommended_stride(self, member_count):
 RAID10 = RAID10()
 ALL_LEVELS.add_raid_level(RAID10)
 
+
 class Container(RAIDLevel):
     name = "container"
     names = [name]
@@ -580,12 +588,15 @@ def has_redundancy(self):
     def get_max_spares(self, member_count):
         # pylint: disable=unused-argument
         raise RaidError("get_max_spares is not defined for level container")
+
     def get_space(self, size, num_members, chunk_size=None, superblock_size_func=None):
         # pylint: disable=unused-argument
         return size
+
     def get_recommended_stride(self, member_count):
         # pylint: disable=unused-argument
         raise RaidError("get_recommended_stride is not defined for level container")
+
     def get_size(self, member_sizes, num_members=None, chunk_size=None, superblock_size_func=None):
         # pylint: disable=unused-argument
         return sum(member_sizes, Size(0))
@@ -593,7 +604,9 @@ def get_size(self, member_sizes, num_members=None, chunk_size=None, superblock_s
 Container = Container()
 ALL_LEVELS.add_raid_level(Container)
 
+
 class ErsatzRAID(RAIDLevel):
+
     """ A superclass for a raid level which is not really a raid level at
         all, just a bunch of block devices of possibly differing sizes
         thrown together. This concept has different names depending on where
@@ -632,7 +645,9 @@ def get_size(self, member_sizes, num_members=None, chunk_size=None, superblock_s
         superblock_size = superblock_size_func(total_space)
         return total_space - len(member_sizes) * superblock_size
 
+
 class Linear(ErsatzRAID):
+
     """ subclass with canonical lvm name """
     name = 'linear'
     names = [name]
@@ -640,7 +655,9 @@ class Linear(ErsatzRAID):
 Linear = Linear()
 ALL_LEVELS.add_raid_level(Linear)
 
+
 class Single(ErsatzRAID):
+
     """ subclass with canonical btrfs name. """
     name = 'single'
     names = [name]
@@ -648,7 +665,9 @@ class Single(ErsatzRAID):
 Single = Single()
 ALL_LEVELS.add_raid_level(Single)
 
+
 class Dup(RAIDLevel):
+
     """ A RAID level which expresses one way btrfs metadata may be distributed.
 
         For this RAID level, duplication occurs within a single block device.
@@ -664,6 +683,7 @@ def has_redundancy(self):
 Dup = Dup()
 ALL_LEVELS.add_raid_level(Dup)
 
+
 def get_raid_level(descriptor):
     """ Convenience function to return a RAID level for the descriptor.
 
diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index 957703b..ba0b716 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -50,7 +50,9 @@
 
 from contextlib import contextmanager
 
+
 class BTRFSDevice(StorageDevice):
+
     """ Base class for BTRFS volume and sub-volume devices. """
     _type = "btrfs"
     _packages = ["btrfs-progs"]
@@ -154,6 +156,7 @@ def is_name_valid(cls, name):
         # Override StorageDevice.is_name_valid to allow pretty much anything
         return not('\x00' in name)
 
+
 class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice, RaidDevice):
     _type = "btrfs volume"
     vol_id = btrfs.MAIN_VOLUME_ID
@@ -462,7 +465,9 @@ def populate_ksdata(self, data):
         data.devices = ["btrfs.%d" % p.id for p in self.parents]
         data.preexist = self.exists
 
+
 class BTRFSSubVolumeDevice(BTRFSDevice):
+
     """ A btrfs subvolume pseudo-device. """
     _type = "btrfs subvolume"
     _format_immutable = True
@@ -581,7 +586,9 @@ def populate_ksdata(self, data):
         if label:
             data.devices = ["LABEL=%s" % label]
 
+
 class BTRFSSnapShotDevice(BTRFSSubVolumeDevice):
+
     """ A btrfs snapshot pseudo-device.
 
         BTRFS snapshots are a specialized type of subvolume that contains a
diff --git a/blivet/devices/cache.py b/blivet/devices/cache.py
index 94b81dd..41c74fe 100644
--- a/blivet/devices/cache.py
+++ b/blivet/devices/cache.py
@@ -27,8 +27,10 @@
 from six import add_metaclass
 import abc
 
+
 @add_metaclass(abc.ABCMeta)
 class Cache(object):
+
     """Abstract base class for cache objects providing the cache-related
     functionality on cached devices. Instances of this class are not expected to
     be devices (both in what they represent as well as not instances of the
@@ -84,6 +86,7 @@ def detach(self):
 
 @add_metaclass(abc.ABCMeta)
 class CacheStats(object):
+
     """Abstract base class for common statistics of caches (cached
     devices). Inheriting classes are expected to add (cache-)type-specific
     attributes on top of the common set.
@@ -115,8 +118,10 @@ def misses(self):
         """number of misses"""
         pass
 
+
 @add_metaclass(abc.ABCMeta)
 class CacheRequest(object):
+
     """Abstract base class for cache requests specifying cache parameters for a
     cached device
 
diff --git a/blivet/devices/container.py b/blivet/devices/container.py
index fdfba8e..3897b51 100644
--- a/blivet/devices/container.py
+++ b/blivet/devices/container.py
@@ -32,8 +32,10 @@
 
 from .storage import StorageDevice
 
+
 @add_metaclass(abc.ABCMeta)
 class ContainerDevice(StorageDevice):
+
     """ A device that aggregates a set of member devices.
 
         The only interfaces provided by this class are for addition and removal
diff --git a/blivet/devices/device.py b/blivet/devices/device.py
index e5e3f95..7254359 100644
--- a/blivet/devices/device.py
+++ b/blivet/devices/device.py
@@ -30,7 +30,9 @@
 
 from .lib import ParentList
 
+
 class Device(util.ObjectID):
+
     """ A generic device.
 
         Device instances know which devices they depend upon (parents
@@ -160,7 +162,7 @@ def _get_parent_list(self):
 
     @property
     def dict(self):
-        d =  {"type": self.type, "name": self.name,
+        d = {"type": self.type, "name": self.name,
               "parents": [p.name for p in self.parents]}
         return d
 
@@ -289,7 +291,7 @@ def packages(self):
         return packages
 
     @classmethod
-    def is_name_valid(cls, name): # pylint: disable=unused-argument
+    def is_name_valid(cls, name):  # pylint: disable=unused-argument
         """Is the device name valid for the device type?"""
 
         # By default anything goes
diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py
index f4c8a45..ef2c973 100644
--- a/blivet/devices/disk.py
+++ b/blivet/devices/disk.py
@@ -34,7 +34,7 @@
 from .. import udev
 from ..size import Size
 from ..tasks import availability
-from ..util import open # pylint: disable=redefined-builtin
+from ..util import open  # pylint: disable=redefined-builtin
 
 from ..fcoe import fcoe
 
@@ -46,7 +46,9 @@
 from .network import NetworkStorageDevice
 from .dm import DMDevice
 
+
 class DiskDevice(StorageDevice):
+
     """ A local/generic disk.
 
         This is not the only kind of device that is treated as a disk. More
@@ -121,7 +123,9 @@ def _pre_destroy(self):
 
         StorageDevice._pre_destroy(self)
 
+
 class DiskFile(DiskDevice):
+
     """ This is a file that we will pretend is a disk.
 
         This is intended only for testing purposes. The benefit of this class
@@ -169,7 +173,9 @@ def read_current_size(self):
 
         return size
 
+
 class DMRaidArrayDevice(DMDevice, ContainerDevice):
+
     """ A dmraid (device-mapper RAID) device """
     _type = "dm-raid array"
     _packages = ["dmraid"]
@@ -200,7 +206,6 @@ def __init__(self, name, fmt=None,
                                                 parents=parents, exists=True,
                                                 sysfs_path=sysfs_path)
 
-
     @property
     def devices(self):
         """ Return a list of this array's member device instances. """
@@ -251,7 +256,9 @@ def model(self):
     def dracut_setup_args(self):
         return set(["rd.dm.uuid=%s" % self.name])
 
+
 class MultipathDevice(DMDevice):
+
     """ A multipath device """
     _type = "dm-multipath"
     _packages = ["device-mapper-multipath"]
@@ -285,10 +292,10 @@ def __init__(self, name, fmt=None, size=None, serial=None,
 
         self.identity = serial
         self.config = {
-            'wwid' : self.identity,
-            'mode' : '0600',
-            'uid' : '0',
-            'gid' : '0',
+            'wwid': self.identity,
+            'mode': '0600',
+            'uid': '0',
+            'gid': '0',
         }
 
     @property
@@ -342,9 +349,8 @@ def _post_setup(self):
         udev.settle()
 
 
-
-
 class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
+
     """ An iSCSI disk. """
     _type = "iscsi"
     _packages = ["iscsi-initiator-utils", "dracut-network"]
@@ -412,7 +418,7 @@ def dracut_setup_args(self):
         if ":" in address:
             address = "[%s]" % address
 
-        netroot="netroot=iscsi:"
+        netroot = "netroot=iscsi:"
         auth = self.node.get_auth()
         if auth:
             netroot += "%s:%s" % (auth.username, auth.password)
@@ -432,7 +438,9 @@ def dracut_setup_args(self):
 
         return set([netroot, initiator])
 
+
 class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
+
     """ An FCoE disk. """
     _type = "fcoe"
     _packages = ["fcoe-utils", "dracut-network"]
@@ -480,6 +488,7 @@ def dracut_setup_args(self):
 
 
 class ZFCPDiskDevice(DiskDevice):
+
     """ A mainframe ZFCP disk. """
     _type = "zfcp"
 
@@ -522,7 +531,9 @@ def description(self):
     def dracut_setup_args(self):
         return set(["rd.zfcp=%s,%s,%s" % (self.hba_id, self.wwpn, self.fcp_lun,)])
 
+
 class DASDDevice(DiskDevice):
+
     """ A mainframe DASD. """
     _type = "dasd"
 
diff --git a/blivet/devices/dm.py b/blivet/devices/dm.py
index a1e9db1..a908ef2 100644
--- a/blivet/devices/dm.py
+++ b/blivet/devices/dm.py
@@ -39,7 +39,9 @@
 from .storage import StorageDevice
 from .lib import LINUX_SECTOR_SIZE
 
+
 class DMDevice(StorageDevice):
+
     """ A device-mapper device """
     _type = "dm"
     _dev_dir = "/dev/mapper"
@@ -113,7 +115,7 @@ def status(self):
             else:
                 raise
 
-    #def get_target_type(self):
+    # def get_target_type(self):
     #    return dm.get_dm_target(name=self.name)
 
     def get_dm_node(self):
@@ -223,6 +225,7 @@ def description(self):
 
 
 class DMCryptDevice(DMDevice):
+
     """ A dm-crypt device """
     _type = "dm-crypt"
     _encrypted = True
diff --git a/blivet/devices/file.py b/blivet/devices/file.py
index 804bb0e..dc53a7a 100644
--- a/blivet/devices/file.py
+++ b/blivet/devices/file.py
@@ -32,7 +32,9 @@
 
 from .storage import StorageDevice
 
+
 class FileDevice(StorageDevice):
+
     """ A file on a filesystem.
 
         This exists because of swap files.
@@ -104,7 +106,7 @@ def _pre_teardown(self, recursive=None):
     def _create(self):
         """ Create the device. """
         log_method_call(self, self.name, status=self.status)
-        fd = util.eintr_retry_call(os.open, self.path, os.O_WRONLY|os.O_CREAT|os.O_TRUNC)
+        fd = util.eintr_retry_call(os.open, self.path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
         # all this fuss is so we write the zeros 1MiB at a time
         zero = "\0"
         block_size = 1024 ** 2
@@ -131,16 +133,21 @@ def is_name_valid(cls, name):
         # Override StorageDevice.is_name_valid to allow /
         return not('\x00' in name or name == '.' or name == '..')
 
+
 class SparseFileDevice(FileDevice):
+
     """A sparse file on a filesystem.
     This exists for sparse disk images."""
     _type = "sparse file"
+
     def _create(self):
         """Create a sparse file."""
         log_method_call(self, self.name, status=self.status)
         util.create_sparse_file(self.path, self.size)
 
+
 class DirectoryDevice(FileDevice):
+
     """ A directory on a filesystem.
 
         This exists because of bind mounts.
diff --git a/blivet/devices/lib.py b/blivet/devices/lib.py
index 4d8cf69..71dda46 100644
--- a/blivet/devices/lib.py
+++ b/blivet/devices/lib.py
@@ -23,10 +23,11 @@
 from .. import errors
 from .. import udev
 from ..size import Size
-from ..util import open # pylint: disable=redefined-builtin
+from ..util import open  # pylint: disable=redefined-builtin
 
 LINUX_SECTOR_SIZE = Size(512)
 
+
 def get_device_majors():
     majors = {}
     for line in open("/proc/devices").readlines():
@@ -41,6 +42,7 @@ def get_device_majors():
     return majors
 device_majors = get_device_majors()
 
+
 def device_path_to_name(device_path):
     """ Return a name based on the given path to a device node.
 
@@ -68,6 +70,7 @@ def device_path_to_name(device_path):
 
     return name
 
+
 def device_name_to_disk_by_path(device_name=None):
     """ Return a /dev/disk/by-path/ symlink path for the given device name.
 
@@ -89,7 +92,9 @@ def device_name_to_disk_by_path(device_name=None):
         return ret
     raise errors.DeviceNotFoundError(device_name)
 
+
 class ParentList(object):
+
     """ A list with auditing and side-effects for additions and removals.
 
         The class provides an ordered list with guaranteed unique members and
@@ -108,6 +113,7 @@ class ParentList(object):
             x in ml
             x = ml[i]   # not ml[i] = x
     """
+
     def __init__(self, items=None, appendfunc=None, removefunc=None):
         """
             :keyword items: initial contents
diff --git a/blivet/devices/loop.py b/blivet/devices/loop.py
index 95d07d6..fcef161 100644
--- a/blivet/devices/loop.py
+++ b/blivet/devices/loop.py
@@ -35,7 +35,9 @@
 
 from .storage import StorageDevice
 
+
 class LoopDevice(StorageDevice):
+
     """ A loop device. """
     _type = "loop"
     _external_dependencies = [availability.BLOCKDEV_LOOP_PLUGIN]
diff --git a/blivet/devices/luks.py b/blivet/devices/luks.py
index b91e8df..1fee1b8 100644
--- a/blivet/devices/luks.py
+++ b/blivet/devices/luks.py
@@ -28,7 +28,9 @@
 from .storage import StorageDevice
 from .dm import DMCryptDevice
 
+
 class LUKSDevice(DMCryptDevice):
+
     """ A mapped LUKS device. """
     _type = "luks/dm-crypt"
     _packages = ["cryptsetup"]
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 3c21107..416f942 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -56,6 +56,7 @@
 
 _INTERNAL_LV_CLASSES = []
 
+
 def get_internal_lv_class(lv_attr):
     if lv_attr[0] == "C":
         # cache pools and internal data LV of cache pools need a more complicated check
@@ -70,7 +71,9 @@ def get_internal_lv_class(lv_attr):
 
     return None
 
+
 class LVMVolumeGroupDevice(ContainerDevice):
+
     """ An LVM Volume Group """
     _type = "lvmvg"
     _packages = ["lvm2"]
@@ -179,7 +182,7 @@ def dict(self):
     def map_name(self):
         """ This device's device-mapper map name """
         # Thank you lvm for this lovely hack.
-        return self.name.replace("-","--")
+        return self.name.replace("-", "--")
 
     @property
     def path(self):
@@ -490,7 +493,9 @@ def is_name_valid(cls, name):
 
         return True
 
+
 class LVMLogicalVolumeDevice(DMDevice):
+
     """ An LVM Logical Volume """
     _type = "lvmlv"
     _resizable = True
@@ -617,7 +622,7 @@ def __repr__(self):
               "  VG space used = %(vgspace)s" %
               {"vgdev": self.vg, "percent": self.req_percent,
                "copies": self.copies, "type": self.seg_type,
-               "vgspace": self.vg_space_used })
+               "vgspace": self.vg_space_used})
         return s
 
     @property
@@ -689,7 +694,7 @@ def container(self):
     def map_name(self):
         """ This device's device-mapper map name """
         # Thank you lvm for this lovely hack.
-        return "%s-%s" % (self.vg.map_name, self._name.replace("-","--"))
+        return "%s-%s" % (self.vg.map_name, self._name.replace("-", "--"))
 
     @property
     def path(self):
@@ -739,7 +744,7 @@ def _pre_setup(self, orig=False):
             # have to do it ourselves.
             # The timeout value of 30 seconds was suggested by prajnoha. He
             # noted that udev uses the same value, for whatever that's worth.
-            timeout = 30 # seconds
+            timeout = 30  # seconds
             start = time.time()
             while time.time() - start < timeout:
                 if self.status:
@@ -829,7 +834,7 @@ def _create(self):
             # of the fast PVs may be required for allocation of the LV (it may
             # span over the slow PVs and parts of fast PVs)
             blockdev.lvm.cache_create_cached_lv(self.vg.name, self._name, self.size, self.cache.size, self.cache.md_size,
-                                                mode, 0, slow_pvs+fast_pvs, fast_pvs)
+                                                mode, 0, slow_pvs + fast_pvs, fast_pvs)
 
     def _pre_destroy(self):
         StorageDevice._pre_destroy(self)
@@ -989,6 +994,7 @@ def attach_cache(self, cache_pool_lv):
 
 @add_metaclass(abc.ABCMeta)
 class LVMInternalLogicalVolumeDevice(LVMLogicalVolumeDevice):
+
     """Abstract base class for internal LVs
 
     A common class for all classes representing internal Logical Volumes like
@@ -1109,7 +1115,7 @@ def __repr__(self):
               "  VG space used = %(vgspace)s" %
               {"vgdev": self.vg, "percent": self.req_percent,
                "copies": self.copies, "type": self.seg_type,
-               "vgspace": self.vg_space_used })
+               "vgspace": self.vg_space_used})
         return s
 
     # generally changes should be done on the parent LV (exceptions should
@@ -1159,7 +1165,9 @@ def direct(self):
         # internal LVs are not directly accessible
         return False
 
+
 class LVMDataLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal data LV (used by thin/cache pools)"""
 
     attr_letters = ["T", "C"]
@@ -1167,7 +1175,9 @@ class LVMDataLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
     takes_extra_space = False
 _INTERNAL_LV_CLASSES.append(LVMDataLogicalVolumeDevice)
 
+
 class LVMMetadataLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal metadata LV (used by thin/cache pools, RAIDs, etc.)"""
 
     # thin pool metadata LVs can be resized directly
@@ -1200,7 +1210,9 @@ def resize(self):
 
 _INTERNAL_LV_CLASSES.append(LVMMetadataLogicalVolumeDevice)
 
+
 class LVMLogLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal log LV (used by mirrored LVs)"""
 
     attr_letters = ["l", "L"]
@@ -1208,7 +1220,9 @@ class LVMLogLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
     takes_extra_space = True
 _INTERNAL_LV_CLASSES.append(LVMLogLogicalVolumeDevice)
 
+
 class LVMImageLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal image LV (used by mirror/RAID LVs)"""
 
     attr_letters = ["i"]
@@ -1217,7 +1231,9 @@ class LVMImageLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
     takes_extra_space = False
 _INTERNAL_LV_CLASSES.append(LVMImageLogicalVolumeDevice)
 
+
 class LVMOriginLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal origin LV (e.g. the raw/uncached part of a cached LV)"""
 
     attr_letters = ["o"]
@@ -1225,7 +1241,9 @@ class LVMOriginLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
     takes_extra_space = False
 _INTERNAL_LV_CLASSES.append(LVMOriginLogicalVolumeDevice)
 
+
 class LVMCachePoolLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
+
     """Internal cache pool logical volume"""
 
     attr_letters = ["C"]
@@ -1233,8 +1251,10 @@ class LVMCachePoolLogicalVolumeDevice(LVMInternalLogicalVolumeDevice):
     takes_extra_space = True
 _INTERNAL_LV_CLASSES.append(LVMCachePoolLogicalVolumeDevice)
 
+
 @add_metaclass(abc.ABCMeta)
 class LVMSnapShotBase(object):
+
     """ Abstract base class for lvm snapshots
 
         This class is intended to be used with multiple inheritance in addition
@@ -1305,7 +1325,7 @@ def _update_format_from_origin(self):
         if hasattr(fmt, "mountpoint"):
             fmt.mountpoint = ""
             fmt._chrooted_mountpoint = None
-            fmt.device = self.path # pylint: disable=no-member
+            fmt.device = self.path  # pylint: disable=no-member
 
         super(LVMSnapShotBase, self)._set_format(fmt)
 
@@ -1313,10 +1333,10 @@ def _set_format(self, fmt):
         # If a snapshot exists it can have a format that is distinct from its
         # origin's. If it does not exist its format must be a copy of its
         # origin's.
-        if self.exists: # pylint: disable=no-member
+        if self.exists:  # pylint: disable=no-member
             super(LVMSnapShotBase, self)._set_format(fmt)
         else:
-            log.info("copying %s origin's format", self.name) # pylint: disable=no-member
+            log.info("copying %s origin's format", self.name)  # pylint: disable=no-member
             self._update_format_from_origin()
 
     @abc.abstractmethod
@@ -1326,7 +1346,7 @@ def _create(self):
 
     def merge(self):
         """ Merge the snapshot back into its origin volume. """
-        log_method_call(self, self.name, status=self.status) # pylint: disable=no-member
+        log_method_call(self, self.name, status=self.status)  # pylint: disable=no-member
         self.vg.setup()    # pylint: disable=no-member
         try:
             self.origin.teardown()
@@ -1336,15 +1356,16 @@ def merge(self):
             pass
 
         try:
-            self.teardown() # pylint: disable=no-member
+            self.teardown()  # pylint: disable=no-member
         except errors.FSError:
             pass
 
         udev.settle()
-        blockdev.lvm.lvsnapshotmerge(self.vg.name, self.lvname) # pylint: disable=no-member
+        blockdev.lvm.lvsnapshotmerge(self.vg.name, self.lvname)  # pylint: disable=no-member
 
 
 class LVMSnapShotDevice(LVMSnapShotBase, LVMLogicalVolumeDevice):
+
     """ An LVM snapshot """
     _type = "lvmsnapshot"
     _format_immutable = True
@@ -1434,7 +1455,9 @@ def read_current_size(self):
 
         return size
 
+
 class LVMThinPoolDevice(LVMLogicalVolumeDevice):
+
     """ An LVM Thin Pool """
     _type = "lvmthinpool"
     _resizable = False
@@ -1565,7 +1588,9 @@ def populate_ksdata(self, data):
         if self.profile:
             data.profile = self.profile.name
 
+
 class LVMThinLogicalVolumeDevice(LVMLogicalVolumeDevice):
+
     """ An LVM Thin Logical Volume """
     _type = "lvmthinlv"
     _container_class = LVMThinPoolDevice
@@ -1606,7 +1631,7 @@ def _pre_create(self):
         # skip LVMLogicalVolumeDevice's _pre_create() method as it checks for a
         # free space in a VG which doesn't make sense for a ThinLV and causes a
         # bug by limitting the ThinLV's size to VG free space which is nonsense
-        super(LVMLogicalVolumeDevice, self)._pre_create() # pylint: disable=bad-super-call
+        super(LVMLogicalVolumeDevice, self)._pre_create()  # pylint: disable=bad-super-call
 
     def _create(self):
         """ Create the device. """
@@ -1635,7 +1660,9 @@ def populate_ksdata(self, data):
         data.thin_volume = True
         data.pool_name = self.pool.lvname
 
+
 class LVMThinSnapShotDevice(LVMSnapShotBase, LVMThinLogicalVolumeDevice):
+
     """ An LVM Thin Snapshot """
     _type = "lvmthinsnapshot"
     _resizable = False
@@ -1670,7 +1697,7 @@ def __init__(self, name, parents=None, sysfs_path='', origin=None,
 
         LVMSnapShotBase.__init__(self, origin=origin, exists=exists)
         LVMThinLogicalVolumeDevice.__init__(self, name, parents=parents,
-                                            sysfs_path=sysfs_path,fmt=fmt,
+                                            sysfs_path=sysfs_path, fmt=fmt,
                                             seg_type=seg_type,
                                             uuid=uuid, size=size, exists=exists)
 
@@ -1706,7 +1733,9 @@ def depends_on(self, dep):
         return ((self.origin == dep and not self.exists) or
                 super(LVMThinSnapShotDevice, self).depends_on(dep))
 
+
 class LVMCache(Cache):
+
     """Class providing the cache-related functionality of a cached LV"""
 
     def __init__(self, cached_lv, size=None, md_size=None, exists=False, fast_pvs=None, mode=None):
@@ -1809,7 +1838,9 @@ def detach(self):
         blockdev.lvm.cache_detach(vg_name, self._cached_lv.lvname, False)
         return ret
 
+
 class LVMCacheStats(CacheStats):
+
     def __init__(self, stats_data):
         """
         :param stats_data: cache stats data
@@ -1877,8 +1908,11 @@ def write_hits(self):
     def write_misses(self):
         return self._write_misses
 
+
 class LVMCacheRequest(CacheRequest):
+
     """Class representing the LVM cache creation request"""
+
     def __init__(self, size, fast_pvs, mode=None):
         """
         :param size: requested size of the cache
diff --git a/blivet/devices/md.py b/blivet/devices/md.py
index fa13ba8..9e19be3 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -36,7 +36,7 @@
 from .. import udev
 from ..size import Size
 from ..tasks import availability
-from ..util import open # pylint: disable=redefined-builtin
+from ..util import open  # pylint: disable=redefined-builtin
 
 import logging
 log = logging.getLogger("blivet")
@@ -45,7 +45,9 @@
 from .container import ContainerDevice
 from .raid import RaidDevice
 
+
 class MDRaidArrayDevice(ContainerDevice, RaidDevice):
+
     """ An mdraid (Linux RAID) device. """
     _type = "mdarray"
     _packages = ["mdadm"]
@@ -199,7 +201,7 @@ def create_bitmap(self):
             If the array has no redundancy, a bitmap is just pointless.
         """
         try:
-            return self.level.has_redundancy() and self.size >= Size(1000) and  self.format.type != "swap"
+            return self.level.has_redundancy() and self.size >= Size(1000) and self.format.type != "swap"
         except errors.RaidError:
             # If has_redundancy() raises an exception then this device has
             # a level for which the redundancy question is meaningless. In
@@ -553,7 +555,7 @@ def format_args(self):
         if self.format.type == "ext2":
             recommended_stride = self.level.get_recommended_stride(self.member_devices)
             if recommended_stride:
-                format_args = ['-R', 'stride=%d' % recommended_stride ]
+                format_args = ['-R', 'stride=%d' % recommended_stride]
         return format_args
 
     @property
@@ -582,6 +584,7 @@ def populate_ksdata(self, data):
         data.preexist = self.exists
         data.device = self.name
 
+
 class MDContainerDevice(MDRaidArrayDevice):
 
     _type = "mdcontainer"
@@ -636,6 +639,7 @@ def is_disk(self):
     def partitionable(self):
         return False
 
+
 class MDBiosRaidArrayDevice(MDRaidArrayDevice):
 
     _type = "mdbiosraidarray"
diff --git a/blivet/devices/network.py b/blivet/devices/network.py
index 28d016b..7133dfe 100644
--- a/blivet/devices/network.py
+++ b/blivet/devices/network.py
@@ -19,7 +19,9 @@
 # Red Hat Author(s): David Lehman <dlehman at redhat.com>
 #
 
+
 class NetworkStorageDevice(object):
+
     """ Virtual base class for network backed storage devices """
 
     def __init__(self, host_address=None, nic=None):
diff --git a/blivet/devices/nfs.py b/blivet/devices/nfs.py
index 84038ab..3143d7c 100644
--- a/blivet/devices/nfs.py
+++ b/blivet/devices/nfs.py
@@ -27,7 +27,9 @@
 from .storage import StorageDevice
 from .network import NetworkStorageDevice
 
+
 class NFSDevice(StorageDevice, NetworkStorageDevice):
+
     """ An NFS device """
     _type = "nfs"
     _packages = ["dracut-network"]
diff --git a/blivet/devices/nodev.py b/blivet/devices/nodev.py
index 1c360cf..099bf42 100644
--- a/blivet/devices/nodev.py
+++ b/blivet/devices/nodev.py
@@ -27,7 +27,9 @@
 from ..size import Size
 from .storage import StorageDevice
 
+
 class NoDevice(StorageDevice):
+
     """ A nodev device for nodev filesystems like tmpfs. """
     _type = "nodev"
 
@@ -73,7 +75,9 @@ def destroy(self):
     def update_size(self):
         pass
 
+
 class TmpFSDevice(NoDevice):
+
     """ A nodev device for a tmpfs filesystem. """
     _type = "tmpfs"
     _format_immutable = True
diff --git a/blivet/devices/optical.py b/blivet/devices/optical.py
index c99ec16..8352be0 100644
--- a/blivet/devices/optical.py
+++ b/blivet/devices/optical.py
@@ -30,7 +30,9 @@
 
 from .storage import StorageDevice
 
+
 class OpticalDevice(StorageDevice):
+
     """ An optical drive, eg: cdrom, dvd+r, &c.
 
         XXX Is this useful?
@@ -72,7 +74,7 @@ def eject(self):
         if not self.exists:
             raise errors.DeviceError("device has not been created", self.name)
 
-        #try to umount and close device before ejecting
+        # try to umount and close device before ejecting
         self.teardown()
 
         try:
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 7cc1a1d..6d1c626 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -50,7 +50,9 @@
 # in case the default partition size doesn't fit
 FALLBACK_DEFAULT_PART_SIZE = Size("256MiB")
 
+
 class PartitionDevice(StorageDevice):
+
     """ A disk partition.
 
         On types and flags...
@@ -343,7 +345,7 @@ def _set_parted_partition(self, partition):
         self.update_name()
 
     parted_partition = property(lambda d: d._get_parted_partition(),
-                               lambda d,p: d._set_parted_partition(p))
+                               lambda d, p: d._set_parted_partition(p))
 
     def pre_commit_fixup(self):
         """ Re-get self.parted_partition from the original disklabel. """
@@ -377,7 +379,7 @@ def _set_weight(self, weight):
         self.req_base_weight = weight
 
     weight = property(lambda d: d._get_weight(),
-                      lambda d,w: d._set_weight(w))
+                      lambda d, w: d._set_weight(w))
 
     def _set_name(self, value):
         self._name = value  # actual name setting is done by parted
@@ -628,7 +630,7 @@ def _compute_resize(self, partition, newsize=None):
         # and align the end sector
         if new_geometry.length < current_geom.length:
             align = self.disk.format.end_alignment.alignUp
-            align_geom = current_geom # we can align up into the old geometry
+            align_geom = current_geom  # we can align up into the old geometry
         else:
             align = self.disk.format.end_alignment.alignDown
             align_geom = new_geometry
@@ -762,7 +764,7 @@ def _set_disk(self, disk):
         if disk:
             self.parents.append(disk)
 
-    disk = property(lambda p: p._get_disk(), lambda p,d: p._set_disk(d))
+    disk = property(lambda p: p._get_disk(), lambda p, d: p._set_disk(d))
 
     @property
     def _unaligned_max_part_size(self):
@@ -816,7 +818,7 @@ def min_size(self):
         if self.is_extended:
             logicals = self.disk.format.logical_partitions
             if logicals:
-                end_free = Size((self.parted_partition.geometry.end - logicals[-1].geometry.end) * \
+                end_free = Size((self.parted_partition.geometry.end - logicals[-1].geometry.end) *
                                 self.disk.format.sector_size)
                 min_size = self.align_target_size(self.current_size - end_free)
             else:
@@ -880,7 +882,7 @@ def populate_ksdata(self, data):
             if self.req_grow:
                 data.max_size_mb = self.req_max_size.convert_to(MiB)
 
-            ##data.disk = self.disk.name                      # by-id
+            # data.disk = self.disk.name                      # by-id
             if self.req_disks and len(self.req_disks) == 1:
                 data.disk = self.disk.name
             data.prim_only = self.req_primary
diff --git a/blivet/devices/raid.py b/blivet/devices/raid.py
index a2e73e0..85fa3a3 100644
--- a/blivet/devices/raid.py
+++ b/blivet/devices/raid.py
@@ -28,8 +28,10 @@
 
 from .storage import StorageDevice
 
+
 @add_metaclass(abc.ABCMeta)
 class RaidDevice(StorageDevice):
+
     """ Metaclass for devices that support RAID in some form. """
     members = abc.abstractproperty(lambda s: [],
                                    doc="A list of the member device instances")
@@ -49,14 +51,14 @@ def _validate_raid_level(self, level, parent_diff=0):
             number of parents. The number is positive for added parents,
             negative for removed parents.
         """
-        num_members = len(self.members) + parent_diff # pylint: disable=no-member
+        num_members = len(self.members) + parent_diff  # pylint: disable=no-member
         if not self.exists and num_members < level.min_members:
             message = P_(
                "RAID level %(raid_level)s requires that device have at least %(min_members)d member.",
                "RAID level %(raid_level)s requires that device have at least %(min_members)d members.",
                level.min_members
             )
-            return message % {"raid_level": level, "min_members" : level.min_members}
+            return message % {"raid_level": level, "min_members": level.min_members}
         return None
 
     def _get_level(self, value, levels):
@@ -75,7 +77,7 @@ def _get_level(self, value, levels):
         except errors.RaidError:
             message = _("RAID level %(raid_level)s is an invalid value. Must be one of (%(levels)s).")
             choices = ", ".join([str(l) for l in levels])
-            raise ValueError(message % {"raid_level": value, "levels" : choices})
+            raise ValueError(message % {"raid_level": value, "levels": choices})
 
         error_msg = self._validate_raid_level(level)
         if error_msg:
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 7e0136a..61df3e9 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -31,7 +31,7 @@
 from .. import udev
 from ..formats import get_format, DeviceFormat
 from ..size import Size
-from ..util import open # pylint: disable=redefined-builtin
+from ..util import open  # pylint: disable=redefined-builtin
 
 import logging
 log = logging.getLogger("blivet")
@@ -40,7 +40,9 @@
 from .network import NetworkStorageDevice
 from .lib import LINUX_SECTOR_SIZE
 
+
 class StorageDevice(Device):
+
     """ A generic storage device.
 
         A fully qualified path to the device node can be obtained via the
@@ -252,7 +254,7 @@ def __repr__(self):
 
     @property
     def dict(self):
-        d =  super(StorageDevice, self).dict
+        d = super(StorageDevice, self).dict
         d.update({"uuid": self.uuid, "size": self.size,
                   "format": self.format.dict, "removable": self.removable,
                   "major": self.major, "minor": self.minor,
@@ -609,7 +611,7 @@ def update_size(self):
         self._current_size = Size(0)
         new_size = self.current_size
         self._size = new_size
-        self._target_size = new_size # bypass setter checks
+        self._target_size = new_size  # bypass setter checks
         log.debug("updated %s size to %s (%s)", self.name, self.size, new_size)
 
     @property
@@ -738,7 +740,7 @@ def _get_format(self):
         return self._format
 
     format = property(lambda d: d._get_format(),
-                      lambda d,f: d._set_format(f),
+                      lambda d, f: d._set_format(f),
                       doc="The device's formatting.")
 
     def pre_commit_fixup(self):
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index ed3f00d..d1d022d 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -47,7 +47,9 @@
 
 _LVM_DEVICE_CLASSES = (LVMLogicalVolumeDevice, LVMVolumeGroupDevice)
 
+
 class DeviceTree(object):
+
     """ A quasi-tree that represents the devices in the system.
 
         The tree contains a list of :class:`~.devices.StorageDevice` instances,
@@ -156,7 +158,7 @@ def disk_images(self):
     def pv_info(self):
         if self._pvs_cache is None:
             pvs = blockdev.lvm.pvs()
-            self._pvs_cache = dict((pv.pv_name, pv) for pv in pvs) # pylint: disable=attribute-defined-outside-init
+            self._pvs_cache = dict((pv.pv_name, pv) for pv in pvs)  # pylint: disable=attribute-defined-outside-init
 
         return self._pvs_cache
 
@@ -164,14 +166,14 @@ def pv_info(self):
     def lv_info(self):
         if self._lvs_cache is None:
             lvs = blockdev.lvm.lvs()
-            self._lvs_cache = dict(("%s-%s" % (lv.vg_name, lv.lv_name), lv) for lv in lvs) # pylint: disable=attribute-defined-outside-init
+            self._lvs_cache = dict(("%s-%s" % (lv.vg_name, lv.lv_name), lv) for lv in lvs)  # pylint: disable=attribute-defined-outside-init
 
         return self._lvs_cache
 
     def drop_lvm_cache(self):
         """ Drop cached lvm information. """
-        self._pvs_cache = None # pylint: disable=attribute-defined-outside-init
-        self._lvs_cache = None # pylint: disable=attribute-defined-outside-init
+        self._pvs_cache = None  # pylint: disable=attribute-defined-outside-init
+        self._lvs_cache = None  # pylint: disable=attribute-defined-outside-init
 
     def _add_device(self, newdev, new=True):
         """ Add a device to the tree.
@@ -744,8 +746,8 @@ def get_device_by_name(self, name, incomplete=False, hidden=False):
         result = None
         if name:
             devices = self._filter_devices(incomplete=incomplete, hidden=hidden)
-            result = next((d for d in devices if d.name == name or \
-               (isinstance(d, _LVM_DEVICE_CLASSES) and d.name == name.replace("--","-"))),
+            result = next((d for d in devices if d.name == name or
+               (isinstance(d, _LVM_DEVICE_CLASSES) and d.name == name.replace("--", "-"))),
                None)
         log_method_return(self, result)
         return result
@@ -770,8 +772,8 @@ def get_device_by_path(self, path, incomplete=False, hidden=False):
             # The usual order of the devices list is one where leaves are at
             # the end. So that the search can prefer leaves to interior nodes
             # the list that is searched is the reverse of the devices list.
-            result = next((d for d in reversed(list(devices)) if d.path == path or \
-               (isinstance(d, _LVM_DEVICE_CLASSES) and d.path == path.replace("--","-"))),
+            result = next((d for d in reversed(list(devices)) if d.path == path or
+               (isinstance(d, _LVM_DEVICE_CLASSES) and d.path == path.replace("--", "-"))),
                None)
 
         log_method_return(self, result)
@@ -1089,12 +1091,13 @@ def save_luks_passphrase(self, device):
 
     def __str__(self):
         done = []
+
         def show_subtree(root, depth):
             abbreviate_subtree = root in done
             s = "%s%s\n" % ("  " * depth, root)
             done.append(root)
             if abbreviate_subtree:
-                s += "%s...\n" % ("  " * (depth+1),)
+                s += "%s...\n" % ("  " * (depth + 1),)
             else:
                 for child in self.get_children(root):
                     s += show_subtree(child, depth + 1)
diff --git a/blivet/errors.py b/blivet/errors.py
index fa23060..c446b28 100644
--- a/blivet/errors.py
+++ b/blivet/errors.py
@@ -22,137 +22,184 @@
 
 from .i18n import N_
 
+
 class StorageError(Exception):
+
     def __init__(self, *args, **kwargs):
         self.hardware_fault = kwargs.pop("hardware_fault", False)
         super(StorageError, self).__init__(*args, **kwargs)
 
+
 class NoDisksError(StorageError):
     pass
 
 # Device
+
+
 class DeviceError(StorageError):
     pass
 
+
 class DeviceCreateError(DeviceError):
     pass
 
+
 class DeviceDestroyError(DeviceError):
     pass
 
+
 class DeviceResizeError(DeviceError):
     pass
 
+
 class DeviceSetupError(DeviceError):
     pass
 
+
 class DeviceTeardownError(DeviceError):
     pass
 
+
 class DeviceUserDeniedFormatError(DeviceError):
     pass
 
 # DeviceFormat
+
+
 class DeviceFormatError(StorageError):
     pass
 
+
 class FormatCreateError(DeviceFormatError):
     pass
 
+
 class FormatDestroyError(DeviceFormatError):
     pass
 
+
 class FormatSetupError(DeviceFormatError):
     pass
 
+
 class FormatTeardownError(DeviceFormatError):
     pass
 
+
 class DMRaidMemberError(DeviceFormatError):
     pass
 
+
 class MultipathMemberError(DeviceFormatError):
     pass
 
+
 class FSError(DeviceFormatError):
     pass
 
+
 class FSWriteLabelError(FSError):
     pass
 
+
 class FSReadLabelError(FSError):
     pass
 
+
 class FSResizeError(FSError):
+
     def __init__(self, message, details):
         FSError.__init__(self, message)
         self.details = details
 
+
 class LUKSError(DeviceFormatError):
     pass
 
+
 class MDMemberError(DeviceFormatError):
     pass
 
+
 class PhysicalVolumeError(DeviceFormatError):
     pass
 
+
 class SinglePhysicalVolumeError(DeviceFormatError):
     pass
 
+
 class SwapSpaceError(DeviceFormatError):
     pass
 
+
 class DiskLabelError(DeviceFormatError):
     pass
 
+
 class InvalidDiskLabelError(DiskLabelError):
     pass
 
+
 class DiskLabelCommitError(DiskLabelError):
     pass
 
+
 class AlignmentError(DiskLabelError):
     pass
 
 # devicelibs
+
+
 class RaidError(StorageError):
     pass
 
+
 class DMError(StorageError):
     pass
 
+
 class MPathError(StorageError):
     pass
 
+
 class BTRFSError(StorageError):
     pass
 
+
 class BTRFSValueError(BTRFSError, ValueError):
     pass
 
 # DeviceTree
+
+
 class DeviceTreeError(StorageError):
     pass
 
+
 class DeviceNotFoundError(StorageError):
     pass
 
+
 class UnusableConfigurationError(StorageError):
+
     """ User has an unusable initial storage configuration. """
     suggestion = ""
 
+
 class DiskLabelScanError(UnusableConfigurationError):
     suggestion = N_("For some reason we were unable to locate a disklabel on a "
                     "disk that the kernel is reporting partitions on. It is "
                     "unclear what the exact problem is. Please file a bug at "
                     "http://bugzilla.redhat.com")
 
+
 class CorruptGPTError(UnusableConfigurationError):
     suggestion = N_("Either restore the disklabel to a completely working "
                     "state or remove it completely.\n"
                     "Hint: parted can restore it or wipefs can remove it.")
 
+
 class DuplicateVGError(UnusableConfigurationError):
     suggestion = N_("Rename one of the volume groups so the names are "
                     "distinct.\n"
@@ -161,39 +208,57 @@ class DuplicateVGError(UnusableConfigurationError):
                     "'pvs -o +vg_uuid'.")
 
 # DeviceAction
+
+
 class DeviceActionError(StorageError):
     pass
 
 # partitioning
+
+
 class PartitioningError(StorageError):
     pass
 
+
 class NotEnoughFreeSpaceError(StorageError):
     pass
 
 # udev
+
+
 class UdevError(StorageError):
     pass
 
 # fstab
+
+
 class UnrecognizedFSTabEntryError(StorageError):
     pass
 
+
 class FSTabTypeMismatchError(StorageError):
     pass
 
 # size
+
+
 class SizePlacesError(StorageError):
     pass
 
 # probing
+
+
 class UnknownSourceDeviceError(StorageError):
     pass
 
 # factories
+
+
 class DeviceFactoryError(StorageError):
     pass
 
+
 class AvailabilityError(StorageError):
+
     """ Raised if problem determining availability of external resource. """
     pass
diff --git a/blivet/fcoe.py b/blivet/fcoe.py
index 4862723..c50a7b0 100644
--- a/blivet/fcoe.py
+++ b/blivet/fcoe.py
@@ -28,6 +28,7 @@
 
 _fcoe_module_loaded = False
 
+
 def has_fcoe():
     global _fcoe_module_loaded
     if not _fcoe_module_loaded:
@@ -39,7 +40,9 @@ def has_fcoe():
 
     return os.access("/sys/module/fcoe", os.X_OK)
 
+
 class fcoe(object):
+
     """ FCoE utility class.
 
         This class will automatically discover and connect to EDD configured
@@ -126,7 +129,7 @@ def add_san(self, nic, dcb=False, auto_vlan=True):
                 # certain network configrations require the VLAN layer module:
                 util.run_program(["modprobe", "8021q"])
                 rc, out = util.run_program_and_capture_output(["fipvlan", '-c', '-s', '-f',
-                                                   "-fcoe",  nic], stderr_to_stdout=True)
+                                                   "-fcoe", nic], stderr_to_stdout=True)
             else:
                 f = open("/sys/module/libfcoe/parameters/create", "w")
                 f.write(nic)
diff --git a/blivet/flags.py b/blivet/flags.py
index 5f8b521..82369d9 100644
--- a/blivet/flags.py
+++ b/blivet/flags.py
@@ -24,7 +24,9 @@
 
 from .util import open  # pylint: disable=redefined-builtin
 
+
 class Flags(object):
+
     def __init__(self):
         #
         # mode of operation
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index 8c238ed..1a5e14b 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -43,6 +43,8 @@
 
 
 device_formats = {}
+
+
 def register_device_format(fmt_class):
     if not issubclass(fmt_class, DeviceFormat):
         raise ValueError("arg1 must be a subclass of DeviceFormat")
@@ -52,6 +54,8 @@ def register_device_format(fmt_class):
                                                          fmt_class._type)
 
 default_fstypes = ("ext4", "ext3", "ext2")
+
+
 def get_default_filesystem_type():
     for fstype in default_fstypes:
         try:
@@ -64,6 +68,7 @@ def get_default_filesystem_type():
 
     raise DeviceFormatError("None of %s is supported by your kernel" % ",".join(default_fstypes))
 
+
 def get_format(fmt_type, *args, **kwargs):
     """ Return an instance of the appropriate DeviceFormat class.
 
@@ -95,6 +100,7 @@ def get_format(fmt_type, *args, **kwargs):
        fmt_type, fmt.__class__.__name__, fmt.id)
     return fmt
 
+
 def collect_device_format_classes():
     """ Pick up all device format classes from this directory.
 
@@ -110,12 +116,13 @@ def collect_device_format_classes():
         (mod_name, ext) = os.path.splitext(module_file)
         if ext == ".py" and mod_name != myfile_name and not mod_name.startswith("."):
             try:
-                globals()[mod_name] = importlib.import_module("."+mod_name, package=__package__)
+                globals()[mod_name] = importlib.import_module("." + mod_name, package=__package__)
             except ImportError:
                 log.error("import of device format module '%s' failed", mod_name)
                 from traceback import format_exc
                 log.debug("%s", format_exc())
 
+
 def get_device_format_class(fmt_type):
     """ Return an appropriate format class.
 
@@ -141,7 +148,9 @@ def get_device_format_class(fmt_type):
 
     return fmt
 
+
 class DeviceFormat(ObjectID):
+
     """ Generic device format.
 
         This represents the absence of recognized formatting. That could mean a
@@ -294,7 +303,7 @@ def _get_options(self):
 
     options = property(
        lambda s: s._get_options(),
-       lambda s,v: s._set_options(v),
+       lambda s, v: s._set_options(v),
        doc="fstab entry option string"
     )
 
@@ -306,7 +315,7 @@ def _get_create_options(self):
 
     create_options = property(
         lambda s: s._get_create_options(),
-        lambda s,v: s._set_create_options(v),
+        lambda s, v: s._set_create_options(v),
         doc="options to be used when running mkfs"
     )
 
@@ -332,7 +341,7 @@ def _get_device(self):
         return self._device
 
     device = property(lambda f: f._get_device(),
-                      lambda f,d: f._set_device(d),
+                      lambda f, d: f._set_device(d),
                       doc="Full path the device this format occupies")
 
     @property
diff --git a/blivet/formats/biosboot.py b/blivet/formats/biosboot.py
index 653a436..6fa04b1 100644
--- a/blivet/formats/biosboot.py
+++ b/blivet/formats/biosboot.py
@@ -27,7 +27,9 @@
 from ..i18n import N_
 from . import DeviceFormat, register_device_format
 
+
 class BIOSBoot(DeviceFormat):
+
     """ BIOS boot partition for GPT disklabels. """
     _type = "biosboot"
     _name = N_("BIOS Boot")
@@ -57,7 +59,7 @@ def status(self):
 
     @property
     def supported(self):
-        return super(BIOSBoot,self).supported and isinstance(platform.platform, platform.X86)
+        return super(BIOSBoot, self).supported and isinstance(platform.platform, platform.X86)
 
 register_device_format(BIOSBoot)
 
diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
index f060dbd..f10edbe 100644
--- a/blivet/formats/disklabel.py
+++ b/blivet/formats/disklabel.py
@@ -39,6 +39,7 @@
 
 
 class DiskLabel(DeviceFormat):
+
     """ Disklabel """
     _type = "disklabel"
     _name = N_("partition table")
@@ -198,7 +199,7 @@ def label_type(self):
         """ The disklabel type (eg: 'gpt', 'msdos') """
         try:
             lt = self.parted_disk.type
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info()
             lt = self._label_type
         return lt
@@ -221,7 +222,7 @@ def size(self):
         if not size:
             try:
                 size = Size(self.parted_device.getLength(unit="B"))
-            except Exception: # pylint: disable=broad-except
+            except Exception:  # pylint: disable=broad-except
                 log_exception_info()
                 size = Size(0)
 
@@ -312,7 +313,7 @@ def remove_partition(self, partition):
     def extended_partition(self):
         try:
             extended = self.parted_disk.getExtendedPartition()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info()
             extended = None
         return extended
@@ -321,7 +322,7 @@ def extended_partition(self):
     def logical_partitions(self):
         try:
             logicals = self.parted_disk.getLogicalPartitions()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info()
             logicals = []
         return logicals
@@ -330,7 +331,7 @@ def logical_partitions(self):
     def primary_partitions(self):
         try:
             primaries = self.parted_disk.getPrimaryPartitions()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info()
             primaries = []
         return primaries
@@ -339,7 +340,7 @@ def primary_partitions(self):
     def first_partition(self):
         try:
             part = self.parted_disk.getFirstPartition()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info()
             part = None
         return part
diff --git a/blivet/formats/dmraid.py b/blivet/formats/dmraid.py
index a2892ce..13a3084 100644
--- a/blivet/formats/dmraid.py
+++ b/blivet/formats/dmraid.py
@@ -31,6 +31,7 @@
 
 
 class DMRaidMember(DeviceFormat):
+
     """ A dmraid member disk. """
     _type = "dmraidmember"
     _name = N_("dm-raid member device")
@@ -80,7 +81,7 @@ def _set_raidmem(self, raidmem):
         self._raidmem = raidmem
 
     raidmem = property(lambda d: d._get_raidmem(),
-                       lambda d,r: d._set_raidmem(r))
+                       lambda d, r: d._set_raidmem(r))
 
     def create(self, **kwargs):
         log_method_call(self, device=self.device,
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 869f35b..ce31206 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -57,7 +57,9 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 class FS(DeviceFormat):
+
     """ Filesystem base class. """
     _type = "Abstract Filesystem Class"  # fs type name
     _name = None
@@ -120,7 +122,7 @@ def __init__(self, **kwargs):
         self._minsize = self._minsize_class(self)
         self._size_info = self._size_info_class(self)
 
-        self._current_info = None # info obtained by _info task
+        self._current_info = None  # info obtained by _info task
 
         self.mountpoint = kwargs.get("mountpoint")
         self.mountopts = kwargs.get("mountopts")
@@ -211,7 +213,7 @@ def label_format_ok(self, label):
         """
         return label is None or (self._labelfs is not None and self._labelfs.label_format_ok(label))
 
-    label = property(lambda s: s._get_label(), lambda s,l: s._set_label(l),
+    label = property(lambda s: s._get_label(), lambda s, l: s._set_label(l),
        doc="this filesystem's label")
 
     def _set_target_size(self, newsize):
@@ -541,7 +543,7 @@ def test_mount(self):
         try:
             rc = self.mount(mountpoint=mountpoint)
             ret = not rc
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.info, "test mount failed")
 
         if ret:
@@ -802,7 +804,9 @@ def populate_ksdata(self, data):
         data.mkfsopts = self.create_options or ""
         data.fsprofile = self.fsprofile or ""
 
+
 class Ext2FS(FS):
+
     """ ext2 filesystem. """
     _type = "ext2"
     _modules = ["ext2"]
@@ -824,12 +828,13 @@ class Ext2FS(FS):
     _size_info_class = fssize.Ext2FSSize
     _writelabel_class = fswritelabel.Ext2FSWriteLabel
     parted_system = fileSystemType["ext2"]
-    _MetadataSizeFactor = 0.93 # ext2 metadata may take 7% of space
+    _MetadataSizeFactor = 0.93  # ext2 metadata may take 7% of space
 
 register_device_format(Ext2FS)
 
 
 class Ext3FS(Ext2FS):
+
     """ ext3 filesystem. """
     _type = "ext3"
     _modules = ["ext3"]
@@ -841,24 +846,26 @@ class Ext3FS(Ext2FS):
     # with regard to this maximum filesystem size, but if they're doing such
     # things they should know the implications of their chosen block size.
     _max_size = Size("16 TiB")
-    _MetadataSizeFactor = 0.90 # ext3 metadata may take 10% of space
+    _MetadataSizeFactor = 0.90  # ext3 metadata may take 10% of space
 
 register_device_format(Ext3FS)
 
 
 class Ext4FS(Ext3FS):
+
     """ ext4 filesystem. """
     _type = "ext4"
     _modules = ["ext4"]
     _mkfs_class = fsmkfs.Ext4FSMkfs
     parted_system = fileSystemType["ext4"]
     _max_size = Size("1 EiB")
-    _MetadataSizeFactor = 0.85 # ext4 metadata may take 15% of space
+    _MetadataSizeFactor = 0.85  # ext4 metadata may take 15% of space
 
 register_device_format(Ext4FS)
 
 
 class FATFS(FS):
+
     """ FAT filesystem. """
     _type = "vfat"
     _modules = ["vfat"]
@@ -866,13 +873,13 @@ class FATFS(FS):
     _supported = True
     _formattable = True
     _max_size = Size("1 TiB")
-    _packages = [ "dosfstools" ]
+    _packages = ["dosfstools"]
     _fsck_class = fsck.DosFSCK
     _mkfs_class = fsmkfs.FATFSMkfs
     _mount_class = fsmount.FATFSMount
     _readlabel_class = fsreadlabel.DosFSReadLabel
     _writelabel_class = fswritelabel.DosFSWriteLabel
-    _MetadataSizeFactor = 0.99 # fat metadata may take 1% of space
+    _MetadataSizeFactor = 0.99  # fat metadata may take 1% of space
     # FIXME this should be fat32 in some cases
     parted_system = fileSystemType["fat16"]
 
@@ -894,6 +901,7 @@ def supported(self):
 
 
 class BTRFS(FS):
+
     """ btrfs filesystem """
     _type = "btrfs"
     _modules = ["btrfs"]
@@ -904,7 +912,7 @@ class BTRFS(FS):
     _min_size = Size("256 MiB")
     _max_size = Size("16 EiB")
     _mkfs_class = fsmkfs.BTRFSMkfs
-    _MetadataSizeFactor = 0.80 # btrfs metadata may take 20% of space
+    _MetadataSizeFactor = 0.80  # btrfs metadata may take 20% of space
     # FIXME parted needs to be taught about btrfs so that we can set the
     # partition table type correctly for btrfs partitions
     # parted_system = fileSystemType["btrfs"]
@@ -933,6 +941,7 @@ def _pre_setup(self, **kwargs):
 
 
 class GFS2(FS):
+
     """ gfs2 filesystem. """
     _type = "gfs2"
     _modules = ["dlm", "gfs2"]
@@ -955,6 +964,7 @@ def supported(self):
 
 
 class JFS(FS):
+
     """ JFS filesystem """
     _type = "jfs"
     _modules = ["jfs"]
@@ -968,7 +978,7 @@ class JFS(FS):
     _mkfs_class = fsmkfs.JFSMkfs
     _size_info_class = fssize.JFSSize
     _writelabel_class = fswritelabel.JFSWriteLabel
-    _MetadataSizeFactor = 0.99 # jfs metadata may take 1% of space
+    _MetadataSizeFactor = 0.99  # jfs metadata may take 1% of space
     parted_system = fileSystemType["jfs"]
 
     @property
@@ -980,6 +990,7 @@ def supported(self):
 
 
 class ReiserFS(FS):
+
     """ reiserfs filesystem """
     _type = "reiserfs"
     _labelfs = fslabeling.ReiserFSLabeling()
@@ -994,7 +1005,7 @@ class ReiserFS(FS):
     _mkfs_class = fsmkfs.ReiserFSMkfs
     _size_info_class = fssize.ReiserFSSize
     _writelabel_class = fswritelabel.ReiserFSWriteLabel
-    _MetadataSizeFactor = 0.98 # reiserfs metadata may take 2% of space
+    _MetadataSizeFactor = 0.98  # reiserfs metadata may take 2% of space
     parted_system = fileSystemType["reiserfs"]
 
     @property
@@ -1006,6 +1017,7 @@ def supported(self):
 
 
 class XFS(FS):
+
     """ XFS filesystem """
     _type = "xfs"
     _modules = ["xfs"]
@@ -1021,12 +1033,13 @@ class XFS(FS):
     _size_info_class = fssize.XFSSize
     _sync_class = fssync.XFSSync
     _writelabel_class = fswritelabel.XFSWriteLabel
-    _MetadataSizeFactor = 0.97 # xfs metadata may take 3% of space
+    _MetadataSizeFactor = 0.97  # xfs metadata may take 3% of space
     parted_system = fileSystemType["xfs"]
 
 
 register_device_format(XFS)
 
+
 class HFS(FS):
     _type = "hfs"
     _modules = ["hfs"]
@@ -1091,6 +1104,7 @@ def __init__(self, **kwargs):
 
 
 class NTFS(FS):
+
     """ ntfs filesystem. """
     _type = "ntfs"
     _labelfs = fslabeling.NTFSLabeling()
@@ -1114,6 +1128,7 @@ class NTFS(FS):
 
 # if this isn't going to be mountable it might as well not be here
 class NFS(FS):
+
     """ NFS filesystem. """
     _type = "nfs"
     _modules = ["nfs"]
@@ -1128,6 +1143,7 @@ def _device_check(self, devspec):
 
 
 class NFSv4(NFS):
+
     """ NFSv4 filesystem. """
     _type = "nfs4"
     _modules = ["nfs4"]
@@ -1136,6 +1152,7 @@ class NFSv4(NFS):
 
 
 class Iso9660FS(FS):
+
     """ ISO9660 filesystem. """
     _type = "iso9660"
     _supported = True
@@ -1145,6 +1162,7 @@ class Iso9660FS(FS):
 
 
 class NoDevFS(FS):
+
     """ nodev filesystem base class """
     _type = "nodev"
     _mount_class = fsmount.NoDevFSMount
@@ -1169,6 +1187,7 @@ def notify_kernel(self):
 
 
 class DevPtsFS(NoDevFS):
+
     """ devpts filesystem. """
     _type = "devpts"
     _mount_class = fsmount.DevPtsFSMount
@@ -1273,7 +1292,7 @@ def free(self):
             # self.system_mountpoint is set to the full changeroot path once
             # mounted so even with changeroot, statvfs should still work fine.
             st = util.eintr_retry_call(os.statvfs, self.system_mountpoint)
-            free_space = Size(st.f_bavail*st.f_frsize)
+            free_space = Size(st.f_bavail * st.f_frsize)
         else:
             # Free might be called even if the tmpfs mount has not been
             # mounted yet, in this case just return the size set for the mount.
diff --git a/blivet/formats/fslib.py b/blivet/formats/fslib.py
index a0e419d..ea3c1a8 100644
--- a/blivet/formats/fslib.py
+++ b/blivet/formats/fslib.py
@@ -21,11 +21,12 @@
 #                    David Cantrell <dcantrell at redhat.com>
 #                    Anne Mulhern <amulhern at redhat.com>
 
-from ..util import open # pylint: disable=redefined-builtin
+from ..util import open  # pylint: disable=redefined-builtin
 
 kernel_filesystems = []
 nodev_filesystems = []
 
+
 def update_kernel_filesystems():
     with open("/proc/filesystems") as filesystems:
         for line in filesystems:
diff --git a/blivet/formats/luks.py b/blivet/formats/luks.py
index 743faa4..5b9599d 100644
--- a/blivet/formats/luks.py
+++ b/blivet/formats/luks.py
@@ -40,6 +40,7 @@
 
 
 class LUKS(DeviceFormat):
+
     """ LUKS """
     _type = "luks"
     _name = N_("LUKS")
@@ -209,7 +210,7 @@ def _pre_create(self, **kwargs):
     def _create(self, **kwargs):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
-        super(LUKS, self)._create(**kwargs) # set up the event sync
+        super(LUKS, self)._create(**kwargs)  # set up the event sync
         blockdev.crypto.luks_format(self.device,
                                     passphrase=self.__passphrase,
                                     key_file=self._key_file,
diff --git a/blivet/formats/lvmpv.py b/blivet/formats/lvmpv.py
index b3fdc14..471e681 100644
--- a/blivet/formats/lvmpv.py
+++ b/blivet/formats/lvmpv.py
@@ -40,6 +40,7 @@
 
 
 class LVMPhysicalVolume(DeviceFormat):
+
     """ An LVM physical volume. """
     _type = "lvmpv"
     _name = N_("physical volume (LVM)")
diff --git a/blivet/formats/mdraid.py b/blivet/formats/mdraid.py
index edd33a8..4f499f9 100644
--- a/blivet/formats/mdraid.py
+++ b/blivet/formats/mdraid.py
@@ -37,6 +37,7 @@
 
 
 class MDRaidMember(DeviceFormat):
+
     """ An mdraid member disk. """
     _type = "mdmember"
     _name = N_("software RAID")
diff --git a/blivet/formats/multipath.py b/blivet/formats/multipath.py
index ce87e0f..0b2d2e2 100644
--- a/blivet/formats/multipath.py
+++ b/blivet/formats/multipath.py
@@ -32,13 +32,15 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 class MultipathMember(DeviceFormat):
+
     """ A multipath member disk. """
     _type = "multipath_member"
     _name = N_("multipath member device")
     _udev_types = ["multipath_member"]
     _supported = True                   # is supported
-    _packages = ["device-mapper-multipath"] # required packages
+    _packages = ["device-mapper-multipath"]  # required packages
     _hidden = True                      # hide devices with this formatting?
 
     def __init__(self, **kwargs):
@@ -66,7 +68,7 @@ def _set_member(self, member):
         self._member = member
 
     member = property(lambda s: s._get_member(),
-                      lambda s,m: s._set_member(m))
+                      lambda s, m: s._set_member(m))
 
     def create(self, **kwargs):
         log_method_call(self, device=self.device,
diff --git a/blivet/formats/prepboot.py b/blivet/formats/prepboot.py
index cea119a..249c2b2 100644
--- a/blivet/formats/prepboot.py
+++ b/blivet/formats/prepboot.py
@@ -30,7 +30,9 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 class PPCPRePBoot(DeviceFormat):
+
     """ Generic device format. """
     _type = "prepboot"
     _name = N_("PPC PReP Boot")
diff --git a/blivet/formats/swap.py b/blivet/formats/swap.py
index b766eaf..c378c5e 100644
--- a/blivet/formats/swap.py
+++ b/blivet/formats/swap.py
@@ -36,6 +36,7 @@
 
 
 class SwapSpace(DeviceFormat):
+
     """ Swap space """
     _type = "swap"
     _name = None
@@ -47,7 +48,7 @@ class SwapSpace(DeviceFormat):
     _linux_native = True                # for clearpart
     _plugin = availability.BLOCKDEV_SWAP_PLUGIN
 
-    #see rhbz#744129 for details
+    # see rhbz#744129 for details
     _max_size = Size("128 GiB")
 
     def __init__(self, **kwargs):
@@ -106,7 +107,7 @@ def label_format_ok(self, label):
         """Returns True since no known restrictions on the label."""
         return True
 
-    label = property(lambda s: s._get_label(), lambda s,l: s._set_label(l),
+    label = property(lambda s: s._get_label(), lambda s, l: s._set_label(l),
        doc="the label for this swap space")
 
     def _set_priority(self, priority):
diff --git a/blivet/i18n.py b/blivet/i18n.py
index 1042688..0a1c94e 100644
--- a/blivet/i18n.py
+++ b/blivet/i18n.py
@@ -21,11 +21,14 @@
 
 __all__ = ["_", "N_", "P_"]
 
-import gettext, locale
+import gettext
+import locale
 import six
 
 # Create and cache a translations object for the current LC_MESSAGES value
 _cached_translations = {}
+
+
 def _get_translations():
     # Use setlocale instead of getlocale even though that looks like it makes no sense,
     # since this way we're just reading environment variables instead of mandating some
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 2914b82..72a2f50 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -38,10 +38,11 @@
     has_libiscsi = False
 
 # Note that stage2 copies all files under /sbin to /usr/sbin
-ISCSID=""
-INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"
+ISCSID = ""
+INITIATOR_FILE = "/etc/iscsi/initiatorname.iscsi"
+
+ISCSI_MODULES = ['cxgb3i', 'bnx2i', 'be2iscsi']
 
-ISCSI_MODULES=['cxgb3i', 'bnx2i', 'be2iscsi']
 
 def has_iscsi():
     global ISCSID
@@ -116,10 +117,12 @@ def _call_discover_targets(con_write, con_recv, ipaddr, port, authinfo):
 
             con_write.send((True, nodes))
 
-        except Exception as ex: # pylint: disable=broad-except
+        except Exception as ex:  # pylint: disable=broad-except
             con_write.send((False, ex))
 
+
 class iscsi(object):
+
     """ iSCSI utility class.
 
         This class will automatically discover and login to iBFT (or
@@ -149,7 +152,7 @@ def __init__(self):
                 initiatorname = libiscsi.get_firmware_initiator_name()
                 self._initiator = initiatorname
                 self.initiator_set = True
-            except Exception: # pylint: disable=broad-except
+            except Exception:  # pylint: disable=broad-except
                 log_exception_info(fmt_str="failed to get initiator name from iscsi firmware")
 
     # So that users can write iscsi() to get the singleton instance
@@ -204,14 +207,13 @@ def _mark_node_active(self, node, active=True):
                     return True
         return False
 
-
     def _start_ibft(self):
         if not flags.ibft:
             return
 
         try:
             found_nodes = libiscsi.discover_firmware()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.info, "iscsi: No IBFT info found.")
             # an exception here means there is no ibft firmware, just return
             return
@@ -239,10 +241,10 @@ def stabilize(self):
     def create_interfaces(self, ifaces):
         for iface in ifaces:
             iscsi_iface_name = "iface%d" % len(self.ifaces)
-            #iscsiadm -m iface -I iface0 --op=new
+            # iscsiadm -m iface -I iface0 --op=new
             util.run_program(["iscsiadm", "-m", "iface",
                               "-I", iscsi_iface_name, "--op=new"])
-            #iscsiadm -m iface -I iface0 --op=update -n iface.net_ifacename -v eth0
+            # iscsiadm -m iface -I iface0 --op=update -n iface.net_ifacename -v eth0
             util.run_program(["iscsiadm", "-m", "iface",
                               "-I", iscsi_iface_name, "--op=update",
                               "-n", "iface.net_ifacename", "-v", iface])
@@ -254,7 +256,7 @@ def delete_interfaces(self):
         if not self.ifaces:
             return None
         for iscsi_iface_name in self.ifaces:
-            #iscsiadm -m iface -I iface0 --op=delete
+            # iscsiadm -m iface -I iface0 --op=delete
             util.run_program(["iscsiadm", "-m", "iface",
                               "-I", iscsi_iface_name, "--op=delete"])
         self.ifaces = {}
@@ -282,8 +284,8 @@ def startup(self):
         util.eintr_ignore(os.close, fd)
         self.initiator_set = True
 
-        for fulldir in (os.path.join("/var/lib/iscsi", d) for d in \
-           ['ifaces','isns','nodes','send_targets','slp','static']):
+        for fulldir in (os.path.join("/var/lib/iscsi", d) for d in
+           ['ifaces', 'isns', 'nodes', 'send_targets', 'slp', 'static']):
             if not os.path.isdir(fulldir):
                 os.makedirs(fulldir, 0o755)
 
@@ -390,7 +392,7 @@ def log_into_node(self, node, username=None, password=None,
         """
         Raises IOError.
         """
-        rc = False # assume failure
+        rc = False  # assume failure
         msg = ""
 
         try:
@@ -473,7 +475,7 @@ def add_target(self, ipaddr, port="3260", user=None, pw=None,
 
             (rc, _msg) = self.log_into_node(node, user, pw, user_in, pw_in)
             if rc:
-                logged_in = logged_in +1
+                logged_in = logged_in + 1
 
         if found == 0:
             raise IOError(_("No new iSCSI nodes discovered"))
diff --git a/blivet/mounts.py b/blivet/mounts.py
index ebd4806..4f07ff0 100644
--- a/blivet/mounts.py
+++ b/blivet/mounts.py
@@ -28,7 +28,9 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 class _MountinfoCache(object):
+
     """ Cache for info from /proc/self/mountinfo. Looks up the root of the
         mount within the filesystem using a pair of mountpoint, mount
         source as keys.
@@ -80,7 +82,9 @@ def get_root(self, devspec, mountpoint):
         devspec = resolve_devspec(devspec, sysname=True)
         return self._cache.get((devspec, mountpoint))
 
+
 class MountsCache(object):
+
     """ Cache object for system mountpoints; checks /proc/mounts and
         /proc/self/mountinfo for up-to-date information.
     """
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index 125edb9..a15880a 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -48,6 +48,7 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 def release_from_redhat_release(fn):
     """
     Attempt to identify the installation of a Linux distribution via
@@ -79,6 +80,7 @@ def release_from_redhat_release(fn):
 
     return (rel_name, rel_ver)
 
+
 def release_from_os_release(fn):
     """
     Attempt to identify the installation of a Linux distribution via
@@ -112,6 +114,7 @@ def release_from_os_release(fn):
 
     return (rel_name, rel_ver)
 
+
 def get_release_string():
     """
     Attempt to identify the installation of a Linux distribution by checking
@@ -140,6 +143,7 @@ def get_release_string():
 
     return (rel_arch, rel_name, rel_ver)
 
+
 def parse_fstab(devicetree, chroot=None):
     """ parse /etc/fstab and return a tuple of a mount dict and swap list """
     if not chroot or not os.path.isdir(chroot):
@@ -157,7 +161,7 @@ def parse_fstab(devicetree, chroot=None):
     try:
         blkid_tab.parse()
         log.debug("blkid.tab devs: %s", list(blkid_tab.devices.keys()))
-    except Exception: # pylint: disable=broad-except
+    except Exception:  # pylint: disable=broad-except
         log_exception_info(log.info, "error parsing blkid.tab")
         blkid_tab = None
 
@@ -165,7 +169,7 @@ def parse_fstab(devicetree, chroot=None):
     try:
         crypt_tab.parse(chroot=chroot)
         log.debug("crypttab maps: %s", list(crypt_tab.mappings.keys()))
-    except Exception: # pylint: disable=broad-except
+    except Exception:  # pylint: disable=broad-except
         log_exception_info(log.info, "error parsing crypttab")
         crypt_tab = None
 
@@ -197,6 +201,7 @@ def parse_fstab(devicetree, chroot=None):
 
     return (mounts, swaps)
 
+
 def find_existing_installations(devicetree, teardown_all=True):
     """Find existing GNU/Linux installations on devices from the devicetree.
     :param devicetree: devicetree to find existing installations in
@@ -210,7 +215,7 @@ def find_existing_installations(devicetree, teardown_all=True):
     try:
         roots = _find_existing_installations(devicetree)
         return roots
-    except Exception: # pylint: disable=broad-except
+    except Exception:  # pylint: disable=broad-except
         log_exception_info(log.info, "failure detecting existing installations")
     finally:
         if teardown_all:
@@ -218,6 +223,7 @@ def find_existing_installations(devicetree, teardown_all=True):
 
     return []
 
+
 def _find_existing_installations(devicetree):
     if not os.path.exists(get_target_physical_root()):
         util.makedirs(get_target_physical_root())
@@ -230,14 +236,14 @@ def _find_existing_installations(devicetree):
 
         try:
             device.setup()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.warning, "setup of %s failed", [device.name])
             continue
 
         options = device.format.options + ",ro"
         try:
             device.format.mount(options=options, mountpoint=get_sysroot())
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.warning, "mount of %s as %s failed", [device.name, device.format.type])
             util.umount(mountpoint=get_sysroot())
             continue
@@ -272,8 +278,11 @@ def _find_existing_installations(devicetree):
 
     return roots
 
+
 class FSSet(object):
+
     """ A class to represent a set of filesystems. """
+
     def __init__(self, devicetree):
         self.devicetree = devicetree
         self.crypt_tab = None
@@ -492,7 +501,7 @@ def parse_fstab(self, chroot=None):
         try:
             blkid_tab.parse()
             log.debug("blkid.tab devs: %s", list(blkid_tab.devices.keys()))
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.info, "error parsing blkid.tab")
             blkid_tab = None
 
@@ -500,7 +509,7 @@ def parse_fstab(self, chroot=None):
         try:
             crypt_tab.parse(chroot=chroot)
             log.debug("crypttab maps: %s", list(crypt_tab.mappings.keys()))
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.info, "error parsing crypttab")
             crypt_tab = None
 
@@ -617,7 +626,7 @@ def mount_filesystems(self, root_path="", read_only=None, skip_root=False):
 
             try:
                 device.setup()
-            except Exception as e: # pylint: disable=broad-except
+            except Exception as e:  # pylint: disable=broad-except
                 log_exception_info(fmt_str="unable to set up device %s", fmt_args=[device])
                 if error_handler.cb(e) == ERROR_RAISE:
                     raise
@@ -630,7 +639,7 @@ def mount_filesystems(self, root_path="", read_only=None, skip_root=False):
             try:
                 device.format.setup(options=options,
                                     chroot=root_path)
-            except Exception as e: # pylint: disable=broad-except
+            except Exception as e:  # pylint: disable=broad-except
                 log_exception_info(log.error, "error mounting %s on %s", [device.path, device.format.mountpoint])
                 if error_handler.cb(e) == ERROR_RAISE:
                     raise
@@ -681,7 +690,7 @@ def create_swap_file(self, device, size):
     def mk_dev_root(self):
         root = self.root_device
         dev = "%s/%s" % (get_sysroot(), root.path)
-        if not os.path.exists("%s/dev/root" %(get_sysroot(),)) and os.path.exists(dev):
+        if not os.path.exists("%s/dev/root" % (get_sysroot(),)) and os.path.exists(dev):
             rdev = os.stat(dev).st_rdev
             util.eintr_retry_call(os.mknod, "%s/dev/root" % (get_sysroot(),), stat.S_IFBLK | 0o600, rdev)
 
@@ -784,7 +793,7 @@ def mdadm_conf(self):
 
         return conf
 
-    def fstab (self):
+    def fstab(self):
         fmt_str = "%-23s %-23s %-7s %-15s %d %d\n"
         fstab = """
 #
@@ -897,8 +906,11 @@ def set_fstab_swaps(self, devices):
 
         self._fstab_swaps = set(devices)
 
+
 class Root(object):
+
     """ A Root represents an existing OS installation. """
+
     def __init__(self, mounts=None, swaps=None, name=None):
         """
             :keyword mounts: mountpoint dict
@@ -931,7 +943,9 @@ def device(self):
 
 
 class BlkidTab(object):
+
     """ Dictionary-like interface to blkid.tab with device path keys """
+
     def __init__(self, chroot=""):
         self.chroot = chroot
         self.devices = {}
@@ -959,7 +973,7 @@ def parse(self):
                     except ValueError:
                         continue
 
-                    self.devices[device][key] = value[1:-1] # strip off quotes
+                    self.devices[device][key] = value[1:-1]  # strip off quotes
 
     def __getitem__(self, key):
         return self.devices[key]
@@ -969,7 +983,9 @@ def get(self, key, default=None):
 
 
 class CryptTab(object):
+
     """ Dictionary-like interface to crypttab entries with map name keys """
+
     def __init__(self, devicetree, blkid_tab=None, chroot=""):
         self.devicetree = devicetree
         self.blkid_tab = blkid_tab
@@ -988,7 +1004,7 @@ def parse(self, chroot=""):
                 try:
                     self.blkid_tab = BlkidTab(chroot=chroot)
                     self.blkid_tab.parse()
-                except Exception: # pylint: disable=broad-except
+                except Exception:  # pylint: disable=broad-except
                     log_exception_info(fmt_str="failed to parse blkid.tab")
                     self.blkid_tab = None
 
@@ -1049,6 +1065,7 @@ def __getitem__(self, key):
     def get(self, key, default=None):
         return self.mappings.get(key, default)
 
+
 def get_containing_device(path, devicetree):
     """ Return the device that a path resides on. """
     if not os.path.exists(path):
@@ -1063,7 +1080,7 @@ def get_containing_device(path, devicetree):
 
     try:
         device_name = os.path.basename(os.readlink(link))
-    except Exception: # pylint: disable=broad-except
+    except Exception:  # pylint: disable=broad-except
         log_exception_info(fmt_str="failed to find device name for path %s", fmt_args=[path])
         return None
 
@@ -1073,6 +1090,7 @@ def get_containing_device(path, devicetree):
 
     return devicetree.get_device_by_name(device_name)
 
+
 def turn_on_filesystems(storage, mount_only=False, callbacks=None):
     """
     Perform installer-specific activation of storage configuration.
@@ -1107,6 +1125,7 @@ def turn_on_filesystems(storage, mount_only=False, callbacks=None):
     if not mount_only:
         write_escrow_packets(storage)
 
+
 def write_escrow_packets(storage):
     escrow_devices = [d for d in storage.devices if d.format.type == 'luks' and
                      d.format.escrow_cert]
@@ -1134,6 +1153,7 @@ def write_escrow_packets(storage):
 
     log.debug("escrow: write_escrow_packets done")
 
+
 def storage_initialize(storage, ksdata, protected):
     """ Perform installer-specific storage initialization. """
     from pyanaconda.flags import flags as anaconda_flags
@@ -1170,10 +1190,11 @@ def storage_initialize(storage, ksdata, protected):
     # kickstart uses all the disks
     if flags.automated_install:
         if not ksdata.ignoredisk.onlyuse:
-            ksdata.ignoredisk.onlyuse = [d.name for d in storage.disks \
+            ksdata.ignoredisk.onlyuse = [d.name for d in storage.disks
                                          if d.name not in ksdata.ignoredisk.ignoredisk]
             log.debug("onlyuse is now: %s", ",".join(ksdata.ignoredisk.onlyuse))
 
+
 def mount_existing_system(fsset, root_device, read_only=None):
     """ Mount filesystems specified in root_device's /etc/fstab file. """
     root_path = get_sysroot()
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 2153cd5..f9f5736 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -41,6 +41,7 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 def partition_compare(part1, part2):
     """ More specifically defined partitions come first.
 
@@ -114,6 +115,7 @@ def partition_compare(part1, part2):
 
 _partition_compare_key = functools.cmp_to_key(partition_compare)
 
+
 def get_next_partition_type(disk, no_primary=None):
     """ Return the type of partition to create next on a disk.
 
@@ -168,6 +170,7 @@ def get_next_partition_type(disk, no_primary=None):
 
     return part_type
 
+
 def get_best_free_space_region(disk, part_type, req_size, start=None,
                            boot=None, best_free=None, grow=None,
                            alignment=None):
@@ -285,6 +288,7 @@ def get_best_free_space_region(disk, part_type, req_size, start=None,
 
     return best_free
 
+
 def sectors_to_size(sectors, sector_size):
     """ Convert length in sectors to size.
 
@@ -297,6 +301,7 @@ def sectors_to_size(sectors, sector_size):
     """
     return Size(sectors * sector_size)
 
+
 def size_to_sectors(size, sector_size):
     """ Convert size to length in sectors.
 
@@ -309,6 +314,7 @@ def size_to_sectors(size, sector_size):
     """
     return int(size // sector_size)
 
+
 def remove_new_partitions(disks, remove, all_partitions):
     """ Remove newly added partitions from disks.
 
@@ -349,6 +355,7 @@ def remove_new_partitions(disks, remove, all_partitions):
             log.debug("removing empty extended partition from %s", disk.name)
             disk.format.parted_disk.removePartition(extended)
 
+
 def add_partition(disklabel, free, part_type, size, start=None, end=None):
     """ Add a new partition to a disk.
 
@@ -439,6 +446,7 @@ def add_partition(disklabel, free, part_type, size, start=None, end=None):
                                       constraint=constraint)
     return partition
 
+
 def get_free_regions(disks, align=False):
     """ Return a list of free regions on the specified disks.
 
@@ -467,6 +475,7 @@ def get_free_regions(disks, align=False):
 
     return free
 
+
 def update_extended_partitions(storage, disks):
     """ Reconcile extended partition changes with the DeviceTree.
 
@@ -521,6 +530,7 @@ def update_extended_partitions(storage, disks):
         # moment to simplify things
         storage.devicetree._add_device(device)
 
+
 def do_partitioning(storage):
     """ Allocate and grow partitions.
 
@@ -608,12 +618,14 @@ def do_partitioning(storage):
                                         % {"format": part.format.name, "min_size": part.format.min_size,
                                             "max_size": part.format.max_size})
 
+
 def align_size_for_disklabel(size, disklabel):
     # Align the base size to the disk's grain size.
     grain_size = Size(disklabel.alignment.grainSize)
     grains, rem = divmod(size, grain_size)
     return (grains * grain_size) + (grain_size if rem else Size(0))
 
+
 def allocate_partitions(storage, disks, partitions, freespace):
     """ Allocate partitions based on requested features.
 
@@ -763,7 +775,7 @@ def allocate_partitions(storage, disks, partitions, freespace):
 
             if best and free != best:
                 update = True
-                allocated = new_partitions[:new_partitions.index(_part)+1]
+                allocated = new_partitions[:new_partitions.index(_part) + 1]
                 if any([p.req_grow for p in allocated]):
                     log.debug("evaluating growth potential for new layout")
                     new_growth = 0
@@ -827,7 +839,7 @@ def allocate_partitions(storage, disks, partitions, freespace):
                                                temp_parts, freespace)
 
                         # grow all growable requests
-                        disk_growth = 0 # in sectors
+                        disk_growth = 0  # in sectors
                         disk_sector_size = Size(disklabels[disk_path].sector_size)
                         for chunk in chunks:
                             chunk.grow_requests()
@@ -943,11 +955,13 @@ def allocate_partitions(storage, disks, partitions, freespace):
 
 
 class Request(object):
+
     """ A partition request.
 
         Request instances are used for calculating how much to grow
         partitions.
     """
+
     def __init__(self, device):
         """
             :param device: the device being requested
@@ -990,6 +1004,7 @@ def __repr__(self):
 
 
 class PartitionRequest(Request):
+
     def __init__(self, partition):
         """
             :param partition: the partition being requested
@@ -1014,6 +1029,7 @@ def __init__(self, partition):
 
 
 class LVRequest(Request):
+
     def __init__(self, lv):
         """
             :param lv: the logical volume being requested
@@ -1046,8 +1062,11 @@ def reserve_request(self):
 
         return reserve
 
+
 class Chunk(object):
+
     """ A free region from which devices will be allocated """
+
     def __init__(self, length, requests=None):
         """
             :param length: the length of the chunk (units vary with subclass)
@@ -1217,7 +1236,7 @@ def grow_requests(self, uniform=False):
         # chunk's requests since we want the base to be the same for
         # all requests in any given growth iteration
         new_base = self.base
-        last_pool = 0 # used to track changes to the pool across iterations
+        last_pool = 0  # used to track changes to the pool across iterations
         while not self.done and self.pool and last_pool != self.pool:
             last_pool = self.pool    # to keep from getting stuck
             self.base = new_base
@@ -1235,7 +1254,7 @@ def grow_requests(self, uniform=False):
                     # based on the relative _base_ sizes of the remaining
                     # growable requests.
                     share = Decimal(p.base) / Decimal(self.base)
-                    growth = int(share * last_pool) # truncate, don't round
+                    growth = int(share * last_pool)  # truncate, don't round
 
                 p.growth += growth
                 self.pool -= growth
@@ -1278,7 +1297,9 @@ def grow_requests(self, uniform=False):
 
 
 class DiskChunk(Chunk):
+
     """ A free region on disk from which partitions will be allocated """
+
     def __init__(self, geometry, requests=None):
         """
             :param geometry: the free region this chunk represents
@@ -1406,7 +1427,9 @@ def sort_requests(self):
 
 
 class VGChunk(Chunk):
+
     """ A free region in an LVM VG from which LVs will be allocated """
+
     def __init__(self, vg, requests=None):
         """
             :param vg: the volume group whose free space this chunk represents
@@ -1443,7 +1466,9 @@ def sort_requests(self):
 
 
 class ThinPoolChunk(VGChunk):
+
     """ A free region in an LVM thin pool from which LVs will be allocated """
+
     def __init__(self, pool, requests=None):
         """
             :param pool: the thin pool whose free space this chunk represents
@@ -1454,7 +1479,8 @@ def __init__(self, pool, requests=None):
         self.vg = pool.vg   # only used for align, &c
         self.path = pool.path
         usable_extents = (pool.size / pool.vg.pe_size)
-        super(VGChunk, self).__init__(usable_extents, requests=requests) # pylint: disable=bad-super-call
+        super(VGChunk, self).__init__(usable_extents, requests=requests)  # pylint: disable=bad-super-call
+
 
 def get_disk_chunks(disk, partitions, free):
     """ Return a list of Chunk instances representing a disk.
@@ -1519,12 +1545,15 @@ def get_disk_chunks(disk, partitions, free):
 
     return chunks
 
+
 class TotalSizeSet(object):
+
     """ Set of device requests with a target combined size.
 
         This will be handled by growing the requests until the desired combined
         size has been achieved.
     """
+
     def __init__(self, devices, size):
         """
             :param devices: the set of devices
@@ -1562,8 +1591,11 @@ def deallocate(self, amount):
                     amount, self.allocated, self.size, self.needed)
         self.allocated -= amount
 
+
 class SameSizeSet(object):
+
     """ Set of device requests with a common target size. """
+
     def __init__(self, devices, size, grow=False, max_size=None):
         """
             :param devices: the set of devices
@@ -1590,6 +1622,7 @@ def __init__(self, devices, size, grow=False, max_size=None):
 
         self.requests = []
 
+
 def manage_size_sets(size_sets, chunks):
     growth_by_request = {}
     requests_by_device = {}
@@ -1673,6 +1706,7 @@ def manage_size_sets(size_sets, chunks):
             if reclaimed[chunk] and not chunk.done:
                 chunk.grow_requests()
 
+
 def grow_partitions(disks, partitions, free, size_sets=None):
     """ Grow all growable partition requests.
 
@@ -1891,6 +1925,7 @@ def lv_compare(lv1, lv2):
 
 _lv_compare_key = functools.cmp_to_key(lv_compare)
 
+
 def _apply_chunk_growth(chunk):
     """ grow the lvs by the amounts the VGChunk calculated """
     for req in chunk.requests:
@@ -1908,6 +1943,7 @@ def _apply_chunk_growth(chunk):
         # initial size.
         req.device.size = size
 
+
 def grow_lvm(storage):
     """ Grow LVs according to the sizes of the PVs.
 
diff --git a/blivet/partspec.py b/blivet/partspec.py
index 3fc00ce..7c5ad50 100644
--- a/blivet/partspec.py
+++ b/blivet/partspec.py
@@ -21,7 +21,9 @@
 
 from .util import stringize, unicodeize
 
+
 class PartSpec(object):
+
     def __init__(self, mountpoint=None, fstype=None, size=None, max_size=None,
                  grow=False, btr=False, lv=False, thin=False, weight=0,
                  required_space=0, encrypted=False):
diff --git a/blivet/platform.py b/blivet/platform.py
index 613a042..6d97138 100644
--- a/blivet/platform.py
+++ b/blivet/platform.py
@@ -31,7 +31,9 @@
 from .size import Size
 from .i18n import _, N_
 
+
 class Platform(object):
+
     """Platform
 
        A class containing platform-specific information and methods for use
@@ -148,7 +150,7 @@ def best_disklabel_type(self, device):
         return label_type
 
     @property
-    def packages (self):
+    def packages(self):
         _packages = self._packages
         if flags.boot_cmdline.get('fips', None) == '1':
             _packages.append('dracut-fips')
@@ -187,6 +189,7 @@ def stage1MissingError(self):
            selection fails."""
         return self._boot_stage1_missing_error
 
+
 class X86(Platform):
     _boot_stage1_device_types = ["disk"]
     _boot_mbr_description = N_("Master Boot Record")
@@ -219,6 +222,7 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return 0
 
+
 class EFI(Platform):
 
     _boot_stage1_format_types = ["efi"]
@@ -253,6 +257,7 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return 0
 
+
 class MacEFI(EFI):
     _boot_stage1_format_types = ["macefi"]
     _boot_efi_description = N_("Apple EFI Boot Partition")
@@ -266,9 +271,11 @@ def set_platform_bootloader_reqs(self):
                             grow=True, weight=self.weight(mountpoint="/boot/efi")))
         return ret
 
+
 class Aarch64EFI(EFI):
     _non_linux_format_types = ["vfat", "ntfs"]
 
+
 class PPC(Platform):
     _ppc_machine = arch.get_ppc_machine()
     _boot_stage1_device_types = ["partition"]
@@ -277,6 +284,7 @@ class PPC(Platform):
     def ppc_machine(self):
         return self._ppc_machine
 
+
 class IPSeriesPPC(PPC):
     _boot_stage1_format_types = ["prepboot"]
     _boot_stage1_max_end = Size("4 GiB")
@@ -302,6 +310,7 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return 0
 
+
 class NewWorldPPC(PPC):
     _boot_stage1_format_types = ["appleboot"]
     _boot_apple_description = N_("Apple Bootstrap Partition")
@@ -327,9 +336,11 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return 0
 
+
 class PS3(PPC):
     pass
 
+
 class S390(Platform):
     _packages = ["s390utils"]
     _disklabel_types = ["msdos", "dasd"]
@@ -359,6 +370,7 @@ def required_disklabel_type(self, device_type):
 
         return super(S390, self).required_disklabel_type(device_type)
 
+
 class ARM(Platform):
     _arm_machine = None
     _boot_stage1_device_types = ["disk"]
@@ -385,6 +397,7 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return Platform.weight(self, fstype=fstype, mountpoint=mountpoint)
 
+
 class omapARM(ARM):
     _boot_stage1_format_types = ["vfat"]
     _boot_stage1_device_types = ["partition"]
@@ -421,6 +434,7 @@ def weight(self, fstype=None, mountpoint=None):
         else:
             return Platform.weight(self, fstype=fstype, mountpoint=mountpoint)
 
+
 def get_platform():
     """Check the architecture of the system and return an instance of a
        Platform subclass to match.  If the architecture could not be determined,
diff --git a/blivet/populator.py b/blivet/populator.py
index 0d041fe..f08cdf6 100644
--- a/blivet/populator.py
+++ b/blivet/populator.py
@@ -59,6 +59,7 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 def parted_exn_handler(exn_type, exn_options, exn_msg):
     """ Answer any of parted's yes/no questions in the affirmative.
 
@@ -71,7 +72,9 @@ def parted_exn_handler(exn_type, exn_options, exn_msg):
         ret = parted.EXCEPTION_RESOLVE_YES
     return ret
 
+
 class Populator(object):
+
     def __init__(self, devicetree=None, conf=None, passphrase=None,
                  luks_dict=None, iscsi=None, dasd=None):
         """
@@ -409,7 +412,7 @@ def add_udev_partition_device(self, info, disk=None):
 
         if disk is None:
             disk_name = os.path.basename(os.path.dirname(sysfs_path))
-            disk_name = disk_name.replace('!','/')
+            disk_name = disk_name.replace('!', '/')
             if disk_name.startswith("md"):
                 disk_name = blockdev.md.name_from_node(disk_name)
 
@@ -485,7 +488,7 @@ def add_udev_disk_device(self, info):
         vendor = util.get_sysfs_attr(sysfs_path, "device/vendor")
         model = util.get_sysfs_attr(sysfs_path, "device/model")
 
-        kwargs = { "serial": serial, "vendor": vendor, "model": model, "bus": bus }
+        kwargs = {"serial": serial, "vendor": vendor, "model": model, "bus": bus}
         if udev.device_is_iscsi(info) and not self._cleanup:
             disk_type = iScsiDiskDevice
             initiator = udev.device_get_iscsi_initiator(info)
@@ -510,7 +513,7 @@ def add_udev_disk_device(self, info):
                 kwargs["fw_name"] = name
         elif udev.device_is_fcoe(info):
             disk_type = FcoeDiskDevice
-            kwargs["nic"]        = udev.device_get_fcoe_nic(info)
+            kwargs["nic"] = udev.device_get_fcoe_nic(info)
             kwargs["identifier"] = udev.device_get_fcoe_identifier(info)
             log.info("%s is an fcoe disk", name)
         elif udev.device_get_md_container(info):
@@ -535,10 +538,10 @@ def add_udev_disk_device(self, info):
                     return
 
             kwargs["parents"] = [container]
-            kwargs["level"]  = udev.device_get_md_level(info)
+            kwargs["level"] = udev.device_get_md_level(info)
             kwargs["member_devices"] = udev.device_get_md_devices(info)
             kwargs["uuid"] = udev.device_get_md_uuid(info)
-            kwargs["exists"]  = True
+            kwargs["exists"] = True
             del kwargs["model"]
             del kwargs["serial"]
             del kwargs["vendor"]
@@ -781,7 +784,7 @@ def handle_udev_disk_label_format(self, info, device):
 
         try:
             device.setup()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             log_exception_info(log.warning, "setup of %s failed, aborting disklabel handler", [device.name])
             return
 
@@ -997,7 +1000,7 @@ def add_lv(lv):
             lv_dev = self.get_device_by_uuid(lv_uuid)
             if lv_dev is None:
                 lv_device = lv_class(lv_name, parents=lv_parents,
-                                     uuid=lv_uuid, size=lv_size,seg_type=lv_type,
+                                     uuid=lv_uuid, size=lv_size, seg_type=lv_type,
                                      exists=True, **lv_kwargs)
                 self.devicetree._add_device(lv_device)
                 if flags.installer_mode:
@@ -1276,7 +1279,7 @@ def handle_udev_dmraid_member_format(self, info, device):
                 # device has the attribute to hold it.  But ATM we
                 # are not really using it. Commenting this out until
                 # we really need it.
-                #device.format.raidmem = block.getMemFromRaidSet(dm_array,
+                # device.format.raidmem = block.getMemFromRaidSet(dm_array,
                 #        major=major, minor=minor, uuid=uuid, name=name)
 
     def handle_btrfs_format(self, info, device):
diff --git a/blivet/size.py b/blivet/size.py
index 303f38e..b90066a 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -72,9 +72,10 @@
 _EMPTY_PREFIX = B
 
 if six.PY2:
-    _ASCIIlower_table = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) # pylint: disable=no-member
+    _ASCIIlower_table = string.maketrans(string.ascii_uppercase, string.ascii_lowercase)  # pylint: disable=no-member
 else:
-    _ASCIIlower_table = str.maketrans(string.ascii_uppercase, string.ascii_lowercase) # pylint: disable=no-member
+    _ASCIIlower_table = str.maketrans(string.ascii_uppercase, string.ascii_lowercase)  # pylint: disable=no-member
+
 
 def _lower_ascii(s):
     """Convert a string to lowercase using only ASCII character definitions.
@@ -90,7 +91,8 @@ def _lower_ascii(s):
     # out we expect this function to always return string even if given bytes.
     if not six.PY2 and isinstance(s, bytes):
         s = s.decode(sys.getdefaultencoding())
-    return s.translate(_ASCIIlower_table) # pylint: disable=no-member
+    return s.translate(_ASCIIlower_table)  # pylint: disable=no-member
+
 
 def _make_spec(prefix, suffix, xlate, lowercase=True):
     """ Synthesizes a whole word from prefix and suffix.
@@ -110,6 +112,7 @@ def _make_spec(prefix, suffix, xlate, lowercase=True):
         word = prefix + suffix
         return _lower_ascii(word) if lowercase else word
 
+
 def unit_str(unit, xlate=False):
     """ Return a string representation of unit.
 
@@ -120,6 +123,7 @@ def unit_str(unit, xlate=False):
     """
     return _make_spec(unit.abbr, _BYTES_SYMBOL, xlate, lowercase=False)
 
+
 def parse_units(spec, xlate):
     """ Parse a unit specification and return corresponding factor.
 
@@ -156,6 +160,7 @@ def parse_units(spec, xlate):
 
     return None
 
+
 def parse_spec(spec):
     """ Parse string representation of size.
 
@@ -241,7 +246,9 @@ def parse_spec(spec):
 
     raise ValueError("invalid size specification", spec)
 
+
 class Size(Decimal):
+
     """ Common class to represent storage device and filesystem sizes.
         Can handle parsing strings such as 45MB or 6.7GB to initialize
         itself, or can be initialized with a numerical size in bytes.
diff --git a/blivet/storage_log.py b/blivet/storage_log.py
index 6ee694c..fc5680b 100644
--- a/blivet/storage_log.py
+++ b/blivet/storage_log.py
@@ -6,6 +6,7 @@
 log = logging.getLogger("blivet")
 log.addHandler(logging.NullHandler())
 
+
 def function_name_and_depth():
     IGNORED_FUNCS = ["function_name_and_depth",
                      "log_method_call",
@@ -19,6 +20,7 @@ def function_name_and_depth():
 
     return ("unknown function?", 0)
 
+
 def log_method_call(d, *args, **kwargs):
     classname = d.__class__.__name__
     (methodname, depth) = function_name_and_depth()
@@ -38,6 +40,7 @@ def log_method_call(d, *args, **kwargs):
 
     log.debug(fmt, *fmt_args)
 
+
 def log_method_return(d, retval):
     classname = d.__class__.__name__
     (methodname, depth) = function_name_and_depth()
@@ -46,6 +49,7 @@ def log_method_return(d, retval):
     fmt_args = (spaces, classname, methodname, retval)
     log.debug(fmt, *fmt_args)
 
+
 def log_exception_info(log_func=log.debug, fmt_str=None, fmt_args=None, ignored=True):
     """Log detailed exception information.
 
diff --git a/blivet/tasks/availability.py b/blivet/tasks/availability.py
index fe356d8..61426c6 100644
--- a/blivet/tasks/availability.py
+++ b/blivet/tasks/availability.py
@@ -38,7 +38,9 @@
 
 CACHE_AVAILABILITY = True
 
+
 class ExternalResource(object):
+
     """ An external resource. """
 
     def __init__(self, method, name):
@@ -75,8 +77,10 @@ def available(self):
         """
         return self.availability_errors == []
 
+
 @add_metaclass(abc.ABCMeta)
 class Method(object):
+
     """ Method for determining if external resource is available."""
 
     @abc.abstractmethod
@@ -91,7 +95,9 @@ def availability_errors(self, resource):
         """
         raise NotImplementedError()
 
+
 class Path(Method):
+
     """ Methods for when application is found in  PATH. """
 
     def availability_errors(self, resource):
@@ -110,6 +116,7 @@ def availability_errors(self, resource):
 
 Path = Path()
 
+
 class PackageInfo(object):
 
     def __init__(self, package_name, required_version=None):
@@ -125,7 +132,9 @@ def __init__(self, package_name, required_version=None):
     def __str__(self):
         return "%s-%s" % (self.package_name, self.required_version)
 
+
 class PackageMethod(Method):
+
     """ Methods for checking the package version of the external resource. """
 
     def __init__(self, package=None):
@@ -180,7 +189,9 @@ def availability_errors(self, resource):
 
         return self._availability_errors[:]
 
+
 class BlockDevMethod(Method):
+
     """ Methods for when application is actually a libblockdev plugin. """
 
     def availability_errors(self, resource):
@@ -199,7 +210,9 @@ def availability_errors(self, resource):
 
 BlockDevMethod = BlockDevMethod()
 
+
 class UnavailableMethod(Method):
+
     """ Method that indicates a resource is unavailable. """
 
     def availability_errors(self, resource):
@@ -207,7 +220,9 @@ def availability_errors(self, resource):
 
 UnavailableMethod = UnavailableMethod()
 
+
 class AvailableMethod(Method):
+
     """ Method that indicates a resource is available. """
 
     def availability_errors(self, resource):
@@ -215,6 +230,7 @@ def availability_errors(self, resource):
 
 AvailableMethod = AvailableMethod()
 
+
 def application(name):
     """ Construct an external resource that is an application.
 
@@ -222,6 +238,7 @@ def application(name):
     """
     return ExternalResource(Path, name)
 
+
 def application_by_package(name, package_method):
     """ Construct an external resource that is an application.
 
@@ -232,14 +249,17 @@ def application_by_package(name, package_method):
     """
     return ExternalResource(package_method, name)
 
+
 def blockdev_plugin(name):
     """ Construct an external resource that is a libblockdev plugin. """
     return ExternalResource(BlockDevMethod, name)
 
+
 def unavailable_resource(name):
     """ Construct an external resource that is always unavailable. """
     return ExternalResource(UnavailableMethod, name)
 
+
 def available_resource(name):
     """ Construct an external resource that is always available. """
     return ExternalResource(AvailableMethod, name)
diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py
index f3d1946..f6ff393 100644
--- a/blivet/tasks/fsck.py
+++ b/blivet/tasks/fsck.py
@@ -32,8 +32,10 @@
 
 _UNKNOWN_RC_MSG = "Unknown return code: %d"
 
+
 @add_metaclass(abc.ABCMeta)
 class FSCK(task.BasicApplication, fstask.FSTask):
+
     """An abstract class that represents actions associated with
        checking consistency of a filesystem.
     """
@@ -118,6 +120,7 @@ def _error_message(self, rc):
         msgs = (self._fsck_errors[c] for c in self._fsck_errors.keys() if rc & c)
         return "\n".join(msgs) or None
 
+
 class HFSPlusFSCK(FSCK):
     _fsck_errors = {3: "Quick check found a dirty filesystem; no repairs done.",
                    4: "Root filesystem was dirty. System should be rebooted.",
@@ -134,6 +137,7 @@ def _error_message(self, rc):
         except KeyError:
             return _UNKNOWN_RC_MSG % rc
 
+
 class NTFSFSCK(FSCK):
     ext = availability.NTFSRESIZE_APP
     options = ["-c"]
@@ -141,5 +145,6 @@ class NTFSFSCK(FSCK):
     def _error_message(self, rc):
         return _UNKNOWN_RC_MSG % (rc,) if rc != 0 else None
 
+
 class UnimplementedFSCK(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/fsinfo.py b/blivet/tasks/fsinfo.py
index b89b726..33733dc 100644
--- a/blivet/tasks/fsinfo.py
+++ b/blivet/tasks/fsinfo.py
@@ -30,8 +30,10 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSInfo(task.BasicApplication, fstask.FSTask):
+
     """ An abstract class that represents an information gathering app. """
 
     description = "filesystem info"
@@ -70,25 +72,31 @@ def do_task(self):
             raise FSError(error_msg)
         return out
 
+
 class Ext2FSInfo(FSInfo):
     ext = availability.DUMPE2FS_APP
     options = ["-h"]
 
+
 class JFSInfo(FSInfo):
     ext = availability.JFSTUNE_APP
     options = ["-l"]
 
+
 class NTFSInfo(FSInfo):
     ext = availability.NTFSINFO_APP
     options = ["-m"]
 
+
 class ReiserFSInfo(FSInfo):
     ext = availability.DEBUGREISERFS_APP
     options = []
 
+
 class XFSInfo(FSInfo):
     ext = availability.XFSDB_APP
     options = ["-c", "sb 0", "-c", "p dblocks", "-c", "p blocksize"]
 
+
 class UnimplementedFSInfo(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/fslabeling.py b/blivet/tasks/fslabeling.py
index ed6a8ad..7179039 100644
--- a/blivet/tasks/fslabeling.py
+++ b/blivet/tasks/fslabeling.py
@@ -23,8 +23,10 @@
 
 from six import add_metaclass
 
+
 @add_metaclass(abc.ABCMeta)
 class FSLabeling(object):
+
     """An abstract class that represents filesystem labeling actions.
     """
 
@@ -41,6 +43,7 @@ def label_format_ok(self, label):
         """
         raise NotImplementedError
 
+
 class Ext2FSLabeling(FSLabeling):
 
     default_label = ""
@@ -49,6 +52,7 @@ class Ext2FSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return len(label) < 17
 
+
 class FATFSLabeling(FSLabeling):
 
     default_label = "NO NAME"
@@ -57,6 +61,7 @@ class FATFSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return len(label) < 12
 
+
 class JFSLabeling(FSLabeling):
 
     default_label = ""
@@ -65,6 +70,7 @@ class JFSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return len(label) < 17
 
+
 class ReiserFSLabeling(FSLabeling):
 
     default_label = ""
@@ -73,6 +79,7 @@ class ReiserFSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return len(label) < 17
 
+
 class XFSLabeling(FSLabeling):
 
     default_label = ""
@@ -81,6 +88,7 @@ class XFSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return ' ' not in label and len(label) < 13
 
+
 class HFSLabeling(FSLabeling):
 
     default_label = "Untitled"
@@ -89,6 +97,7 @@ class HFSLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return ':' not in label and len(label) < 28 and len(label) > 0
 
+
 class HFSPlusLabeling(FSLabeling):
 
     default_label = "Untitled"
@@ -97,6 +106,7 @@ class HFSPlusLabeling(FSLabeling):
     def label_format_ok(cls, label):
         return ':' not in label and 0 < len(label) < 129
 
+
 class NTFSLabeling(FSLabeling):
 
     default_label = ""
diff --git a/blivet/tasks/fsminsize.py b/blivet/tasks/fsminsize.py
index 3028764..ab6c647 100644
--- a/blivet/tasks/fsminsize.py
+++ b/blivet/tasks/fsminsize.py
@@ -31,8 +31,10 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSMinSize(task.BasicApplication, fstask.FSTask):
+
     """ An abstract class that represents min size information extraction. """
 
     description = "minimum filesystem size"
@@ -70,6 +72,7 @@ def do_task(self):
         """
         raise NotImplementedError()
 
+
 class Ext2FSMinSize(FSMinSize):
 
     ext = availability.RESIZE2FS_APP
@@ -134,6 +137,7 @@ def do_task(self):
 
         return block_size * num_blocks
 
+
 class NTFSMinSize(FSMinSize):
 
     ext = availability.NTFSRESIZE_APP
@@ -159,7 +163,6 @@ def _extract_min_size(self, info):
 
         return min_size
 
-
     def do_task(self):
         error_msgs = self.availability_errors
         if error_msgs:
@@ -171,5 +174,6 @@ def do_task(self):
             raise FSError("Unable to discover minimum size of filesystem on %s" % self.fs.device)
         return min_size
 
+
 class UnimplementedFSMinSize(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py
index 2a281c1..078c226 100644
--- a/blivet/tasks/fsmkfs.py
+++ b/blivet/tasks/fsmkfs.py
@@ -31,13 +31,16 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSMkfsTask(fstask.FSTask):
 
     can_label = abc.abstractproperty(doc="whether this task labels")
 
+
 @add_metaclass(abc.ABCMeta)
 class FSMkfs(task.BasicApplication, FSMkfsTask):
+
     """An abstract class that represents filesystem creation actions. """
     description = "mkfs"
 
@@ -125,6 +128,7 @@ def do_task(self, options=None, label=False):
         if ret:
             raise FSError("format failed: %s" % ret)
 
+
 class BTRFSMkfs(FSMkfs):
     ext = availability.MKFS_BTRFS_APP
     label_option = None
@@ -133,6 +137,7 @@ class BTRFSMkfs(FSMkfs):
     def args(self):
         return []
 
+
 class Ext2FSMkfs(FSMkfs):
     ext = availability.MKE2FS_APP
     label_option = "-L"
@@ -143,12 +148,15 @@ class Ext2FSMkfs(FSMkfs):
     def args(self):
         return self._opts + (["-T", self.fs.fsprofile] if self.fs.fsprofile else [])
 
+
 class Ext3FSMkfs(Ext2FSMkfs):
     _opts = ["-t", "ext3"]
 
+
 class Ext4FSMkfs(Ext3FSMkfs):
     _opts = ["-t", "ext4"]
 
+
 class FATFSMkfs(FSMkfs):
     ext = availability.MKDOSFS_APP
     label_option = "-n"
@@ -157,6 +165,7 @@ class FATFSMkfs(FSMkfs):
     def args(self):
         return []
 
+
 class GFS2Mkfs(FSMkfs):
     ext = availability.MKFS_GFS2_APP
     label_option = None
@@ -165,6 +174,7 @@ class GFS2Mkfs(FSMkfs):
     def args(self):
         return ["-j", "1", "-p", "lock_nolock", "-O"]
 
+
 class HFSMkfs(FSMkfs):
     ext = availability.HFORMAT_APP
     label_option = "-l"
@@ -173,6 +183,7 @@ class HFSMkfs(FSMkfs):
     def args(self):
         return []
 
+
 class HFSPlusMkfs(FSMkfs):
     ext = availability.MKFS_HFSPLUS_APP
     label_option = "-v"
@@ -181,6 +192,7 @@ class HFSPlusMkfs(FSMkfs):
     def args(self):
         return []
 
+
 class JFSMkfs(FSMkfs):
     ext = availability.MKFS_JFS_APP
     label_option = "-L"
@@ -189,6 +201,7 @@ class JFSMkfs(FSMkfs):
     def args(self):
         return ["-q"]
 
+
 class NTFSMkfs(FSMkfs):
     ext = availability.MKNTFS_APP
     label_option = "-L"
@@ -197,6 +210,7 @@ class NTFSMkfs(FSMkfs):
     def args(self):
         return []
 
+
 class ReiserFSMkfs(FSMkfs):
     ext = availability.MKREISERFS_APP
     label_option = "-l"
@@ -205,6 +219,7 @@ class ReiserFSMkfs(FSMkfs):
     def args(self):
         return ["-f", "-f"]
 
+
 class XFSMkfs(FSMkfs):
     ext = availability.MKFS_XFS_APP
     label_option = "-L"
@@ -213,6 +228,7 @@ class XFSMkfs(FSMkfs):
     def args(self):
         return ["-f"]
 
+
 class UnimplementedFSMkfs(task.UnimplementedTask, FSMkfsTask):
 
     @property
diff --git a/blivet/tasks/fsmount.py b/blivet/tasks/fsmount.py
index 90bb3c7..aa175f3 100644
--- a/blivet/tasks/fsmount.py
+++ b/blivet/tasks/fsmount.py
@@ -30,7 +30,9 @@
 from . import fstask
 from . import task
 
+
 class FSMount(task.BasicApplication, fstask.FSTask):
+
     """An abstract class that represents filesystem mounting actions. """
     description = "mount a filesystem"
 
@@ -122,9 +124,11 @@ def do_task(self, mountpoint, options=None):
         if rc:
             raise FSError("mount failed: %s" % rc)
 
+
 class AppleBootstrapFSMount(FSMount):
     fstype = "hfs"
 
+
 class BindFSMount(FSMount):
 
     @property
@@ -138,35 +142,44 @@ def _availability_errors(self):
     def _modify_options(self, options):
         return ",".join(["bind", options])
 
+
 class DevPtsFSMount(FSMount):
     options = ["gid=5", "mode=620"]
 
+
 class FATFSMount(FSMount):
     options = ["umask=0077", "shortname=winnt"]
 
+
 class EFIFSMount(FATFSMount):
     fstype = "vfat"
 
+
 class HFSPlusMount(FSMount):
     fstype = "hfsplus"
 
+
 class Iso9660FSMount(FSMount):
     options = ["ro"]
 
+
 class NoDevFSMount(FSMount):
 
     @property
     def mount_type(self):
         return self.fs.device
 
+
 class NFSMount(FSMount):
 
     def _availability_errors(self):
         return ["nfs filesystem can't be mounted"]
 
+
 class NTFSMount(FSMount):
     options = ["default", "ro"]
 
+
 class SELinuxFSMount(NoDevFSMount):
 
     @property
@@ -176,6 +189,7 @@ def _availability_errors(self):
             errors.append("selinux not enabled")
         return errors
 
+
 class TmpFSMount(NoDevFSMount):
 
     def _modify_options(self, options):
diff --git a/blivet/tasks/fsreadlabel.py b/blivet/tasks/fsreadlabel.py
index 58350f7..3b24213 100644
--- a/blivet/tasks/fsreadlabel.py
+++ b/blivet/tasks/fsreadlabel.py
@@ -31,8 +31,10 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSReadLabel(task.BasicApplication, fstask.FSTask):
+
     """ An abstract class that represents reading a filesystem's label. """
     description = "read filesystem label"
 
@@ -85,6 +87,7 @@ def do_task(self):
 
         return label if label == "" else self._extract_label(label)
 
+
 class DosFSReadLabel(FSReadLabel):
     ext = availability.DOSFSLABEL_APP
     label_regex = r'(?P<label>.*)'
@@ -93,6 +96,7 @@ class DosFSReadLabel(FSReadLabel):
     def args(self):
         return [self.fs.device]
 
+
 class Ext2FSReadLabel(FSReadLabel):
     ext = availability.E2LABEL_APP
     label_regex = r'(?P<label>.*)'
@@ -101,6 +105,7 @@ class Ext2FSReadLabel(FSReadLabel):
     def args(self):
         return [self.fs.device]
 
+
 class NTFSReadLabel(FSReadLabel):
     ext = availability.NTFSLABEL_APP
     label_regex = r'(?P<label>.*)'
@@ -109,6 +114,7 @@ class NTFSReadLabel(FSReadLabel):
     def args(self):
         return [self.fs.device]
 
+
 class XFSReadLabel(FSReadLabel):
     ext = availability.XFSADMIN_APP
     label_regex = r'label = "(?P<label>.*)"'
@@ -117,5 +123,6 @@ class XFSReadLabel(FSReadLabel):
     def args(self):
         return ["-l", self.fs.device]
 
+
 class UnimplementedFSReadLabel(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/fsresize.py b/blivet/tasks/fsresize.py
index 89e6e15..a56cf26 100644
--- a/blivet/tasks/fsresize.py
+++ b/blivet/tasks/fsresize.py
@@ -31,15 +31,19 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSResizeTask(fstask.FSTask):
+
     """ The abstract properties that any resize task must have. """
 
     unit = abc.abstractproperty(doc="Resize unit.")
     size_fmt = abc.abstractproperty(doc="Size format string.")
 
+
 @add_metaclass(abc.ABCMeta)
 class FSResize(task.BasicApplication, FSResizeTask):
+
     """ An abstract class for resizing a filesystem. """
 
     description = "resize filesystem"
@@ -76,6 +80,7 @@ def do_task(self):
         if ret:
             raise FSError("resize failed: %s" % ret)
 
+
 class Ext2FSResize(FSResize):
     ext = availability.RESIZE2FS_APP
     unit = MiB
@@ -93,6 +98,7 @@ def size_spec(self):
     def args(self):
         return ["-p", self.fs.device, self.size_spec()]
 
+
 class NTFSResize(FSResize):
     ext = availability.NTFSRESIZE_APP
     unit = B
@@ -104,11 +110,12 @@ def size_spec(self):
     @property
     def args(self):
         return [
-           "-ff", # need at least two 'f's to fully suppress interaction
+           "-ff",  # need at least two 'f's to fully suppress interaction
            "-s", self.size_spec(),
            self.fs.device
         ]
 
+
 class TmpFSResize(FSResize):
 
     ext = availability.MOUNT_APP
@@ -127,6 +134,7 @@ def args(self):
         options = ("remount", opts, self.size_spec())
         return ['-o', ",".join(options), self.fs._type, self.fs.system_mountpoint]
 
+
 class UnimplementedFSResize(task.UnimplementedTask, FSResizeTask):
 
     @property
diff --git a/blivet/tasks/fssize.py b/blivet/tasks/fssize.py
index 71057f0..7e08403 100644
--- a/blivet/tasks/fssize.py
+++ b/blivet/tasks/fssize.py
@@ -35,8 +35,10 @@
 _tags = ("count", "size")
 _Tags = namedtuple("_Tags", _tags)
 
+
 @add_metaclass(abc.ABCMeta)
 class FSSize(fstask.FSTask):
+
     """ An abstract class that represents size information extraction. """
     description = "current filesystem size"
 
@@ -100,21 +102,27 @@ def do_task(self):
 
         return values["count"] * Size(values["size"])
 
+
 class Ext2FSSize(FSSize):
     tags = _Tags(size="Block size:", count="Block count:")
 
+
 class JFSSize(FSSize):
     tags = _Tags(size="Physical block size:", count="Aggregate size:")
 
+
 class NTFSSize(FSSize):
     tags = _Tags(size="Cluster Size:", count="Volume Size in Clusters:")
 
+
 class ReiserFSSize(FSSize):
     tags = _Tags(size="Blocksize:", count="Count of blocks on the device:")
 
+
 class XFSSize(FSSize):
     tags = _Tags(size="blocksize =", count="dblocks =")
 
+
 class TmpFSSize(task.BasicApplication, fstask.FSTask):
     description = "current filesystem size"
 
diff --git a/blivet/tasks/fssync.py b/blivet/tasks/fssync.py
index 33e2113..a15c8e1 100644
--- a/blivet/tasks/fssync.py
+++ b/blivet/tasks/fssync.py
@@ -30,8 +30,10 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSSync(task.BasicApplication, fstask.FSTask):
+
     """ An abstract class that represents syncing a filesystem. """
 
     description = "filesystem syncing"
@@ -40,7 +42,9 @@ class FSSync(task.BasicApplication, fstask.FSTask):
     def do_task(self):
         raise NotImplementedError()
 
+
 class XFSSync(FSSync):
+
     """ Sync application for XFS. """
 
     ext = availability.XFSFREEZE_APP
@@ -73,5 +77,6 @@ def do_task(self, root="/"):
         if error_msg:
             raise FSError(error_msg)
 
+
 class UnimplementedFSSync(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/fstask.py b/blivet/tasks/fstask.py
index 46dc3d6..09a5e23 100644
--- a/blivet/tasks/fstask.py
+++ b/blivet/tasks/fstask.py
@@ -25,8 +25,10 @@
 
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSTask(task.Task):
+
     """ An abstract class that encapsulates the fact that all FSTasks
         have a single master object: the filesystem that they belong to.
     """
@@ -39,7 +41,9 @@ def __init__(self, an_fs):
         """
         self.fs = an_fs
 
+
 class UnimplementedFSTask(FSTask, task.UnimplementedTask):
+
     """ A convenience class for unimplemented filesystem tasks.
         Useful in the usual case where an Unimplemented task has
         no special methods that it is required to implement.
diff --git a/blivet/tasks/fswritelabel.py b/blivet/tasks/fswritelabel.py
index 4bfc285..a598156 100644
--- a/blivet/tasks/fswritelabel.py
+++ b/blivet/tasks/fswritelabel.py
@@ -30,8 +30,10 @@
 from . import fstask
 from . import task
 
+
 @add_metaclass(abc.ABCMeta)
 class FSWriteLabel(task.BasicApplication, fstask.FSTask):
+
     """ An abstract class that represents writing a label for a filesystem. """
 
     description = "write filesystem label"
@@ -58,6 +60,7 @@ def do_task(self):
         if rc:
             raise FSWriteLabelError("label failed")
 
+
 class DosFSWriteLabel(FSWriteLabel):
     ext = availability.DOSFSLABEL_APP
 
@@ -65,6 +68,7 @@ class DosFSWriteLabel(FSWriteLabel):
     def args(self):
         return [self.fs.device, self.fs.label]
 
+
 class Ext2FSWriteLabel(FSWriteLabel):
     ext = availability.E2LABEL_APP
 
@@ -72,6 +76,7 @@ class Ext2FSWriteLabel(FSWriteLabel):
     def args(self):
         return [self.fs.device, self.fs.label]
 
+
 class JFSWriteLabel(FSWriteLabel):
     ext = availability.JFSTUNE_APP
 
@@ -79,6 +84,7 @@ class JFSWriteLabel(FSWriteLabel):
     def args(self):
         return ["-L", self.fs.label, self.fs.device]
 
+
 class NTFSWriteLabel(FSWriteLabel):
     ext = availability.NTFSLABEL_APP
 
@@ -86,6 +92,7 @@ class NTFSWriteLabel(FSWriteLabel):
     def args(self):
         return [self.fs.device, self.fs.label]
 
+
 class ReiserFSWriteLabel(FSWriteLabel):
     ext = availability.REISERFSTUNE_APP
 
@@ -93,6 +100,7 @@ class ReiserFSWriteLabel(FSWriteLabel):
     def args(self):
         return ["-l", self.fs.label, self.fs.device]
 
+
 class XFSWriteLabel(FSWriteLabel):
     ext = availability.XFSADMIN_APP
 
@@ -100,5 +108,6 @@ class XFSWriteLabel(FSWriteLabel):
     def args(self):
         return ["-L", self.fs.label if self.fs.label != "" else "--", self.fs.device]
 
+
 class UnimplementedFSWriteLabel(fstask.UnimplementedFSTask):
     pass
diff --git a/blivet/tasks/task.py b/blivet/tasks/task.py
index ae41542..d5a4192 100644
--- a/blivet/tasks/task.py
+++ b/blivet/tasks/task.py
@@ -23,8 +23,10 @@
 
 from six import add_metaclass
 
+
 @add_metaclass(abc.ABCMeta)
 class Task(object):
+
     """ An abstract class that represents some task. """
 
     # Whether or not the functionality is implemented in the task class.
@@ -59,7 +61,9 @@ def do_task(self, *args, **kwargs):
         """ Do the task for this class. """
         raise NotImplementedError()
 
+
 class UnimplementedTask(Task):
+
     """ A null Task, which returns a negative or empty for all properties."""
 
     description = "an unimplemented task"
@@ -77,8 +81,10 @@ def __str__(self):
     def do_task(self, *args, **kwargs):
         raise NotImplementedError()
 
+
 @add_metaclass(abc.ABCMeta)
 class BasicApplication(Task):
+
     """ A task representing an application. """
 
     ext = abc.abstractproperty(doc="The object representing the external resource.")
diff --git a/blivet/tsort.py b/blivet/tsort.py
index fa53133..e668d7a 100644
--- a/blivet/tsort.py
+++ b/blivet/tsort.py
@@ -20,9 +20,11 @@
 # Red Hat Author(s): Dave Lehman <dlehman at redhat.com>
 #
 
+
 class CyclicGraphError(Exception):
     pass
 
+
 def tsort(graph):
     order = []  # sorted list of items
 
@@ -54,9 +56,9 @@ def tsort(graph):
     if len(graph['items']) != len(visited):
         raise CyclicGraphError("graph contains cycles")
 
-
     return order
 
+
 def create_graph(items, edges):
     """ Create a graph based on a list of items and a list of edges.
 
@@ -89,6 +91,7 @@ def create_graph(items, edges):
 
     return graph
 
+
 def main():
     items = [5, 2, 3, 4, 1]
     edges = [(1, 2), (2, 4), (4, 5), (3, 2)]
diff --git a/blivet/udev.py b/blivet/udev.py
index af89835..c6854ec 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -39,6 +39,7 @@
 INSTALLER_BLACKLIST = (r'^mtd', r'^mmcblk.+boot', r'^mmcblk.+rpmb', r'^zram')
 """ device name regexes to ignore when flags.installer_mode is True """
 
+
 def get_device(sysfs_path):
     try:
         dev = pyudev.Device.from_sys_path(global_udev, sysfs_path)
@@ -48,11 +49,13 @@ def get_device(sysfs_path):
 
     return dev
 
+
 def get_devices(subsystem="block"):
     settle()
     return [d for d in global_udev.list_devices(subsystem=subsystem)
                         if not __is_blacklisted_blockdev(d.sys_name)]
 
+
 def settle(quiet=False):
     """ Wait for the udev queue to settle.
 
@@ -67,6 +70,7 @@ def settle(quiet=False):
     else:
         util.run_program(argv)
 
+
 def trigger(subsystem=None, action="add", name=None):
     argv = ["trigger", "--action=%s" % action]
     if subsystem:
@@ -77,6 +81,7 @@ def trigger(subsystem=None, action="add", name=None):
     util.run_program(["udevadm"] + argv)
     settle()
 
+
 def resolve_devspec(devspec, sysname=False):
     if not devspec:
         return None
@@ -112,6 +117,7 @@ def resolve_devspec(devspec, sysname=False):
     if ret:
         return ret.sys_name if sysname else device_get_name(ret)
 
+
 def resolve_glob(glob):
     import fnmatch
     ret = []
@@ -131,6 +137,7 @@ def resolve_glob(glob):
 
     return ret
 
+
 def __is_blacklisted_blockdev(dev_name):
     """Is this a blockdev we never want for an install?"""
     if dev_name.startswith("ram") or dev_name.startswith("fd"):
@@ -140,8 +147,8 @@ def __is_blacklisted_blockdev(dev_name):
         if any(re.search(expr, dev_name) for expr in INSTALLER_BLACKLIST):
             return True
 
-    if os.path.exists("/sys/class/block/%s/device/model" %(dev_name,)):
-        model = open("/sys/class/block/%s/device/model" %(dev_name,)).read()
+    if os.path.exists("/sys/class/block/%s/device/model" % (dev_name,)):
+        model = open("/sys/class/block/%s/device/model" % (dev_name,)).read()
         for bad in ("IBM *STMF KERNEL", "SCEI Flash-5", "DGC LUNZ"):
             if model.find(bad) != -1:
                 log.info("ignoring %s with model %s", dev_name, model)
@@ -151,6 +158,8 @@ def __is_blacklisted_blockdev(dev_name):
 
 # These are functions for retrieving specific pieces of information from
 # udev database entries.
+
+
 def device_get_name(udev_info):
     """ Return the best name for a device based on the udev db data. """
     if "DM_NAME" in udev_info:
@@ -163,10 +172,12 @@ def device_get_name(udev_info):
 
     return name
 
+
 def device_get_format(udev_info):
     """ Return a device's format type as reported by udev. """
     return udev_info.get("ID_FS_TYPE")
 
+
 def device_get_uuid(udev_info):
     """ Get the UUID from the device's format as reported by udev.
 
@@ -176,19 +187,23 @@ def device_get_uuid(udev_info):
     """
     return udev_info.get("ID_FS_UUID")
 
+
 def device_get_label(udev_info):
     """ Get the label from the device's format as reported by udev. """
     return udev_info.get("ID_FS_LABEL")
 
+
 def device_get_part_size(udev_info):
     """ Get size for specified partition as reported by udev. """
     return udev_info.get("ID_PART_ENTRY_SIZE")
 
+
 def device_is_dm(info):
     """ Return True if the device is a device-mapper device. """
     dm_dir = os.path.join(device_get_sysfs_path(info), "dm")
     return 'DM_NAME' in info or os.path.exists(dm_dir)
 
+
 def device_is_md(info):
     """ Return True if the device is a mdraid array device. """
     # Don't identify partitions on mdraid arrays as raid arrays
@@ -200,15 +215,18 @@ def device_is_md(info):
     md_dir = device_get_sysfs_path(info) + "/md"
     return os.path.exists(md_dir)
 
+
 def device_is_cciss(info):
     """ Return True if the device is a CCISS device. """
     return device_get_name(info).startswith("cciss")
 
+
 def device_is_dasd(info):
     """ Return True if the device is a dasd device. """
     devname = info.get("DEVNAME", '').split("/")[-1]
     return devname.startswith("dasd")
 
+
 def device_is_zfcp(info):
     """ Return True if the device is a zfcp device. """
     if info.get("DEVTYPE") != "disk":
@@ -236,6 +254,7 @@ def device_is_zfcp(info):
 
     return False
 
+
 def device_get_zfcp_attribute(info, attr=None):
     """ Return the value of the specified attribute of the zfcp device. """
     if not attr:
@@ -251,10 +270,12 @@ def device_get_zfcp_attribute(info, attr=None):
 
     return open(attribute, "r").read().strip()
 
+
 def device_get_dasd_bus_id(info):
     """ Return the CCW bus ID of the dasd device. """
     return device_get_sysfs_path(info).split("/")[-3]
 
+
 def device_get_dasd_flag(info, flag=None):
     """ Return the specified flag for the dasd device. """
     if flag is None:
@@ -266,12 +287,14 @@ def device_get_dasd_flag(info, flag=None):
 
     return open(path, 'r').read().strip()
 
+
 def device_is_cdrom(info):
     """ Return True if the device is an optical drive. """
     # FIXME: how can we differentiate USB drives from CD-ROM drives?
     #         -- USB drives also generate a sd_x device.
     return info.get("ID_CDROM") == "1"
 
+
 def device_is_disk(info):
     """ Return True is the device is a disk. """
     if device_is_cdrom(info):
@@ -279,40 +302,49 @@ def device_is_disk(info):
     has_range = os.path.exists("%s/range" % device_get_sysfs_path(info))
     return info.get("DEVTYPE") == "disk" or has_range
 
+
 def device_is_partition(info):
     has_start = os.path.exists("%s/start" % device_get_sysfs_path(info))
     return info.get("DEVTYPE") == "partition" or has_start
 
+
 def device_is_loop(info):
     """ Return True if the device is a configured loop device. """
     return (device_get_name(info).startswith("loop") and
             os.path.isdir("%s/loop" % device_get_sysfs_path(info)))
 
+
 def device_get_serial(udev_info):
     """ Get the serial number/UUID from the device as reported by udev. """
     return udev_info.get("ID_SERIAL_RAW", udev_info.get("ID_SERIAL", udev_info.get("ID_SERIAL_SHORT")))
 
+
 def device_get_wwid(udev_info):
     """ The WWID of a device is typically just its serial number, but with
         colons in the name to make it more readable. """
     serial = device_get_serial(udev_info)
     return util.insert_colons(serial) if serial else ""
 
+
 def device_get_vendor(udev_info):
     """ Get the vendor of the device as reported by udev. """
     return udev_info.get("ID_VENDOR_FROM_DATABASE", udev_info.get("ID_VENDOR"))
 
+
 def device_get_model(udev_info):
     """ Get the model of the device as reported by udev. """
     return udev_info.get("ID_MODEL_FROM_DATABASE", udev_info.get("ID_MODEL"))
 
+
 def device_get_bus(udev_info):
     """ Get the bus a device is connected to the system by. """
     return udev_info.get("ID_BUS", "").upper()
 
+
 def device_get_path(info):
     return info["ID_PATH"]
 
+
 def device_get_symlinks(info):
     """ Get an array of symbolic links for a device.
 
@@ -322,6 +354,7 @@ def device_get_symlinks(info):
     """
     return info.get("DEVLINKS", "").split()
 
+
 def device_get_by_path(info):
     for link in device_get_symlinks(info):
         if link.startswith('/dev/disk/by-path/'):
@@ -329,18 +362,23 @@ def device_get_by_path(info):
 
     return device_get_name(info)
 
+
 def device_get_sysfs_path(info):
     return info.sys_path
 
+
 def device_get_major(info):
     return int(info["MAJOR"])
 
+
 def device_get_minor(info):
     return int(info["MINOR"])
 
+
 def device_get_devname(info):
     return info.get('DEVNAME')
 
+
 def device_get_md_level(info):
     """ Returns the RAID level of the array of which this device is a member.
 
@@ -353,6 +391,7 @@ def device_get_md_level(info):
     #  * mdraid/mdadm (all numeric metadata versions and container default)
     return info.get("MD_LEVEL")
 
+
 def device_get_md_devices(info):
     """ Returns the number of active devices in this device's array.
 
@@ -368,6 +407,7 @@ def device_get_md_devices(info):
     #  * mdraid/mdadm (all numeric metadata versions and container default)
     return int(info["MD_DEVICES"])
 
+
 def device_get_md_uuid(info):
     """ Returns the uuid of the array of which this device is a member.
 
@@ -381,6 +421,7 @@ def device_get_md_uuid(info):
     #  * mdraid/mdadm (all numeric metadata versions and container default)
     return util.canonicalize_UUID(info["MD_UUID"])
 
+
 def device_get_md_container(info):
     """
         :param dict info: dictionary of name-value pairs as strings
@@ -390,6 +431,7 @@ def device_get_md_container(info):
     #  * None
     return info.get("MD_CONTAINER")
 
+
 def device_get_md_name(info):
     """ Returns the name of the array of which this device is a member.
 
@@ -402,6 +444,7 @@ def device_get_md_name(info):
     #  * No known metadata versions for mdraid/mdadm
     return info.get("MD_DEVNAME")
 
+
 def device_get_md_metadata(info):
     """ Return the metadata version number.
 
@@ -414,6 +457,7 @@ def device_get_md_metadata(info):
     #  * mdraid/mdadm (not version numbers < 1)
     return info.get("MD_METADATA")
 
+
 def device_get_md_device_uuid(info):
     """ Returns the uuid of a device which is a member of an md array.
 
@@ -429,55 +473,71 @@ def device_get_md_device_uuid(info):
     md_device_uuid = info.get('ID_FS_UUID_SUB') or info.get('MD_DEV_UUID')
     return util.canonicalize_UUID(md_device_uuid) if md_device_uuid else None
 
+
 def device_get_vg_name(info):
     return info['LVM2_VG_NAME']
 
+
 def device_get_lv_vg_name(info):
     return info['DM_VG_NAME']
 
+
 def device_get_vg_uuid(info):
     return info['LVM2_VG_UUID']
 
+
 def device_get_vg_size(info):
     # lvm's decmial precision is not configurable, so we tell it to use
     # KB.
     return Size("%s KiB" % info['LVM2_VG_SIZE'])
 
+
 def device_get_vg_free(info):
     # lvm's decmial precision is not configurable, so we tell it to use
     # KB.
     return Size("%s KiB" % info['LVM2_VG_FREE'])
 
+
 def device_get_vg_extent_size(info):
     return Size("%s KiB" % info['LVM2_VG_EXTENT_SIZE'])
 
+
 def device_get_vg_extent_count(info):
     return int(info['LVM2_VG_EXTENT_COUNT'])
 
+
 def device_get_vg_free_extents(info):
     return int(info['LVM2_VG_FREE_COUNT'])
 
+
 def device_get_vg_pv_count(info):
     return int(info['LVM2_PV_COUNT'])
 
+
 def device_get_pv_pe_start(info):
     return Size("%s KiB" % info['LVM2_PE_START'])
 
+
 def device_get_lv_name(info):
     return info['LVM2_LV_NAME']
 
+
 def device_get_lv_uuid(info):
     return info['LVM2_LV_UUID']
 
+
 def device_get_lv_size(info):
     return Size("%s KiB" % info['LVM2_LV_SIZE'])
 
+
 def device_get_lv_attr(info):
     return info['LVM2_LV_ATTR']
 
+
 def device_get_lv_type(info):
     return info['LVM2_SEGTYPE']
 
+
 def device_dm_subsystem_match(info, subsystem):
     """ Return True if the device matches a given device-mapper subsystem. """
     uuid = info.get("DM_UUID", "")
@@ -493,14 +553,17 @@ def device_dm_subsystem_match(info, subsystem):
 
     return _subsystem.lower() == subsystem.lower()
 
+
 def device_is_dm_lvm(info):
     """ Return True if the device is an LVM logical volume. """
     return device_dm_subsystem_match(info, "lvm")
 
+
 def device_is_dm_crypt(info):
     """ Return True if the device is a mapped dm-crypt device. """
     return device_dm_subsystem_match(info, "crypt")
 
+
 def device_is_dm_luks(info):
     """ Return True if the device is a mapped LUKS device. """
     is_crypt = device_dm_subsystem_match(info, "crypt")
@@ -511,24 +574,29 @@ def device_is_dm_luks(info):
 
     return is_crypt and _type.startswith("luks")
 
+
 def device_is_dm_raid(info):
     """ Return True if the device is a dmraid array device. """
     return device_dm_subsystem_match(info, "dmraid")
 
+
 def device_is_dm_mpath(info):
     """ Return True if the device is a multipath device. """
     return device_dm_subsystem_match(info, "mpath")
 
+
 def device_is_dm_anaconda(info):
     """ Return True if the device is an anaconda disk image. """
     return device_dm_subsystem_match(info, "anaconda")
 
+
 def device_is_dm_livecd(info):
     """ Return True if the device is a livecd OS image. """
     # return device_dm_subsystem_match(info, "livecd")
     return (device_is_dm(info) and
             device_get_name(info).startswith("live"))
 
+
 def device_is_biosraid_member(info):
     # Note that this function does *not* identify raid sets.
     # Tests to see if device is part of a dmraid set.
@@ -539,13 +607,14 @@ def device_is_biosraid_member(info):
     from .formats.dmraid import DMRaidMember
     from .formats.mdraid import MDRaidMember
     if 'ID_FS_TYPE' in info and \
-            (info["ID_FS_TYPE"] in DMRaidMember._udev_types or \
+            (info["ID_FS_TYPE"] in DMRaidMember._udev_types or
              info["ID_FS_TYPE"] in MDRaidMember._udev_types) and \
             info["ID_FS_TYPE"] != "linux_raid_member":
         return True
 
     return False
 
+
 def device_get_dm_partition_disk(info):
     if not device_is_dm_partition(info):
         return None
@@ -561,10 +630,12 @@ def device_get_dm_partition_disk(info):
 
     return disk
 
+
 def device_is_dm_partition(info):
     return (device_is_dm(info) and
             info.get("DM_UUID", "").split("-")[0].startswith("part"))
 
+
 def device_get_disklabel_type(info):
     """ Return the type of disklabel on the device or None. """
     if device_is_partition(info) or device_is_dm_partition(info):
@@ -582,6 +653,7 @@ def device_get_disklabel_type(info):
 # Note that in the case of IPV6 iscsi_address itself can contain :
 # too, but iscsi_port never contains :
 
+
 def device_is_sw_iscsi(info):
     # software iscsi
     try:
@@ -595,6 +667,7 @@ def device_is_sw_iscsi(info):
 
     return False
 
+
 def device_is_partoff_iscsi(info):
     # partial offload iscsi
     try:
@@ -608,9 +681,11 @@ def device_is_partoff_iscsi(info):
 
     return False
 
+
 def device_is_iscsi(info):
     return device_is_sw_iscsi(info) or device_is_partoff_iscsi(info)
 
+
 def device_get_iscsi_name(info):
     name_field = 3
     if device_is_partoff_iscsi(info):
@@ -619,7 +694,8 @@ def device_get_iscsi_name(info):
     path_components = device_get_path(info).split("-")
 
     # Tricky, the name itself contains atleast 1 - char
-    return "-".join(path_components[name_field:len(path_components)-2])
+    return "-".join(path_components[name_field:len(path_components) - 2])
+
 
 def device_get_iscsi_address(info):
     address_field = 1
@@ -632,6 +708,7 @@ def device_get_iscsi_address(info):
     # before the last : as address
     return ":".join(path_components[address_field].split(":")[:-1])
 
+
 def device_get_iscsi_port(info):
     address_field = 1
     if device_is_partoff_iscsi(info):
@@ -642,6 +719,7 @@ def device_get_iscsi_port(info):
     # IPV6 contains : within the address, the part after the last : is the port
     return path_components[address_field].split(":")[-1]
 
+
 def device_get_iscsi_session(info):
     # '/devices/pci0000:00/0000:00:02.0/0000:09:00.0/0000:0a:01.0/0000:0e:00.2/host3/session1/target3:0:0/3:0:0:0/block/sda'
     # The position of sessionX part depends on device
@@ -663,6 +741,7 @@ def device_get_iscsi_nic(info):
                      session).read().strip()
     return iface
 
+
 def device_get_iscsi_initiator(info):
     initiator = None
     if device_is_partoff_iscsi(info):
@@ -709,15 +788,16 @@ def device_get_iscsi_initiator(info):
 # Ethernet interface.
 
 def _detect_broadcom_fcoe(info):
-    re_pci_host=re.compile(r'/(.*)/(host\d+)')
+    re_pci_host = re.compile(r'/(.*)/(host\d+)')
     match = re_pci_host.match(device_get_sysfs_path(info))
     if match:
         sysfs_pci, host = match.groups()
-        if os.access('%s/%s/fc_host' %(sysfs_pci, host), os.X_OK) and \
+        if os.access('%s/%s/fc_host' % (sysfs_pci, host), os.X_OK) and \
                 'net' in sysfs_pci:
             return (sysfs_pci, host)
     return (None, None)
 
+
 def device_is_fcoe(info):
     if info.get("ID_BUS") != "scsi":
         return False
@@ -737,6 +817,7 @@ def device_is_fcoe(info):
 
     return False
 
+
 def device_get_fcoe_nic(info):
     path = info.get("ID_PATH", "")
     path_components = path.split("-")
@@ -760,6 +841,7 @@ def device_get_fcoe_nic(info):
         else:
             return iface
 
+
 def device_get_fcoe_identifier(info):
     path = info.get("ID_PATH", "")
     path_components = path.split("-")
diff --git a/blivet/util.py b/blivet/util.py
index cb3d1bc..86e6601 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -31,6 +31,7 @@
 # this will get set to anaconda's program_log_lock in enable_installer_mode
 program_log_lock = Lock()
 
+
 def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
     if env_prune is None:
         env_prune = []
@@ -82,23 +83,29 @@ def chroot():
 
     return (proc.returncode, out)
 
+
 def run_program(*args, **kwargs):
     return _run_program(*args, **kwargs)[0]
 
+
 def capture_output(*args, **kwargs):
     return _run_program(*args, **kwargs)[1]
 
+
 def capture_output_binary(*args, **kwargs):
     kwargs["binary_output"] = True
     return _run_program(*args, **kwargs)[1]
 
+
 def run_program_and_capture_output(*args, **kwargs):
     return _run_program(*args, **kwargs)
 
+
 def run_program_and_capture_output_binary(*args, **kwargs):
     kwargs["binary_output"] = True
     return _run_program(*args, **kwargs)
 
+
 def mount(device, mountpoint, fstype, options=None):
     if options is None:
         options = "defaults"
@@ -115,6 +122,7 @@ def mount(device, mountpoint, fstype, options=None):
 
     return rc
 
+
 def umount(mountpoint):
     try:
         rc = run_program(["umount", mountpoint])
@@ -123,6 +131,7 @@ def umount(mountpoint):
 
     return rc
 
+
 def get_mount_paths(dev):
     """ Given a device node path, return a list of all active mountpoints.
 
@@ -137,6 +146,7 @@ def get_mount_paths(dev):
         log.debug("%s is mounted on %s", dev, ', '.join(mount_paths))
     return mount_paths
 
+
 def get_mount_device(mountpoint):
     """ Given a mountpoint, return the device node path mounted there. """
     mounts = open("/proc/mounts").readlines()
@@ -162,6 +172,7 @@ def get_mount_device(mountpoint):
 
     return mount_device
 
+
 def total_memory():
     """ Return the amount of system RAM.
 
@@ -182,8 +193,10 @@ def total_memory():
     return mem
 
 ##
-## sysfs functions
+# sysfs functions
 ##
+
+
 def notify_kernel(path, action="change"):
     """ Signal the kernel that the specified device has changed.
 
@@ -199,6 +212,7 @@ def notify_kernel(path, action="change"):
     f.write("%s\n" % action)
     f.close()
 
+
 def get_sysfs_attr(path, attr):
     if not attr:
         log.debug("get_sysfs_attr() called with attr=None")
@@ -213,6 +227,7 @@ def get_sysfs_attr(path, attr):
 
     return open(attribute, "r").read().strip()
 
+
 def get_sysfs_path_by_name(dev_node, class_name="block"):
     """ Return sysfs path for a given device.
 
@@ -231,6 +246,7 @@ def get_sysfs_path_by_name(dev_node, class_name="block"):
         raise RuntimeError("get_sysfs_path_by_name: Could not find sysfs path "
                            "for '%s' (it is not at '%s')" % (dev_node, dev_path))
 
+
 def get_cow_sysfs_path(dev_path, dev_sysfsPath):
     """ Return sysfs path of cow device for a given device.
     """
@@ -249,8 +265,10 @@ def get_cow_sysfs_path(dev_path, dev_sysfsPath):
     return cow_sysfsPath
 
 ##
-## SELinux functions
+# SELinux functions
 ##
+
+
 def match_path_context(path):
     """ Return the default SELinux context for the given path. """
     context = None
@@ -261,6 +279,7 @@ def match_path_context(path):
 
     return context
 
+
 def set_file_context(path, context, root=None):
     """ Set the SELinux file context of a file.
 
@@ -292,6 +311,7 @@ def set_file_context(path, context, root=None):
 
     return rc
 
+
 def reset_file_context(path, root=None):
     """ Restore the SELinux context of a file to its default value.
 
@@ -313,8 +333,10 @@ def reset_file_context(path, root=None):
             return context
 
 ##
-## Miscellaneous
+# Miscellaneous
 ##
+
+
 def find_program_in_path(prog, raise_on_error=False):
     for d in os.environ["PATH"].split(os.pathsep):
         full = os.path.join(d, prog)
@@ -324,10 +346,12 @@ def find_program_in_path(prog, raise_on_error=False):
     if raise_on_error:
         raise RuntimeError("Unable to locate a needed executable: '%s'" % prog)
 
+
 def makedirs(path):
     if not os.path.isdir(path):
         os.makedirs(path, 0o755)
 
+
 def copy_to_system(source):
     # do the import now because enable_installer_mode() has finally been called.
     from . import get_sysroot
@@ -344,12 +368,14 @@ def copy_to_system(source):
     shutil.copy(source, target)
     return True
 
+
 def lsmod():
     """ Returns list of names of all loaded modules. """
     with open("/proc/modules") as f:
         lines = f.readlines()
     return [l.split()[0] for l in lines]
 
+
 def get_option_value(opt_name, options):
     """ Return the value of a named option in the specified options string. """
     for opt in options.split(","):
@@ -360,6 +386,7 @@ def get_option_value(opt_name, options):
         if name == opt_name:
             return val.strip()
 
+
 def numeric_type(num):
     """ Verify that a value is given as a numeric data type.
 
@@ -376,6 +403,7 @@ def numeric_type(num):
 
     return num
 
+
 def insert_colons(a_string):
     """ Insert colon between every second character.
 
@@ -388,6 +416,7 @@ def insert_colons(a_string):
     else:
         return suffix
 
+
 def md5_file(filename):
 
     md5 = hashlib.md5()
@@ -400,7 +429,9 @@ def md5_file(filename):
 
     return md5.hexdigest()
 
+
 class ObjectID(object):
+
     """This class is meant to be extended by other classes which require
        an ID which is preserved when an object copy is made.
        The value returned by the builtin function id() is not adequate:
@@ -418,9 +449,10 @@ class ObjectID(object):
     def __new__(cls, *args, **kwargs):
         # pylint: disable=unused-argument
         self = super(ObjectID, cls).__new__(cls)
-        self.id = self._newid_gen() # pylint: disable=attribute-defined-outside-init
+        self.id = self._newid_gen()  # pylint: disable=attribute-defined-outside-init
         return self
 
+
 def canonicalize_UUID(a_uuid):
     """ Converts uuids to canonical form.
 
@@ -443,6 +475,8 @@ def canonicalize_UUID(a_uuid):
 # Most Python 2/3 compatibility code equates python 2 str with python 3 bytes,
 # but the equivalence that we actually need to avoid return type surprises is
 # str/str.
+
+
 def stringize(inputstr):
     """ Convert strings to a format compatible with Python 2's str.
 
@@ -465,6 +499,8 @@ def stringize(inputstr):
 
 # Like six.u, but without the part where it raises an exception on unicode
 # objects
+
+
 def unicodeize(inputstr):
     """ Convert strings to a format compatible with Python 2's unicode.
 
@@ -484,6 +520,7 @@ def unicodeize(inputstr):
     else:
         return str(inputstr)
 
+
 def compare(first, second):
     """ Compare two objects.
 
@@ -508,8 +545,10 @@ def compare(first, second):
         return (first > second) - (first < second)
 
 ##
-## Convenience functions for examples and tests
+# Convenience functions for examples and tests
 ##
+
+
 def set_up_logging(log_file='/tmp/blivet.log'):
     """ Configure the blivet logger to write out a log file.
 
@@ -530,6 +569,7 @@ def set_up_logging(log_file='/tmp/blivet.log'):
 
     log.info("sys.argv = %s", sys.argv)
 
+
 def create_sparse_tempfile(name, size):
     """ Create a temporary sparse file.
 
@@ -542,6 +582,7 @@ def create_sparse_tempfile(name, size):
     create_sparse_file(path, size)
     return path
 
+
 def create_sparse_file(path, size):
     """ Create a sparse file.
 
@@ -549,10 +590,11 @@ def create_sparse_file(path, size):
         :param :class:`~.size.Size` size: the size of the file
         :returns: None
     """
-    fd = eintr_retry_call(os.open, path, os.O_WRONLY|os.O_CREAT|os.O_TRUNC)
+    fd = eintr_retry_call(os.open, path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
     eintr_retry_call(os.ftruncate, fd, size)
     eintr_ignore(os.close, fd)
 
+
 @contextmanager
 def sparsetmpfile(name, size):
     """ Context manager that creates a sparse tempfile and then unlinks it.
@@ -568,6 +610,7 @@ def sparsetmpfile(name, size):
     finally:
         os.unlink(path)
 
+
 def variable_copy(obj, memo, omit=None, shallow=None, duplicate=None):
     """ A configurable copy function. Any attributes not specified in omit,
         shallow, or duplicate are copied using copy.deepcopy().
@@ -605,10 +648,12 @@ def variable_copy(obj, memo, omit=None, shallow=None, duplicate=None):
 
     return new
 
+
 def get_current_entropy():
     with open("/proc/sys/kernel/random/entropy_avail", "r") as fobj:
         return int(fobj.readline())
 
+
 def power_of_two(value):
     """ Checks whether value is a power of 2 greater than 1.
 
@@ -638,6 +683,8 @@ def power_of_two(value):
     return True
 
 # Copied from python's subprocess.py
+
+
 def eintr_retry_call(func, *args, **kwargs):
     """Retry an interruptible system call if interrupted."""
     while True:
@@ -648,6 +695,7 @@ def eintr_retry_call(func, *args, **kwargs):
                 continue
             raise
 
+
 def eintr_ignore(func, *args, **kwargs):
     """Call a function and ignore EINTR.
 
@@ -663,6 +711,8 @@ def eintr_ignore(func, *args, **kwargs):
         raise
 
 _open = open
+
+
 def open(*args, **kwargs):  # pylint: disable=redefined-builtin
     """Open a file, and retry on EINTR."""
     return eintr_retry_call(_open, *args, **kwargs)
@@ -671,9 +721,12 @@ def open(*args, **kwargs):  # pylint: disable=redefined-builtin
 # Deprecation decorator.
 #
 _DEPRECATION_MESSAGE = "will be removed in a future version."
+
+
 def _default_deprecation_msg(func):
     return "%s %s" % (func.__name__, _DEPRECATION_MESSAGE)
 
+
 def indent(text, spaces=4):
     """ Indent text by a specified number of spaces.
 
@@ -696,6 +749,8 @@ def indent(text, spaces=4):
 _SPHINX_DEPRECATE = """.. deprecated:: %(version)s
     %(message)s
 """
+
+
 def _add_deprecation_doc_text(func, version=None, message=None):
     """ Add sphinx 'deprecated' markup to a function's docstring.
 
@@ -708,9 +763,9 @@ def _add_deprecation_doc_text(func, version=None, message=None):
     """
     base_text = func.__doc__
     if base_text is None:
-        base_text = " " # They contain leading and trailing spaces. *shrug*
+        base_text = " "  # They contain leading and trailing spaces. *shrug*
     else:
-        base_text = base_text[:-1] # Trim the trailing space.
+        base_text = base_text[:-1]  # Trim the trailing space.
 
     if ".. deprecated::" in base_text:
         # Don't add multiple deprecation directives.
@@ -744,6 +799,7 @@ def _add_deprecation_doc_text(func, version=None, message=None):
     text += _SPHINX_DEPRECATE % {"version": version, "message": message}
     func.__doc__ = base_text + "\n" + indent(text, indent_spaces)
 
+
 def deprecated(version, message):
     """ Decorator to deprecate a function or method via warning and docstring.
 
diff --git a/blivet/zfcp.py b/blivet/zfcp.py
index 71b2cee..d43cc65 100644
--- a/blivet/zfcp.py
+++ b/blivet/zfcp.py
@@ -34,6 +34,7 @@
 import logging
 log = logging.getLogger("blivet")
 
+
 def logged_write_line_to_file(fn, value):
     f = open(fn, "w")
     log.debug("echo %s > %s", value, fn)
@@ -44,7 +45,9 @@ def logged_write_line_to_file(fn, value):
 scsidevsysfs = "/sys/bus/scsi/devices"
 zfcpconf = "/etc/zfcp.conf"
 
+
 class ZFCPDevice:
+
     def __init__(self, devnum, wwpn, fcplun):
         self.devnum = blockdev.s390.sanitize_dev_input(devnum)
         self.wwpn = blockdev.s390.zfcp_sanitize_wwpn_input(wwpn)
@@ -59,7 +62,7 @@ def __init__(self, devnum, wwpn, fcplun):
 
     # Force str and unicode types in case any of the properties are unicode
     def _to_string(self):
-        return "%s %s %s" %(self.devnum, self.wwpn, self.fcplun)
+        return "%s %s %s" % (self.devnum, self.wwpn, self.fcplun)
 
     def __str__(self):
         return stringize(self._to_string())
@@ -68,19 +71,19 @@ def __unicode__(self):
         return unicodeize(self._to_string())
 
     def online_device(self):
-        online = "%s/%s/online" %(zfcpsysfs, self.devnum)
-        portadd = "%s/%s/port_add" %(zfcpsysfs, self.devnum)
-        portdir = "%s/%s/%s" %(zfcpsysfs, self.devnum, self.wwpn)
-        unitadd = "%s/unit_add" %(portdir)
-        unitdir = "%s/%s" %(portdir, self.fcplun)
-        failed = "%s/failed" %(unitdir)
+        online = "%s/%s/online" % (zfcpsysfs, self.devnum)
+        portadd = "%s/%s/port_add" % (zfcpsysfs, self.devnum)
+        portdir = "%s/%s/%s" % (zfcpsysfs, self.devnum, self.wwpn)
+        unitadd = "%s/unit_add" % (portdir)
+        unitdir = "%s/%s" % (portdir, self.fcplun)
+        failed = "%s/failed" % (unitdir)
 
         if not os.path.exists(online):
             log.info("Freeing zFCP device %s", self.devnum)
             util.run_program(["zfcp_cio_free", "-d", self.devnum])
 
         if not os.path.exists(online):
-            raise ValueError(_("zFCP device %s not found, not even in device ignore list.") % \
+            raise ValueError(_("zFCP device %s not found, not even in device ignore list.") %
                     (self.devnum,))
 
         try:
@@ -91,7 +94,7 @@ def online_device(self):
                 logged_write_line_to_file(online, "1")
         except IOError as e:
             raise ValueError(_("Could not set zFCP device %(devnum)s "
-                                "online (%(e)s).") \
+                                "online (%(e)s).")
                               % {'devnum': self.devnum, 'e': e})
 
         if not os.path.exists(portdir):
@@ -102,7 +105,7 @@ def online_device(self):
                     udev.settle()
                 except IOError as e:
                     raise ValueError(_("Could not add WWPN %(wwpn)s to zFCP "
-                                        "device %(devnum)s (%(e)s).") \
+                                        "device %(devnum)s (%(e)s).")
                                       % {'wwpn': self.wwpn,
                                          'devnum': self.devnum,
                                          'e': e})
@@ -125,12 +128,12 @@ def online_device(self):
             except IOError as e:
                 raise ValueError(_("Could not add LUN %(fcplun)s to WWPN "
                                     "%(wwpn)s on zFCP device %(devnum)s "
-                                    "(%(e)s).") \
+                                    "(%(e)s).")
                                   % {'fcplun': self.fcplun, 'wwpn': self.wwpn,
                                      'devnum': self.devnum, 'e': e})
         else:
             raise ValueError(_("LUN %(fcplun)s at WWPN %(wwpn)s on zFCP "
-                                "device %(devnum)s already configured.") \
+                                "device %(devnum)s already configured.")
                               % {'fcplun': self.fcplun,
                                  'wwpn': self.wwpn,
                                  'devnum': self.devnum})
@@ -143,7 +146,7 @@ def online_device(self):
         except IOError as e:
             raise ValueError(_("Could not read failed attribute of LUN "
                                 "%(fcplun)s at WWPN %(wwpn)s on zFCP device "
-                                "%(devnum)s (%(e)s).") \
+                                "%(devnum)s (%(e)s).")
                               % {'fcplun': self.fcplun,
                                  'wwpn': self.wwpn,
                                  'devnum': self.devnum,
@@ -151,7 +154,7 @@ def online_device(self):
         if fail != "0":
             self.offline_device()
             raise ValueError(_("Failed LUN %(fcplun)s at WWPN %(wwpn)s on "
-                                "zFCP device %(devnum)s removed again.") \
+                                "zFCP device %(devnum)s removed again.")
                               % {'fcplun': self.fcplun,
                                  'wwpn': self.wwpn,
                                  'devnum': self.devnum})
@@ -176,13 +179,13 @@ def offline_scsi_device(self):
             fcpsysfs = "%s/%s" % (scsidevsysfs, scsidev)
             scsidel = "%s/%s/delete" % (scsidevsysfs, scsidev)
 
-            f = open("%s/hba_id" %(fcpsysfs), "r")
+            f = open("%s/hba_id" % (fcpsysfs), "r")
             fcphbasysfs = f.readline().strip()
             f.close()
-            f = open("%s/wwpn" %(fcpsysfs), "r")
+            f = open("%s/wwpn" % (fcpsysfs), "r")
             fcpwwpnsysfs = f.readline().strip()
             f.close()
-            f = open("%s/fcp_lun" %(fcpsysfs), "r")
+            f = open("%s/fcp_lun" % (fcpsysfs), "r")
             fcplunsysfs = f.readline().strip()
             f.close()
 
@@ -197,19 +200,19 @@ def offline_scsi_device(self):
                  self.devnum, self.wwpn, self.fcplun)
 
     def offline_device(self):
-        offline = "%s/%s/online" %(zfcpsysfs, self.devnum)
-        portadd = "%s/%s/port_add" %(zfcpsysfs, self.devnum)
-        portremove = "%s/%s/port_remove" %(zfcpsysfs, self.devnum)
-        unitremove = "%s/%s/%s/unit_remove" %(zfcpsysfs, self.devnum, self.wwpn)
-        portdir = "%s/%s/%s" %(zfcpsysfs, self.devnum, self.wwpn)
-        devdir = "%s/%s" %(zfcpsysfs, self.devnum)
+        offline = "%s/%s/online" % (zfcpsysfs, self.devnum)
+        portadd = "%s/%s/port_add" % (zfcpsysfs, self.devnum)
+        portremove = "%s/%s/port_remove" % (zfcpsysfs, self.devnum)
+        unitremove = "%s/%s/%s/unit_remove" % (zfcpsysfs, self.devnum, self.wwpn)
+        portdir = "%s/%s/%s" % (zfcpsysfs, self.devnum, self.wwpn)
+        devdir = "%s/%s" % (zfcpsysfs, self.devnum)
 
         try:
             self.offline_scsi_device()
         except IOError as e:
             raise ValueError(_("Could not correctly delete SCSI device of "
                                 "zFCP %(devnum)s %(wwpn)s %(fcplun)s "
-                                "(%(e)s).") \
+                                "(%(e)s).")
                               % {'devnum': self.devnum, 'wwpn': self.wwpn,
                                  'fcplun': self.fcplun, 'e': e})
 
@@ -218,7 +221,7 @@ def offline_device(self):
         except IOError as e:
             raise ValueError(_("Could not remove LUN %(fcplun)s at WWPN "
                                 "%(wwpn)s on zFCP device %(devnum)s "
-                                "(%(e)s).") \
+                                "(%(e)s).")
                               % {'fcplun': self.fcplun, 'wwpn': self.wwpn,
                                  'devnum': self.devnum, 'e': e})
 
@@ -235,7 +238,7 @@ def offline_device(self):
                 logged_write_line_to_file(portremove, self.wwpn)
             except IOError as e:
                 raise ValueError(_("Could not remove WWPN %(wwpn)s on zFCP "
-                                    "device %(devnum)s (%(e)s).") \
+                                    "device %(devnum)s (%(e)s).")
                                   % {'wwpn': self.wwpn,
                                      'devnum': self.devnum, 'e': e})
 
@@ -251,7 +254,7 @@ def offline_device(self):
             # newer zfcp sysfs interface with auto port scan
             import glob
             luns = glob.glob("%s/0x????????????????/0x????????????????"
-                          %(devdir,))
+                          % (devdir,))
             if len(luns) != 0:
                 log.info("Not setting zFCP device %s offline since it still has other LUNs, e.g. %s.",
                          self.devnum, luns[0])
@@ -261,12 +264,14 @@ def offline_device(self):
             logged_write_line_to_file(offline, "0")
         except IOError as e:
             raise ValueError(_("Could not set zFCP device %(devnum)s "
-                                "offline (%(e)s).") \
+                                "offline (%(e)s).")
                               % {'devnum': self.devnum, 'e': e})
 
         return True
 
+
 class ZFCP:
+
     """ ZFCP utility class.
 
         This class will automatically online to ZFCP drives configured in
@@ -305,13 +310,13 @@ def read_config(self):
 
             if len(fields) == 3:
                 devnum = fields[0]
-                wwpn   = fields[1]
+                wwpn = fields[1]
                 fcplun = fields[2]
             elif len(fields) == 5:
                 # support old syntax of:
                 # devno scsiid wwpn scsilun fcplun
                 devnum = fields[0]
-                wwpn   = fields[2]
+                wwpn = fields[2]
                 fcplun = fields[4]
             else:
                 log.warn("Invalid line found in %s: %s", zfcpconf, line)
@@ -362,7 +367,7 @@ def write(self, root):
             return
         f = open(root + zfcpconf, "w")
         for d in self.fcpdevs:
-            f.write("%s\n" %(d,))
+            f.write("%s\n" % (d,))
         f.close()
 
         f = open(root + "/etc/modprobe.conf", "a")
diff --git a/doc/conf.py b/doc/conf.py
index 23dc2de..e452490 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -11,7 +11,8 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os
+import sys
+import os
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -299,6 +300,8 @@
 # NOTE: this can be removed whenever we move to sphinx-1.3, at which point we'll
 #       be able to use autodoc_mock_imports (value is a list of modules to be
 #       mocked).
+
+
 class Mock(object):
 
     __all__ = []
diff --git a/setup.py b/setup.py
index 45246cd..d213fc5 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,9 @@
 
 # this is copied straight from distutils.filelist.findall , but with os.stat()
 # replaced with os.lstat(), so S_ISLNK() can actually tell us something.
-def findall(dirname = os.curdir):
+
+
+def findall(dirname=os.curdir):
     from stat import ST_MODE, S_ISREG, S_ISDIR, S_ISLNK
 
     file_list = []
@@ -43,10 +45,12 @@ def findall(dirname = os.curdir):
 
 AM_RE = r'(^.. automodule::.+?(?P<mo>^\s+?:member-order:.+?\n)?.+?:\n)\n(?(mo)NEVER)'
 
+
 def generate_api_docs():
     if subprocess.call(["sphinx-apidoc", "-o", "doc", "blivet"]):
         sys.stderr.write("failed to generate API docs")
 
+
 def add_member_order_option(files):
     """ Add an automodule option to preserve source code member order. """
     for fn in files:
@@ -54,7 +58,7 @@ def add_member_order_option(files):
         amended = re.sub(AM_RE,
                          r'\1    :member-order: bysource\n\n',
                          buf,
-                         flags=re.DOTALL|re.MULTILINE)
+                         flags=re.DOTALL | re.MULTILINE)
         open(fn, "w").write(amended)
 
 data_files = []
diff --git a/tests/action_test.py b/tests/action_test.py
index 0ec1a5d..fbab7d3 100644
--- a/tests/action_test.py
+++ b/tests/action_test.py
@@ -31,8 +31,10 @@
    LVMLogicalVolumeDevice
 ]
 
+
 @unittest.skipUnless(not any(x.unavailable_type_dependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
 class DeviceActionTestCase(StorageTestCase):
+
     """ DeviceActionTestSuite """
 
     def setUp(self):
@@ -301,7 +303,6 @@ def test_action_registration(self):
         with self.assertRaises(blivet.errors.DeviceTreeError):
             self.storage.devicetree.register_action(destroy_sdc1_format)
 
-
         destroy_sdc1 = ActionDestroyDevice(sdc1)
         with self.assertRaises(blivet.errors.DeviceTreeError):
             self.storage.devicetree.register_action(destroy_sdc1)
@@ -994,7 +995,6 @@ def test_action_apply_cancel(self):
         action.cancel()
         self.assertEqual(lv_root.format, original_format)
 
-
         sdc = self.storage.devicetree.get_device_by_name("sdc")
         sdc.format = None
         pv_fmt = self.new_format("lvmpv", device_instance=sdc, device=sdc.path)
diff --git a/tests/clearpart_test.py b/tests/clearpart_test.py
index ae96577..f321c08 100644
--- a/tests/clearpart_test.py
+++ b/tests/clearpart_test.py
@@ -11,8 +11,10 @@
     blivet.devices.PartitionDevice
 ]
 
+
 @unittest.skipUnless(not any(x.unavailable_type_dependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
 class ClearPartTestCase(unittest.TestCase):
+
     def setUp(self):
         flags.testing = True
 
diff --git a/tests/devicefactory_test.py b/tests/devicefactory_test.py
index c3f6e3a..9c3a614 100644
--- a/tests/devicefactory_test.py
+++ b/tests/devicefactory_test.py
@@ -33,6 +33,8 @@
         - add properties to factory classes indicating relevance/support of
           various options (container_*, encrypted come to mind)
 """
+
+
 class DeviceFactoryTestCase(unittest.TestCase):
     device_type = None
     """ device type constant to pass to devicefactory.get_device_factory """
@@ -47,7 +49,7 @@ def setUp(self):
         if self.device_type is None:
             raise unittest.SkipTest("abstract base class")
 
-        self.b = blivet.Blivet() # don't populate it
+        self.b = blivet.Blivet()  # don't populate it
         self.disk_files = [create_sparse_tempfile("factorytest", Size("1 GiB")),
                            create_sparse_tempfile("factorytest", Size("1 GiB"))]
         for filename in self.disk_files:
@@ -113,7 +115,7 @@ def test_device_factory(self):
         self.b.recursive_remove(device)
 
         if self.encryption_supported:
-            ## Encrypt the leaf device
+            # Encrypt the leaf device
             kwargs["encrypted"] = True
             device = self._factory_device(device_type, size, **kwargs)
             self._validate_factory_device(device, device_type, size, **kwargs)
@@ -121,10 +123,10 @@ def test_device_factory(self):
                 self.b.recursive_remove(partition)
 
         ##
-        ## Reconfigure device
+        # Reconfigure device
         ##
 
-        ## Create a basic stack
+        # Create a basic stack
         size = Size('800 MiB')
         kwargs = {"disks": self.b.disks,
                   "fstype": 'ext4',
@@ -133,19 +135,19 @@ def test_device_factory(self):
         self._validate_factory_device(device, device_type, size, **kwargs)
 
         if self.encryption_supported:
-            ## Encrypt the leaf device
+            # Encrypt the leaf device
             kwargs["encrypted"] = True
             kwargs["device"] = device
             device = self._factory_device(device_type, size, **kwargs)
             self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## Change the mountpoint
+        # Change the mountpoint
         kwargs["mountpoint"] = "/a/different/dir"
         kwargs["device"] = device
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## Change the fstype and size.
+        # Change the fstype and size.
         kwargs["fstype"] = "xfs"
         kwargs["device"] = device
         size = Size("650 MiB")
@@ -166,7 +168,7 @@ def _get_size_delta(self, devices=None):
         return Size("1 MiB")
 
     def test_get_free_disk_space(self):
-        ## get_free_disk_space should return the total free space on disks
+        # get_free_disk_space should return the total free space on disks
         kwargs = self._get_test_factory_args()
         size = Size("500 MiB")
         factory = devicefactory.get_device_factory(self.b,
@@ -174,7 +176,7 @@ def test_get_free_disk_space(self):
                                                    size,
                                                    disks=self.b.disks,
                                                    **kwargs)
-        ## disks contain empty disklabels, so free space is sum of disk sizes
+        # disks contain empty disklabels, so free space is sum of disk sizes
         self.assertAlmostEqual(factory._get_free_disk_space(),
                                sum(d.size for d in self.b.disks),
                                delta=self._get_size_delta())
@@ -188,14 +190,14 @@ def test_get_free_disk_space(self):
                                                    size,
                                                    disks=self.b.disks,
                                                    **kwargs)
-        ## disks contain a 500 MiB device, which includes varying amounts of
-        ## metadata and space lost to partition alignment.
+        # disks contain a 500 MiB device, which includes varying amounts of
+        # metadata and space lost to partition alignment.
         self.assertAlmostEqual(factory._get_free_disk_space(),
                                sum(d.size for d in self.b.disks) - device_space,
                                delta=self._get_size_delta(devices=[device]))
 
     def test_normalize_size(self):
-        ## _normalize_size should adjust target size to within the format limits
+        # _normalize_size should adjust target size to within the format limits
         fstype = "ext2"
         ext2 = get_format(fstype)
         self.assertTrue(ext2.max_size > Size(0))
@@ -212,8 +214,8 @@ def test_normalize_size(self):
         factory._normalize_size()
         self.assertTrue(factory.size <= ext2.max_size)
 
-        ## _normalize_size should convert a size of None to a reasonable guess
-        ## at the largest possible size based on disk free space
+        # _normalize_size should convert a size of None to a reasonable guess
+        # at the largest possible size based on disk free space
         factory.size = None
         factory._normalize_size()
         self.assertIsInstance(factory.size, blivet.size.Size)
@@ -222,8 +224,8 @@ def test_normalize_size(self):
         self.assertAlmostEqual(factory.size, sum(d.size for d in self.b.disks),
                                delta=self._get_size_delta())
 
-        ## _handle_no_size should also take into account any specified factory
-        ## device, in case the factory is to be modifying a defined device
+        # _handle_no_size should also take into account any specified factory
+        # device, in case the factory is to be modifying a defined device
         # must be a couple MiB smaller than the disk to accommodate
         # PartitionFactory
         size = self.b.disks[0].size - Size("4 MiB")
@@ -236,19 +238,20 @@ def test_normalize_size(self):
         factory._normalize_size()
         self.assertIsInstance(factory.size, blivet.size.Size)
         self.assertTrue(factory.size <= ext2.max_size)
-        ## factory size should be total disk space plus current device space
+        # factory size should be total disk space plus current device space
         # Allow some variation in size for metadata, alignment, &c.
         self.assertAlmostEqual(factory.size,
                                sum(d.size for d in self.b.disks),
                                delta=self._get_size_delta(devices=[device]))
 
+
 class PartitionFactoryTestCase(DeviceFactoryTestCase):
     device_class = PartitionDevice
     device_type = devicefactory.DEVICE_TYPE_PARTITION
 
     def test_bug1178884(self):
-        ## Test a change of format and size where old size is too large for the
-        ## new format but not for the old one.
+        # Test a change of format and size where old size is too large for the
+        # new format but not for the old one.
         device_type = self.device_type
         size = Size('400 MiB')
         kwargs = {"disks": self.b.disks,
@@ -269,6 +272,7 @@ def _get_size_delta(self, devices=None):
 
         return delta
 
+
 class LVMFactoryTestCase(DeviceFactoryTestCase):
     device_class = LVMLogicalVolumeDevice
     device_type = devicefactory.DEVICE_TYPE_LVM
@@ -301,7 +305,7 @@ def test_device_factory(self):
         super(LVMFactoryTestCase, self).test_device_factory()
 
         ##
-        ## New device
+        # New device
         ##
         device_type = self.device_type
         size = Size('400 MiB')
@@ -310,7 +314,7 @@ def test_device_factory(self):
                   "mountpoint": '/factorytest'}
 
         if self.encryption_supported:
-            ## encrypt the PVs
+            # encrypt the PVs
             kwargs["encrypted"] = False
             kwargs["container_encrypted"] = True
             device = self._factory_device(device_type, size, **kwargs)
@@ -318,7 +322,7 @@ def test_device_factory(self):
             for partition in self.b.partitions:
                 self.b.recursive_remove(partition)
 
-        ## Add mirroring of PV using MD
+        # Add mirroring of PV using MD
         kwargs["container_encrypted"] = False
         kwargs["container_raid_level"] = "raid1"
         device = self._factory_device(device_type, size, **kwargs)
@@ -327,10 +331,10 @@ def test_device_factory(self):
             self.b.recursive_remove(partition)
 
         ##
-        ## Reconfigure device
+        # Reconfigure device
         ##
 
-        ## Create a basic LVM stack
+        # Create a basic LVM stack
         device_type = self.device_type
         size = Size('800 MiB')
         kwargs = {"disks": self.b.disks,
@@ -340,7 +344,7 @@ def test_device_factory(self):
         self._validate_factory_device(device, device_type, size, **kwargs)
 
         if self.encryption_supported:
-            ## Encrypt the LV
+            # Encrypt the LV
             # Yes, this is duplicated from the base class but this allows us to
             # test a reconfiguration from encrypted leaf to encrypted container
             # members in the next test.
@@ -349,27 +353,27 @@ def test_device_factory(self):
             device = self._factory_device(device_type, size, **kwargs)
             self._validate_factory_device(device, device_type, size, **kwargs)
 
-            ## Decrypt the LV, but encrypt the PVs
+            # Decrypt the LV, but encrypt the PVs
             kwargs["encrypted"] = False
             kwargs["container_encrypted"] = True
             kwargs["device"] = device
             device = self._factory_device(device_type, size, **kwargs)
             self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## Switch to an encrypted raid0 md pv
+        # Switch to an encrypted raid0 md pv
         kwargs["container_raid_level"] = "raid0"
         kwargs["device"] = device
         size = Size("400 MiB")
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## remove encryption from the md pv
+        # remove encryption from the md pv
         kwargs["container_encrypted"] = False
         kwargs["device"] = device
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## switch back to normal partition pvs
+        # switch back to normal partition pvs
         kwargs["container_raid_level"] = None
         kwargs["device"] = device
         size = Size("750 MiB")
@@ -397,15 +401,16 @@ def test_get_container(self):
                                                    Size("500 MiB"),
                                                    fstype="xfs")
 
-        ## get_container on lvm factory should return the lone non-existent vg
+        # get_container on lvm factory should return the lone non-existent vg
         self.assertEqual(factory.get_container(), vg)
 
-        ## get_container should require allow_existing to return an existing vg
+        # get_container should require allow_existing to return an existing vg
         vg.exists = True
         vg._complete = True
         self.assertEqual(factory.get_container(), None)
         self.assertEqual(factory.get_container(allow_existing=True), vg)
 
+
 class LVMThinPFactoryTestCase(LVMFactoryTestCase):
     device_class = LVMThinLogicalVolumeDevice
     device_type = devicefactory.DEVICE_TYPE_LVM_THINP
@@ -433,12 +438,13 @@ def _get_size_delta(self, devices=None):
 
         return delta
 
+
 class MDFactoryTestCase(DeviceFactoryTestCase):
     device_type = devicefactory.DEVICE_TYPE_MD
     device_class = MDRaidArrayDevice
 
     def test_device_factory(self):
-        ## RAID0 across two disks
+        # RAID0 across two disks
         device_type = self.device_type
         size = Size('1 GiB')
         kwargs = {"disks": self.b.disks,
@@ -449,7 +455,7 @@ def test_device_factory(self):
         self._validate_factory_device(device, device_type, size, **kwargs)
         self.b.recursive_remove(device)
 
-        ## Encrypt the leaf device
+        # Encrypt the leaf device
         kwargs["encrypted"] = True
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
@@ -468,10 +474,10 @@ def test_device_factory(self):
             self.b.recursive_remove(partition)
 
         ##
-        ## Reconfigure device
+        # Reconfigure device
         ##
 
-        ## RAID0 across two disks w/ swap
+        # RAID0 across two disks w/ swap
         size = Size('800 MiB')
         kwargs = {"disks": self.b.disks,
                   "fstype": 'swap',
@@ -480,13 +486,13 @@ def test_device_factory(self):
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## Encrypt the leaf device
+        # Encrypt the leaf device
         kwargs["encrypted"] = True
         kwargs["device"] = device
         device = self._factory_device(device_type, size, **kwargs)
         self._validate_factory_device(device, device_type, size, **kwargs)
 
-        ## Change the mountpoint
+        # Change the mountpoint
         size = Size('400 MiB')
         kwargs["raid_level"] = "raid1"
         kwargs["mountpoint"] = "/a/different/dir"
@@ -508,6 +514,7 @@ def _get_test_factory_args(self):
        not necessarily its intended or its correct behavior. See the
        initial commit message for this file for further details.
     """
+
     def test_mdfactory(self):
         factory1 = devicefactory.get_device_factory(self.b,
            devicefactory.DEVICE_TYPE_MD,
diff --git a/tests/devicelibs_test/edd_test.py b/tests/devicelibs_test/edd_test.py
index 5778af6..743e011 100644
--- a/tests/devicelibs_test/edd_test.py
+++ b/tests/devicelibs_test/edd_test.py
@@ -7,14 +7,18 @@
 
 from blivet.devicelibs import edd
 
+
 class FakeDevice(object):
+
     def __init__(self, name):
         self.name = name
 
+
 class FakeEddEntry(edd.EddEntry):
+
     def __init__(self, sysfspath, **kw):
         edd.EddEntry.__init__(self, sysfspath)
-        for (name,value) in kw.items():
+        for (name, value) in kw.items():
             self.__dict__[name] = value
 
     @property
@@ -33,6 +37,7 @@ def __lt__(self, other):
     def __eq__(self, other):
         return self.__dict__ == other.__dict__
 
+
 class EddTestCase(unittest.TestCase):
     _edd_logger = None
     max_diff = None
@@ -133,7 +138,7 @@ def test_collect_edd_data_sata_usb(self):
     def test_get_edd_dict_sata_usb(self):
         # test with sata sda, usb sdb
         self._set_fs_root(edd, "sata_usb")
-        devices=(FakeDevice("sda"),
+        devices = (FakeDevice("sda"),
                  FakeDevice("sdb"),
                  )
         fakeedd = {
@@ -142,7 +147,7 @@ def test_get_edd_dict_sata_usb(self):
                            pci_dev="00:1f.2", channel=255, ata_device=1,
                            interface="SATA    \tdevice: 1",
                            sysfspath="/sys/firmware/edd/int13_dev80",
-                           sysfslink="../devices/pci0000:00/0000:00:1f.2/ata2"\
+                           sysfslink="../devices/pci0000:00/0000:00:1f.2/ata2"
                                      "/host1/target1:0:0/1:0:0:0/block/sda"),
             0x81: FakeEddEntry(version="0x21", mbr_sig="0x96a20d28",
                            sectors=31293440, host_bus="PCI", type="USB",
@@ -167,7 +172,7 @@ def test_get_edd_dict_sata_usb(self):
             ]
         infos = [
             ("edd: MBR signature on %s is zero. new disk image?", "sda"),
-            ("edd: collected mbr signatures: %s",{'sdb': '0x96a20d28'}),
+            ("edd: collected mbr signatures: %s", {'sdb': '0x96a20d28'}),
             ("edd: matched 0x%x to %s using PCI dev", 0x80, "sda"),
             ("edd: matched 0x%x to %s using MBR sig", 0x81, "sdb"),
             ]
diff --git a/tests/devicelibs_test/mdraid_test.py b/tests/devicelibs_test/mdraid_test.py
index e212f5c..04ad947 100644
--- a/tests/devicelibs_test/mdraid_test.py
+++ b/tests/devicelibs_test/mdraid_test.py
@@ -2,12 +2,13 @@
 
 import blivet.devicelibs.mdraid as mdraid
 
+
 class MDRaidTestCase(unittest.TestCase):
 
     def test_mdraid(self):
 
         ##
-        ## level lookup
+        # level lookup
         ##
         self.assertEqual(mdraid.RAID_levels.raid_level("stripe").name, "raid0")
         self.assertEqual(mdraid.RAID_levels.raid_level("mirror").name, "raid1")
diff --git a/tests/devicelibs_test/raid_test.py b/tests/devicelibs_test/raid_test.py
index 25a9f90..0298fc7 100644
--- a/tests/devicelibs_test/raid_test.py
+++ b/tests/devicelibs_test/raid_test.py
@@ -4,6 +4,7 @@
 import blivet.errors as errors
 from blivet.size import Size
 
+
 class RaidTestCase(unittest.TestCase):
 
     def setUp(self):
@@ -17,7 +18,7 @@ def test_raid(self):
             raid.ErsatzRAID()
 
         ##
-        ## get_min_members
+        # get_min_members
         ##
         # pass
         self.assertEqual(raid.RAID0.min_members, 2)
@@ -28,7 +29,7 @@ def test_raid(self):
         self.assertEqual(raid.Linear.min_members, 1)
 
         ##
-        ## get_max_spares
+        # get_max_spares
         ##
         # pass
         self.assertEqual(raid.RAID0.get_max_spares(5), 0)
@@ -40,7 +41,7 @@ def test_raid(self):
         self.assertEqual(raid.Single.get_max_spares(5), 4)
 
         ##
-        ## raid_level
+        # raid_level
         ##
         # pass
         self.assertIs(self.levels.raid_level(10), raid.RAID10)
@@ -57,7 +58,7 @@ def test_raid(self):
             self.levels.raid_level(None)
 
         ##
-        ## get_max_spares
+        # get_max_spares
         ##
         self.assertEqual(raid.RAID0.get_max_spares(1000), 0)
         self.assertEqual(raid.RAID1.get_max_spares(2), 0)
@@ -66,16 +67,16 @@ def test_raid(self):
             raid.RAID0.get_max_spares(0)
 
         ##
-        ## get_base_member_size
+        # get_base_member_size
         ##
-        self.assertEqual(raid.RAID0.get_base_member_size(4,2), 2)
-        self.assertEqual(raid.RAID1.get_base_member_size(4,2), 4)
-        self.assertEqual(raid.RAID4.get_base_member_size(4,4), 2)
-        self.assertEqual(raid.RAID5.get_base_member_size(4,4), 2)
-        self.assertEqual(raid.RAID6.get_base_member_size(4,4), 2)
-        self.assertEqual(raid.RAID10.get_base_member_size(4,4), 2)
-        self.assertEqual(raid.RAID10.get_base_member_size(4,5), 2)
-        self.assertEqual(raid.RAID10.get_base_member_size(5,5), 3)
+        self.assertEqual(raid.RAID0.get_base_member_size(4, 2), 2)
+        self.assertEqual(raid.RAID1.get_base_member_size(4, 2), 4)
+        self.assertEqual(raid.RAID4.get_base_member_size(4, 4), 2)
+        self.assertEqual(raid.RAID5.get_base_member_size(4, 4), 2)
+        self.assertEqual(raid.RAID6.get_base_member_size(4, 4), 2)
+        self.assertEqual(raid.RAID10.get_base_member_size(4, 4), 2)
+        self.assertEqual(raid.RAID10.get_base_member_size(4, 5), 2)
+        self.assertEqual(raid.RAID10.get_base_member_size(5, 5), 3)
 
         with self.assertRaises(errors.RaidError):
             raid.RAID10.get_base_member_size(4, 3)
@@ -83,7 +84,7 @@ def test_raid(self):
             raid.RAID10.get_base_member_size(-4, 4)
 
         ##
-        ## get_net_array_size
+        # get_net_array_size
         ##
         self.assertEqual(raid.RAID0.get_net_array_size(4, Size(2)), Size(8))
         self.assertEqual(raid.RAID1.get_net_array_size(4, Size(2)), Size(2))
@@ -94,7 +95,7 @@ def test_raid(self):
         self.assertEqual(raid.RAID10.get_net_array_size(5, Size(2)), Size(4))
 
         ##
-        ## get_recommended_stride
+        # get_recommended_stride
         ##
         self.assertIsNone(raid.RAID1.get_recommended_stride(32))
         self.assertIsNone(raid.RAID6.get_recommended_stride(32))
@@ -109,7 +110,7 @@ def test_raid(self):
             raid.RAID10.get_recommended_stride(1)
 
         ##
-        ## size
+        # size
         ##
         sizes = [Size("32MiB"), Size("128MiB"), Size("128MiB"), Size("64MiB")]
         for r in (l for l in raid.ALL_LEVELS if l not in (raid.Container, raid.Dup)):
@@ -134,16 +135,15 @@ def test_raid(self):
                 self.assertEqual(r.get_size(sizes, 4, Size("2MiB"), lambda x: Size("31MiB")), sum(sizes, Size(0)) - 4 * Size("31MiB"))
 
         ##
-        ## names
+        # names
         ##
         self.assertListEqual(raid.RAID0.names,
            ["raid0", "stripe", "RAID0", "0", 0])
         self.assertListEqual(raid.RAID10.names,
            ["raid10", "RAID10", "10", 10])
 
-
         ##
-        ## __init__
+        # __init__
         ##
         with self.assertRaisesRegex(errors.RaidError, "invalid RAID level"):
             self.levels_none.raid_level(10)
diff --git a/tests/devices_test/dependencies_test.py b/tests/devices_test/dependencies_test.py
index 888b256..9f2d82e 100644
--- a/tests/devices_test/dependencies_test.py
+++ b/tests/devices_test/dependencies_test.py
@@ -19,13 +19,15 @@
 
 from blivet.tasks import availability
 
+
 class DeviceDependenciesTestCase(unittest.TestCase):
+
     """Test external device dependencies. """
 
     def test_dependencies(self):
         dev1 = DiskDevice("name", fmt=get_format("mdmember"))
         dev2 = DiskDevice("other", fmt=get_format("mdmember"))
-        dev = MDRaidArrayDevice("dev", level="raid1", parents=[dev1,dev2])
+        dev = MDRaidArrayDevice("dev", level="raid1", parents=[dev1, dev2])
         luks = LUKSDevice("luks", parents=[dev])
 
         # a parent's dependencies are a subset of its child's.
@@ -35,7 +37,9 @@ def test_dependencies(self):
         # make sure that there's at least something in these dependencies
         self.assertGreater(len(luks.external_dependencies), 0)
 
+
 class MockingDeviceDependenciesTestCase(unittest.TestCase):
+
     """Test availability of external device dependencies. """
 
     def setUp(self):
@@ -82,7 +86,7 @@ def tearDown(self):
         availability.BLOCKDEV_DM_PLUGIN._method = self.dm_method
 
         availability.CACHE_AVAILABILITY = False
-        availability.BLOCKDEV_MDRAID_PLUGIN.available # pylint: disable=pointless-statement
-        availability.BLOCKDEV_DM_PLUGIN.available # pylint: disable=pointless-statement
+        availability.BLOCKDEV_MDRAID_PLUGIN.available  # pylint: disable=pointless-statement
+        availability.BLOCKDEV_DM_PLUGIN.available  # pylint: disable=pointless-statement
 
         availability.CACHE_AVAILABILITY = self.cache_availability
diff --git a/tests/devices_test/device_names_test.py b/tests/devices_test/device_names_test.py
index d5d2a75..2d7ae7f 100644
--- a/tests/devices_test/device_names_test.py
+++ b/tests/devices_test/device_names_test.py
@@ -6,7 +6,9 @@
 from blivet.devices import LVMLogicalVolumeDevice
 from blivet.devices import StorageDevice
 
+
 class DeviceNameTestCase(unittest.TestCase):
+
     """Test device name validation"""
 
     def test_storage_device(self):
diff --git a/tests/devices_test/device_packages_test.py b/tests/devices_test/device_packages_test.py
index 593d03b..ab708d1 100644
--- a/tests/devices_test/device_packages_test.py
+++ b/tests/devices_test/device_packages_test.py
@@ -8,14 +8,16 @@
 
 from blivet.formats import get_format
 
+
 class DevicePackagesTestCase(unittest.TestCase):
+
     """Test device name validation"""
 
     def test_packages(self):
         dev1 = DiskDevice("name", fmt=get_format("mdmember"))
 
         dev2 = DiskDevice("other", fmt=get_format("mdmember"))
-        dev = MDRaidArrayDevice("dev", level="raid1", parents=[dev1,dev2])
+        dev = MDRaidArrayDevice("dev", level="raid1", parents=[dev1, dev2])
         luks = LUKSDevice("luks", parents=[dev])
         packages = luks.packages
 
diff --git a/tests/devices_test/device_properties_test.py b/tests/devices_test/device_properties_test.py
index 696bf57..0887d89 100644
--- a/tests/devices_test/device_properties_test.py
+++ b/tests/devices_test/device_properties_test.py
@@ -36,6 +36,7 @@
 
 # pylint: disable=unnecessary-lambda
 
+
 def xform(func):
     """ Simple wrapper function that transforms a function that takes
         a precalculated value and a message to a function that takes
@@ -50,36 +51,38 @@ def xform(func):
     """
     return lambda d, a: func(getattr(d, a), a)
 
+
 class DeviceStateTestCase(unittest.TestCase):
+
     """A class which implements a simple method of checking the state
        of a device object.
     """
 
     def __init__(self, methodName='run_test'):
         self._state_functions = {
-           "current_size" : xform(lambda x, m: self.assertEqual(x, Size(0), m)),
-           "direct" : xform(self.assertTrue),
-           "exists" : xform(self.assertFalse),
-           "format" : xform(self.assertIsNotNone),
-           "format_args" : xform(lambda x, m: self.assertEqual(x, [], m)),
-           "is_disk" : xform(self.assertFalse),
-           "isleaf" : xform(self.assertTrue),
-           "major" : xform(lambda x, m: self.assertEqual(x, 0, m)),
-           "max_size" : xform(lambda x, m: self.assertEqual(x, Size(0), m)),
-           "media_present" : xform(self.assertTrue),
-           "minor" : xform(lambda x, m: self.assertEqual(x, 0, m)),
-           "parents" : xform(lambda x, m: self.assertEqual(len(x), 0, m) and
+           "current_size": xform(lambda x, m: self.assertEqual(x, Size(0), m)),
+           "direct": xform(self.assertTrue),
+           "exists": xform(self.assertFalse),
+           "format": xform(self.assertIsNotNone),
+           "format_args": xform(lambda x, m: self.assertEqual(x, [], m)),
+           "is_disk": xform(self.assertFalse),
+           "isleaf": xform(self.assertTrue),
+           "major": xform(lambda x, m: self.assertEqual(x, 0, m)),
+           "max_size": xform(lambda x, m: self.assertEqual(x, Size(0), m)),
+           "media_present": xform(self.assertTrue),
+           "minor": xform(lambda x, m: self.assertEqual(x, 0, m)),
+           "parents": xform(lambda x, m: self.assertEqual(len(x), 0, m) and
                                     self.assertIsInstance(x, ParentList, m)),
-           "partitionable" : xform(self.assertFalse),
-           "path" : xform(lambda x, m: self.assertRegex(x, "^/dev", m)),
-           "raw_device" : xform(self.assertIsNotNone),
-           "resizable" : xform(self.assertFalse),
-           "size" : xform(lambda x, m: self.assertEqual(x, Size(0), m)),
-           "status" : xform(self.assertFalse),
-           "sysfs_path" : xform(lambda x, m: self.assertEqual(x, "", m)),
-           "target_size" : xform(lambda x, m: self.assertEqual(x, Size(0), m)),
-           "type" : xform(lambda x, m: self.assertEqual(x, "mdarray", m)),
-           "uuid" : xform(self.assertIsNone)
+           "partitionable": xform(self.assertFalse),
+           "path": xform(lambda x, m: self.assertRegex(x, "^/dev", m)),
+           "raw_device": xform(self.assertIsNotNone),
+           "resizable": xform(self.assertFalse),
+           "size": xform(lambda x, m: self.assertEqual(x, Size(0), m)),
+           "status": xform(self.assertFalse),
+           "sysfs_path": xform(lambda x, m: self.assertEqual(x, "", m)),
+           "target_size": xform(lambda x, m: self.assertEqual(x, Size(0), m)),
+           "type": xform(lambda x, m: self.assertEqual(x, "mdarray", m)),
+           "uuid": xform(self.assertIsNone)
         }
         super(DeviceStateTestCase, self).__init__(methodName=methodName)
 
@@ -95,7 +98,7 @@ def state_check(self, device, **kwargs):
            If the value is None, then the test starts the debugger instead.
         """
         self.longMessage = True
-        for k,v in self._state_functions.items():
+        for k, v in self._state_functions.items():
             if k in kwargs:
                 test_func = kwargs[k]
                 if test_func is None:
@@ -107,7 +110,9 @@ def state_check(self, device, **kwargs):
             else:
                 v(device, k)
 
+
 class MDRaidArrayDeviceTestCase(DeviceStateTestCase):
+
     """Note that these tests postdate the code that they test.
        Therefore, they capture the behavior of the code as it is now,
        not necessarily its intended or correct behavior. See the initial
@@ -117,17 +122,17 @@ class MDRaidArrayDeviceTestCase(DeviceStateTestCase):
     def __init__(self, methodName='run_test'):
         super(MDRaidArrayDeviceTestCase, self).__init__(methodName=methodName)
         state_functions = {
-           "create_bitmap" : xform(lambda d, a: self.assertFalse),
-           "description" : xform(self.assertIsNotNone),
-           "format_class" : xform(self.assertIsNotNone),
-           "level" : xform(self.assertIsNone),
-           "mdadm_format_uuid" : xform(self.assertIsNone),
-           "member_devices" : xform(lambda x, m: self.assertEqual(x, 0, m)),
-           "members" : xform(lambda x, m: self.assertEqual(len(x), 0, m) and
+           "create_bitmap": xform(lambda d, a: self.assertFalse),
+           "description": xform(self.assertIsNotNone),
+           "format_class": xform(self.assertIsNotNone),
+           "level": xform(self.assertIsNone),
+           "mdadm_format_uuid": xform(self.assertIsNone),
+           "member_devices": xform(lambda x, m: self.assertEqual(x, 0, m)),
+           "members": xform(lambda x, m: self.assertEqual(len(x), 0, m) and
                                     self.assertIsInstance(x, list, m)),
-           "metadata_version" : xform(lambda x, m: self.assertEqual(x, "default", m)),
-           "spares" : xform(lambda x, m: self.assertEqual(x, 0, m)),
-           "total_devices" : xform(lambda x, m: self.assertEqual(x, 0, m))
+           "metadata_version": xform(lambda x, m: self.assertEqual(x, "default", m)),
+           "spares": xform(lambda x, m: self.assertEqual(x, 0, m)),
+           "total_devices": xform(lambda x, m: self.assertEqual(x, 0, m))
         }
         self._state_functions.update(state_functions)
 
@@ -187,7 +192,6 @@ def setUp(self):
 
         self.dev8 = MDRaidArrayDevice("dev8", level=1, exists=True)
 
-
         parents_1 = [
            DiskDevice("name1", fmt=get_format("mdmember")),
            DiskDevice("name2", fmt=get_format("mdmember"))
@@ -353,7 +357,7 @@ def test_mdraid_array_device_init(self):
         """
 
         ##
-        ## level tests
+        # level tests
         ##
         self.state_check(self.dev1,
            level=xform(lambda x, m: self.assertEqual(x.name, "container", m)),
@@ -393,16 +397,15 @@ def test_mdraid_array_device_init(self):
            parents=xform(lambda x, m: self.assertEqual(len(x), 4, m)))
 
         ##
-        ## existing device tests
+        # existing device tests
         ##
         self.state_check(self.dev8,
            exists=xform(self.assertTrue),
            level=xform(lambda x, m: self.assertEqual(x.number, 1, m)),
            metadata_version=xform(self.assertIsNone))
 
-
         ##
-        ## mdbiosraidarray tests
+        # mdbiosraidarray tests
         ##
         self.state_check(self.dev9,
            create_bitmap=xform(self.assertFalse),
@@ -415,10 +418,10 @@ def test_mdraid_array_device_init(self):
            parents=xform(lambda x, m: self.assertEqual(len(x), 1, m)),
            partitionable=xform(self.assertTrue),
            total_devices=xform(lambda x, m: self.assertEqual(x, 2, m)),
-           type = xform(lambda x, m: self.assertEqual(x, "mdbiosraidarray", m)))
+           type=xform(lambda x, m: self.assertEqual(x, "mdbiosraidarray", m)))
 
         ##
-        ## mdcontainer tests
+        # mdcontainer tests
         ##
         dev9_container = self.dev9.parents[0]
         self.state_check(dev9_container,
@@ -435,10 +438,10 @@ def test_mdraid_array_device_init(self):
            parents=xform(lambda x, m: self.assertEqual(len(x), 2, m)),
            partitionable=xform(self.assertFalse),
            total_devices=xform(lambda x, m: self.assertEqual(x, 2, m)),
-           type = xform(lambda x, m: self.assertEqual(x, "mdcontainer", m)))
+           type=xform(lambda x, m: self.assertEqual(x, "mdcontainer", m)))
 
         ##
-        ## size tests
+        # size tests
         ##
         self.state_check(self.dev10,
            create_bitmap=xform(self.assertFalse),
@@ -557,13 +560,15 @@ def test_mdraid_array_device_init(self):
 
     def test_mdraid_array_device_methods(self):
         """Test for method calls on initialized MDRaidDevices."""
-        with self.assertRaisesRegex(DeviceError, "invalid" ):
+        with self.assertRaisesRegex(DeviceError, "invalid"):
             self.dev7.level = "junk"
 
-        with self.assertRaisesRegex(DeviceError, "invalid" ):
+        with self.assertRaisesRegex(DeviceError, "invalid"):
             self.dev7.level = None
 
+
 class BTRFSDeviceTestCase(DeviceStateTestCase):
+
     """Note that these tests postdate the code that they test.
        Therefore, they capture the behavior of the code as it is now,
        not necessarily its intended or correct behavior. See the initial
@@ -573,12 +578,12 @@ class BTRFSDeviceTestCase(DeviceStateTestCase):
     def __init__(self, methodName='run_test'):
         super(BTRFSDeviceTestCase, self).__init__(methodName=methodName)
         state_functions = {
-           "data_level" : lambda d, a: self.assertFalse(hasattr(d,a)),
-           "fstab_spec" : xform(self.assertIsNotNone),
-           "media_present" : xform(self.assertTrue),
-           "metadata_level" : lambda d, a: self.assertFalse(hasattr(d, a)),
-           "type" : xform(lambda x, m: self.assertEqual(x, "btrfs", m)),
-           "vol_id" : xform(lambda x, m: self.assertEqual(x, btrfs.MAIN_VOLUME_ID, m))}
+           "data_level": lambda d, a: self.assertFalse(hasattr(d, a)),
+           "fstab_spec": xform(self.assertIsNotNone),
+           "media_present": xform(self.assertTrue),
+           "metadata_level": lambda d, a: self.assertFalse(hasattr(d, a)),
+           "type": xform(lambda x, m: self.assertEqual(x, "btrfs", m)),
+           "vol_id": xform(lambda x, m: self.assertEqual(x, btrfs.MAIN_VOLUME_ID, m))}
         self._state_functions.update(state_functions)
 
     def setUp(self):
@@ -667,11 +672,11 @@ def test_btrfsdevice_methods(self):
         """Test for method calls on initialized BTRFS Devices."""
         # volumes do not have ancestor volumes
         with self.assertRaises(AttributeError):
-            self.dev1.volume # pylint: disable=no-member,pointless-statement
+            self.dev1.volume  # pylint: disable=no-member,pointless-statement
 
         # subvolumes do not have default subvolumes
         with self.assertRaises(AttributeError):
-            self.dev2.default_sub_volume # pylint: disable=no-member,pointless-statement
+            self.dev2.default_sub_volume  # pylint: disable=no-member,pointless-statement
 
         self.assertIsNotNone(self.dev2.volume)
 
@@ -728,7 +733,9 @@ def test_btrfssnap_shot_device_init(self):
         self.assertEqual(snap.depends_on(vol), True)
         self.assertEqual(vol.depends_on(snap), False)
 
+
 class LVMLogicalVolumeDeviceTestCase(DeviceStateTestCase):
+
     def __init__(self, methodName="run_test"):
         super(LVMLogicalVolumeDeviceTestCase, self).__init__(methodName=methodName)
         state_functions = {
diff --git a/tests/devices_test/lvm_test.py b/tests/devices_test/lvm_test.py
index f945062..2094d6a 100644
--- a/tests/devices_test/lvm_test.py
+++ b/tests/devices_test/lvm_test.py
@@ -24,8 +24,10 @@
    StorageDevice
 ]
 
+
 @unittest.skipUnless(not any(x.unavailable_type_dependencies() for x in DEVICE_CLASSES), "some unsupported device classes required for this test")
 class LVMDeviceTest(unittest.TestCase):
+
     def test_lvmsnap_shot_device_init(self):
         pv = StorageDevice("pv1", fmt=blivet.formats.get_format("lvmpv"),
                            size=Size("1 GiB"))
diff --git a/tests/devices_test/network_test.py b/tests/devices_test/network_test.py
index bbe17bf..d72b8f3 100644
--- a/tests/devices_test/network_test.py
+++ b/tests/devices_test/network_test.py
@@ -7,10 +7,13 @@
 
 from blivet.formats import get_format
 
+
 class FakeNetDev(StorageDevice, NetworkStorageDevice):
     _type = "fakenetdev"
 
+
 class NetDevMountOptionTestCase(unittest.TestCase):
+
     def test_net_dev_setting(self):
         """ Verify netdev mount option setting after format assignment. """
         netdev = FakeNetDev("net1")
diff --git a/tests/devices_test/partition_test.py b/tests/devices_test/partition_test.py
index 2035b44..ee2227c 100644
--- a/tests/devices_test/partition_test.py
+++ b/tests/devices_test/partition_test.py
@@ -12,6 +12,7 @@
 from blivet.size import Size
 from blivet.util import sparsetmpfile
 
+
 class PartitionDeviceTestCase(unittest.TestCase):
 
     def test_target_size(self):
@@ -113,7 +114,7 @@ def test_min_max_size_alignment(self):
             device.format._resizable = True
 
             ##
-            ## min_size
+            # min_size
             ##
 
             # The end sector based only on format min size should be unaligned.
@@ -133,7 +134,7 @@ def test_min_max_size_alignment(self):
                 True)
 
             ##
-            ## max_size
+            # max_size
             ##
 
             # Add a partition starting three sectors past an aligned sector and
@@ -193,6 +194,6 @@ def test_extended_min_size(self):
             logical_device.parted_partition = logical
 
             # logical partition present --> min size should be based on its end sector
-            end_free = (extended_end - logical_end)*sector_size
+            end_free = (extended_end - logical_end) * sector_size
             self.assertEqual(extended_device.min_size,
                              extended_device.align_target_size(extended_device.current_size - end_free))
diff --git a/tests/devices_test/size_test.py b/tests/devices_test/size_test.py
index 2a2e6d9..7d546f2 100644
--- a/tests/devices_test/size_test.py
+++ b/tests/devices_test/size_test.py
@@ -6,7 +6,9 @@
 from blivet.formats import get_format
 from blivet.size import Size
 
+
 class StorageDeviceSizeTest(unittest.TestCase):
+
     def _get_device(self, *args, **kwargs):
         return StorageDevice(*args, **kwargs)
 
@@ -15,7 +17,7 @@ def test_size_setter(self):
         new_size = Size('2 GiB')
 
         ##
-        ## setter sets the size
+        # setter sets the size
         ##
         dev = self._get_device('sizetest', size=initial_size)
         self.assertEqual(dev.size, initial_size)
@@ -24,14 +26,14 @@ def test_size_setter(self):
         self.assertEqual(dev.size, new_size)
 
         ##
-        ## setter raises exn if size outside of format limits
+        # setter raises exn if size outside of format limits
         ##
         dev.format._max_size = Size("5 GiB")
         with self.assertRaises(errors.DeviceError):
             dev.size = Size("6 GiB")
 
         ##
-        ## new formats' min size is checked against device size
+        # new formats' min size is checked against device size
         ##
         fmt = get_format(None)
         fmt._min_size = Size("10 GiB")
@@ -43,7 +45,7 @@ def test_size_setter(self):
         dev.format = fmt
 
         ##
-        ## new formats' max size is checked against device size
+        # new formats' max size is checked against device size
         ##
         fmt = get_format(None)
         fmt._max_size = Size("10 MiB")
@@ -60,7 +62,7 @@ def test_size_getter(self):
         dev = self._get_device('sizetest', size=initial_size)
 
         ##
-        ## getter returns the size in the basic case for non-existing devices
+        # getter returns the size in the basic case for non-existing devices
         ##
         self.assertEqual(dev.size, initial_size)
 
@@ -68,12 +70,12 @@ def test_size_getter(self):
         dev = self._get_device('sizetest', size=initial_size, exists=True)
 
         ##
-        ## getter returns the size in the basic case for existing devices
+        # getter returns the size in the basic case for existing devices
         ##
         self.assertEqual(dev.size, initial_size)
 
         ##
-        ## size does not reflect target size for non-resizable devices
+        # size does not reflect target size for non-resizable devices
         ##
         # bypass the setter since the min/max will be the current size for a
         # non-resizable device
@@ -81,18 +83,18 @@ def test_size_getter(self):
         self.assertEqual(dev.size, initial_size)
 
         ##
-        ## getter returns target size when device is resizable and target size
-        ## is non-zero
+        # getter returns target size when device is resizable and target size
+        # is non-zero
         ##
         dev._resizable = True
-        dev.target_size = new_size # verify that the target size setter works
+        dev.target_size = new_size  # verify that the target size setter works
         self.assertEqual(dev.size, new_size)
         self.assertEqual(dev.size, dev.target_size)
         self.assertNotEqual(dev._size, dev.target_size)
 
         ##
-        ## getter returns current size when device is resizable and target size
-        ## is zero
+        # getter returns current size when device is resizable and target size
+        # is zero
         ##
         dev.target_size = Size(0)
         self.assertEqual(dev.size, initial_size)
diff --git a/tests/devicetree_test.py b/tests/devicetree_test.py
index 26bff3b..cd8bd85 100644
--- a/tests/devicetree_test.py
+++ b/tests/devicetree_test.py
@@ -21,7 +21,9 @@
             - raid thin pool
 """
 
+
 class DeviceTreeTestCase(unittest.TestCase):
+
     def test_resolve_device(self):
         dt = DeviceTree()
 
@@ -53,6 +55,7 @@ def test_resolve_device(self):
 
         self.assertEqual(dt.resolve_device(dev3.name), dev3)
 
+
 def recursive_getattr(x, attr, default=None):
     """ Resolve a possibly-dot-containing attribute name. """
     val = x
@@ -64,7 +67,9 @@ def recursive_getattr(x, attr, default=None):
 
     return val
 
+
 class BlivetResetTestCase(ImageBackedTestCase):
+
     """ A class to test the results of Blivet.reset (and DeviceTree.populate).
 
         Create a device stack on disk images, catalog a set of attributes of
@@ -86,7 +91,7 @@ def collect_expected_data(self):
                             if d.disks and
                                set(d.disks).issubset(set(self.blivet.disks))):
             attr_dict = {}
-            device._parted_device = None # force update from disk for size, &c
+            device._parted_device = None  # force update from disk for size, &c
             for attr in self._validate_attrs:
                 attr_dict[attr] = recursive_getattr(device, attr)
 
@@ -120,7 +125,7 @@ def skip_attr(self, device, attr):
         return False
 
     def find_device(self, attr_dict):
-        devices = self.blivet.devices #+ self.blivet.devicetree._hidden
+        devices = self.blivet.devices  # + self.blivet.devicetree._hidden
         device = None
         for check in devices:
             match = all(attr_dict[attr] == recursive_getattr(check, attr)
@@ -159,8 +164,11 @@ def run_test(self):
                         msg=("attribute mismatch for %s: %s (%s/%s)"
                              % (device_id, attr, expected, actual)))
 
+
 class LVMTestCase(BlivetResetTestCase):
+
     """ Test that the devicetree can populate with the product of autopart. """
+
     def _set_up_storage(self):
         # This isn't exactly autopart, but it should be plenty close to it.
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM,
@@ -171,7 +179,9 @@ def _set_up_storage(self):
                                   None,
                                   disks=self.blivet.disks[:])
 
+
 class LVMSnapShotTestCase(BlivetResetTestCase):
+
     def _set_up_storage(self):
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM,
                                   Size("1 GiB"),
@@ -181,7 +191,7 @@ def _set_up_storage(self):
                                   container_size=devicefactory.SIZE_POLICY_MAX)
 
     def setUp(self):
-        super(BlivetResetTestCase, self).setUp() # pylint: disable=bad-super-call
+        super(BlivetResetTestCase, self).setUp()  # pylint: disable=bad-super-call
         root = self.blivet.lvs[0]
         snap = LVMSnapShotDevice("rootsnap1", parents=[root.vg], origin=root,
                                  size=Size("768MiB"))
@@ -193,6 +203,7 @@ def setUp(self):
 
 
 class LVMThinpTestCase(BlivetResetTestCase):
+
     def _set_up_storage(self):
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM,
                                   Size("500 MiB"),
@@ -203,7 +214,9 @@ def _set_up_storage(self):
                                   label="ROOT",
                                   disks=self.blivet.disks[:])
 
+
 class LVMThinSnapShotTestCase(LVMThinpTestCase):
+
     def _set_up_storage(self):
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM_THINP,
                                   Size("1 GiB"),
@@ -211,7 +224,7 @@ def _set_up_storage(self):
                                   disks=self.blivet.disks[:])
 
     def setUp(self):
-        super(BlivetResetTestCase, self).setUp() # pylint: disable=bad-super-call
+        super(BlivetResetTestCase, self).setUp()  # pylint: disable=bad-super-call
 
         root = self.blivet.thinlvs[0]
         snap = LVMThinSnapShotDevice("rootsnap1", parents=[root.pool],
@@ -222,7 +235,9 @@ def setUp(self):
         self.device_attr_dicts = []
         self.collect_expected_data()
 
+
 class LVMRaidTestCase(BlivetResetTestCase):
+
     def _set_up_storage(self):
         # This isn't exactly autopart, but it should be plenty close to it.
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM,
@@ -231,7 +246,7 @@ def _set_up_storage(self):
                           container_size=devicefactory.SIZE_POLICY_MAX)
 
     def setUp(self):
-        super(BlivetResetTestCase, self).setUp() # pylint: disable=bad-super-call
+        super(BlivetResetTestCase, self).setUp()  # pylint: disable=bad-super-call
         vg_name = self.blivet.vgs[0].name
         util.run_program(["lvcreate", "-n", "raid", "--type", "raid1",
                           "-L", "100%", vg_name])
@@ -241,6 +256,7 @@ def setUp(self):
 
 @unittest.skip("temporarily disabled due to mdadm issues")
 class MDRaid0TestCase(BlivetResetTestCase):
+
     """ Verify correct detection of MD RAID0 arrays. """
     level = "raid0"
     _validate_attrs = BlivetResetTestCase._validate_attrs + ["level", "spares"]
@@ -250,7 +266,7 @@ def set_up_disks(self):
         disk_count = level.min_members
         self.disks = dict()
         for i in range(disk_count):
-            name = "disk%d" % (i+1)
+            name = "disk%d" % (i + 1)
             size = Size("2 GiB")
             self.disks[name] = size
 
@@ -300,9 +316,11 @@ def _set_up_storage(self):
                                            label="vdefault",
                                            name="default")
 
+
 @unittest.skip("temporarily disabled due to mdadm issues")
 class LVMOnMDTestCase(BlivetResetTestCase):
     # This also tests raid1 with the default metadata version.
+
     def _set_up_storage(self):
         self.blivet.factory_device(devicefactory.DEVICE_TYPE_LVM,
                                   Size("200 MiB"),
diff --git a/tests/formats_test/device_test.py b/tests/formats_test/device_test.py
index 0f4c9d2..21abbf3 100644
--- a/tests/formats_test/device_test.py
+++ b/tests/formats_test/device_test.py
@@ -2,6 +2,7 @@
 
 import blivet
 
+
 class DeviceFormatTestCase(unittest.TestCase):
 
     def test_formats(self):
@@ -50,6 +51,7 @@ def test_formats(self):
                 with self.assertRaises(ValueError):
                     an_fs.device = garbage
 
+
 class DeviceValueTestCase(unittest.TestCase):
 
     def test_value(self):
diff --git a/tests/formats_test/disklabel_test.py b/tests/formats_test/disklabel_test.py
index ef67643..4c1a317 100644
--- a/tests/formats_test/disklabel_test.py
+++ b/tests/formats_test/disklabel_test.py
@@ -12,7 +12,9 @@
 
 patch = mock.patch
 
+
 class DiskLabelTestCase(unittest.TestCase):
+
     @patch("blivet.formats.disklabel.DiskLabel.fresh_parted_disk", None)
     def test_get_alignment(self):
         dl = blivet.formats.disklabel.DiskLabel()
@@ -25,7 +27,7 @@ def test_get_alignment(self):
         dl._parted_disk.partitionAlignment = disklabel_alignment
 
         # 1 MiB grain size
-        minimal_alignment = parted.Alignment(grainSize = 2048, offset=0)
+        minimal_alignment = parted.Alignment(grainSize=2048, offset=0)
         dl._parted_device.minimumAlignment = minimal_alignment
 
         # 4 MiB grain size
diff --git a/tests/formats_test/fs_test.py b/tests/formats_test/fs_test.py
index 6026216..5da2c4c 100644
--- a/tests/formats_test/fs_test.py
+++ b/tests/formats_test/fs_test.py
@@ -9,88 +9,115 @@
 
 from . import fstesting
 
+
 class Ext2FSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.Ext2FS
 
+
 class Ext3FSTestCase(Ext2FSTestCase):
     _fs_class = fs.Ext3FS
 
+
 class Ext4FSTestCase(Ext3FSTestCase):
     _fs_class = fs.Ext4FS
 
+
 class FATFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.FATFS
 
+
 class EFIFSTestCase(FATFSTestCase):
     _fs_class = fs.EFIFS
 
+
 class BTRFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.BTRFS
 
+
 @unittest.skip("Unable to create GFS2 filesystem.")
 class GFS2TestCase(fstesting.FSAsRoot):
     _fs_class = fs.GFS2
 
+
 class JFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.JFS
 
+
 class ReiserFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.ReiserFS
 
+
 class XFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.XFS
 
+
 class HFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.HFS
 
+
 class AppleBootstrapFSTestCase(HFSTestCase):
     _fs_class = fs.AppleBootstrapFS
 
+
 class HFSPlusTestCase(fstesting.FSAsRoot):
     _fs_class = fs.HFSPlus
 
+
 class MacEFIFSTestCase(HFSPlusTestCase):
     _fs_class = fs.MacEFIFS
 
+
 @unittest.skip("Unable to create because NTFS._formattable is False.")
 class NTFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.NTFS
 
+
 @unittest.skip("Unable to create because device fails device_check().")
 class NFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.NFS
 
+
 class NFSv4TestCase(NFSTestCase):
     _fs_class = fs.NFSv4
 
+
 class Iso9660FS(fstesting.FSAsRoot):
     _fs_class = fs.Iso9660FS
 
+
 @unittest.skip("Too strange to test using this framework.")
 class NoDevFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.NoDevFS
 
+
 class DevPtsFSTestCase(NoDevFSTestCase):
     _fs_class = fs.DevPtsFS
 
+
 class ProcFSTestCase(NoDevFSTestCase):
     _fs_class = fs.ProcFS
 
+
 class SysFSTestCase(NoDevFSTestCase):
     _fs_class = fs.SysFS
 
+
 class TmpFSTestCase(NoDevFSTestCase):
     _fs_class = fs.TmpFS
 
+
 class SELinuxFSTestCase(NoDevFSTestCase):
     _fs_class = fs.SELinuxFS
 
+
 class USBFSTestCase(NoDevFSTestCase):
     _fs_class = fs.USBFS
 
+
 class BindFSTestCase(fstesting.FSAsRoot):
     _fs_class = fs.BindFS
 
+
 class SimpleTmpFSTestCase(loopbackedtestcase.LoopBackedTestCase):
 
     def __init__(self, methodName='run_test'):
@@ -104,6 +131,7 @@ def test_simple(self):
         self.assertEqual(an_fs.device, "tmpfs")
         self.assertTrue(an_fs.test_mount())
 
+
 class ResizeTmpFSTestCase(loopbackedtestcase.LoopBackedTestCase):
 
     def __init__(self, methodName='run_test'):
@@ -135,6 +163,6 @@ def test_shrink(self):
     def tearDown(self):
         try:
             self.an_fs.unmount()
-        except Exception: # pylint: disable=broad-except
+        except Exception:  # pylint: disable=broad-except
             pass
         os.rmdir(self.mountpoint)
diff --git a/tests/formats_test/fslabeling.py b/tests/formats_test/fslabeling.py
index ccf23f9..47d817a 100644
--- a/tests/formats_test/fslabeling.py
+++ b/tests/formats_test/fslabeling.py
@@ -6,14 +6,15 @@
 from blivet.errors import FSError, FSReadLabelError
 from blivet.size import Size
 
+
 @add_metaclass(abc.ABCMeta)
 class LabelingAsRoot(loopbackedtestcase.LoopBackedTestCase):
+
     """Tests various aspects of labeling a filesystem where there
        is no easy way to read the filesystem's label once it has been
        set and where the filesystem can not be relabeled.
     """
 
-
     _fs_class = abc.abstractproperty(
        doc="The class of the filesystem being tested on.")
 
@@ -67,7 +68,9 @@ def test_creating_empty(self):
         an_fs = self._fs_class(device=self.loop_devices[0], label="")
         self.assertIsNone(an_fs.create())
 
+
 class LabelingWithRelabeling(LabelingAsRoot):
+
     """Tests labeling where it is possible to relabel.
     """
 
@@ -103,7 +106,9 @@ def test_labeling(self):
         with self.assertRaisesRegex(FSError, "bad label format"):
             an_fs.write_label()
 
+
 class CompleteLabelingAsRoot(LabelingAsRoot):
+
     """Tests where it is possible to read the label and to relabel
        an existing filesystem.
     """
diff --git a/tests/formats_test/fstesting.py b/tests/formats_test/fstesting.py
index f4dc563..407b051 100644
--- a/tests/formats_test/fstesting.py
+++ b/tests/formats_test/fstesting.py
@@ -10,6 +10,7 @@
 from blivet.size import Size, ROUND_DOWN
 from blivet.formats import fs
 
+
 def can_resize(an_fs):
     """ Returns True if this filesystem has all necessary resizing tools
         available.
@@ -19,6 +20,7 @@ def can_resize(an_fs):
     resize_tasks = (an_fs._resize, an_fs._sizeinfo, an_fs._minsize)
     return not any(t.availability_errors for t in resize_tasks)
 
+
 @add_metaclass(abc.ABCMeta)
 class FSAsRoot(loopbackedtestcase.LoopBackedTestCase):
 
diff --git a/tests/formats_test/init_test.py b/tests/formats_test/init_test.py
index c7d15a2..cf9a736 100644
--- a/tests/formats_test/init_test.py
+++ b/tests/formats_test/init_test.py
@@ -3,18 +3,19 @@
 
 import blivet.formats as formats
 
+
 class FormatsTestCase(unittest.TestCase):
 
     def test_formats_methods(self):
         ##
-        ## get_device_format_class
+        # get_device_format_class
         ##
         format_pairs = {
-           None : formats.DeviceFormat,
-           "bogus" : None,
-           "biosboot" : formats.biosboot.BIOSBoot,
-           "BIOS Boot" : formats.biosboot.BIOSBoot,
-           "nodev" : formats.fs.NoDevFS
+           None: formats.DeviceFormat,
+           "bogus": None,
+           "biosboot": formats.biosboot.BIOSBoot,
+           "BIOS Boot": formats.biosboot.BIOSBoot,
+           "nodev": formats.fs.NoDevFS
            }
         format_names = format_pairs.keys()
         format_values = [format_pairs[k] for k in format_names]
@@ -23,16 +24,16 @@ def test_formats_methods(self):
            [formats.get_device_format_class(x) for x in format_names],
            format_values)
 
-        ## A DeviceFormat object is returned if lookup by name fails
+        # A DeviceFormat object is returned if lookup by name fails
         for name in format_names:
             self.assertIs(formats.get_format(name).__class__,
                formats.DeviceFormat if format_pairs[name] is None else format_pairs[name])
-        ## Consecutively constructed DeviceFormat objects have consecutive ids
+        # Consecutively constructed DeviceFormat objects have consecutive ids
         names = [key for key in format_pairs.keys() if format_pairs[key] is not None]
         objs = [formats.get_format(name) for name in names]
         ids = [obj.id for obj in objs]
         self.assertEqual(ids, list(range(ids[0], ids[0] + len(ids))))
 
-        ## Copy or deepcopy should preserve the id
+        # Copy or deepcopy should preserve the id
         self.assertEqual(ids, [copy.copy(obj).id for obj in objs])
         self.assertEqual(ids, [copy.deepcopy(obj).id for obj in objs])
diff --git a/tests/formats_test/labeling_test.py b/tests/formats_test/labeling_test.py
index dae3795..e256920 100644
--- a/tests/formats_test/labeling_test.py
+++ b/tests/formats_test/labeling_test.py
@@ -7,7 +7,9 @@
 
 from . import fslabeling
 
+
 class InitializationTestCase(unittest.TestCase):
+
     """Test FS object initialization."""
 
     def test_labels(self):
@@ -29,18 +31,18 @@ def test_labels(self):
         self.assertFalse(fs.ReiserFS().label_format_ok("root___filesystem"))
         self.assertTrue(fs.ReiserFS().label_format_ok("root__filesystem"))
 
-        #XFS has a maximum length 12 and does not allow spaces
+        # XFS has a maximum length 12 and does not allow spaces
         self.assertFalse(fs.XFS().label_format_ok("root_filesyst"))
         self.assertFalse(fs.XFS().label_format_ok("root file"))
         self.assertTrue(fs.XFS().label_format_ok("root_filesys"))
 
-        #HFS has a maximum length of 27, minimum length of 1, and does not allow colons
+        # HFS has a maximum length of 27, minimum length of 1, and does not allow colons
         self.assertFalse(fs.HFS().label_format_ok("n" * 28))
         self.assertFalse(fs.HFS().label_format_ok("root:file"))
         self.assertFalse(fs.HFS().label_format_ok(""))
         self.assertTrue(fs.HFS().label_format_ok("n" * 27))
 
-        #HFSPlus has a maximum length of 128, minimum length of 1, and does not allow colons
+        # HFSPlus has a maximum length of 128, minimum length of 1, and does not allow colons
         self.assertFalse(fs.HFSPlus().label_format_ok("n" * 129))
         self.assertFalse(fs.HFSPlus().label_format_ok("root:file"))
         self.assertFalse(fs.HFSPlus().label_format_ok(""))
@@ -52,42 +54,51 @@ def test_labels(self):
 
         # all devices are permitted to be passed a label argument of None
         # some will ignore it completely
-        for _k, v  in device_formats.items():
+        for _k, v in device_formats.items():
             self.assertIsNotNone(v(label=None))
 
+
 class XFSTestCase(fslabeling.CompleteLabelingAsRoot):
     _fs_class = fs.XFS
     _invalid_label = "root filesystem"
 
+
 class FATFSTestCase(fslabeling.CompleteLabelingAsRoot):
     _fs_class = fs.FATFS
     _invalid_label = "root___filesystem"
 
+
 class Ext2FSTestCase(fslabeling.CompleteLabelingAsRoot):
     _fs_class = fs.Ext2FS
     _invalid_label = "root___filesystem"
 
+
 class JFSTestCase(fslabeling.LabelingWithRelabeling):
     _fs_class = fs.JFS
     _invalid_label = "root___filesystem"
 
+
 class ReiserFSTestCase(fslabeling.LabelingWithRelabeling):
     _fs_class = fs.ReiserFS
     _invalid_label = "root___filesystem"
 
+
 class HFSTestCase(fslabeling.LabelingAsRoot):
     _fs_class = fs.HFS
     _invalid_label = "n" * 28
 
+
 class HFSPlusTestCase(fslabeling.LabelingAsRoot):
     _fs_class = fs.HFSPlus
     _invalid_label = "n" * 129
 
+
 @unittest.skip("Unable to create NTFS filesystem.")
 class NTFSTestCase(fslabeling.CompleteLabelingAsRoot):
     _fs_class = fs.NTFS
     _invalid_label = "n" * 129
 
+
 class LabelingSwapSpaceTestCase(loopbackedtestcase.LoopBackedTestCase):
 
     def test_labeling(self):
diff --git a/tests/formats_test/selinux_test.py b/tests/formats_test/selinux_test.py
index 403e7f4..f63d488 100644
--- a/tests/formats_test/selinux_test.py
+++ b/tests/formats_test/selinux_test.py
@@ -8,8 +8,10 @@
 import blivet.formats.fs as fs
 from blivet.size import Size
 
+
 @unittest.skipUnless(selinux.is_selinux_enabled() == 1, "SELinux is disabled")
 class SELinuxContextTestCase(loopbackedtestcase.LoopBackedTestCase):
+
     """Testing SELinux contexts.
     """
 
diff --git a/tests/imagebackedtestcase.py b/tests/imagebackedtestcase.py
index 4436553..c070991 100644
--- a/tests/imagebackedtestcase.py
+++ b/tests/imagebackedtestcase.py
@@ -7,10 +7,12 @@
 from blivet.size import Size
 from blivet.flags import flags
 
+
 @unittest.skip("disabled until it can be converted to run in a vm")
 @unittest.skipUnless(os.environ.get("JENKINS_HOME"), "jenkins only test")
 @unittest.skipUnless(os.geteuid() == 0, "requires root access")
 class ImageBackedTestCase(unittest.TestCase):
+
     """ A class to encapsulate testing of blivet using block devices.
 
         The basic idea is you create some scratch block devices and then run
@@ -29,8 +31,8 @@ class ImageBackedTestCase(unittest.TestCase):
     initialize_disks = True
     """ Whether or not to create a disklabel on the disks. """
 
-    disks = { "disk1": Size("2 GiB"),
-              "disk2": Size("2 GiB") }
+    disks = {"disk1": Size("2 GiB"),
+              "disk2": Size("2 GiB")}
     """ The names and sizes of the disk images to create/use. """
 
     def set_up_disks(self):
diff --git a/tests/loopbackedtestcase.py b/tests/loopbackedtestcase.py
index 1c27caf..2bb96c4 100644
--- a/tests/loopbackedtestcase.py
+++ b/tests/loopbackedtestcase.py
@@ -5,6 +5,7 @@
 
 from blivet.size import Size
 
+
 def make_store(file_name, num_blocks=102400, block_size=1024):
     """ Set up the backing store for a loop device.
 
@@ -23,6 +24,7 @@ def make_store(file_name, num_blocks=102400, block_size=1024):
     if rc:
         raise OSError("dd failed creating the file %s" % file_name)
 
+
 def make_loop_dev(device_name, file_name):
     """ Set up a loop device with a backing store.
 
@@ -40,6 +42,7 @@ def make_loop_dev(device_name, file_name):
     if rc:
         raise OSError("losetup failed setting up the loop device %s" % device_name)
 
+
 def remove_loop_dev(device_name):
     proc = subprocess.Popen(["losetup", "-d", device_name],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -51,6 +54,7 @@ def remove_loop_dev(device_name):
     if rc:
         raise OSError("losetup failed removing the loop device %s" % device_name)
 
+
 def get_free_loop_dev():
     """ Get the name of the free loop device that losetup reports.
 
@@ -77,6 +81,7 @@ def get_free_loop_dev():
 
     return out.decode("utf-8")
 
+
 @unittest.skipUnless(os.geteuid() == 0, "requires root privileges")
 class LoopBackedTestCase(unittest.TestCase):
 
diff --git a/tests/parentlist_test.py b/tests/parentlist_test.py
index 5d052a5..0c3f81f 100644
--- a/tests/parentlist_test.py
+++ b/tests/parentlist_test.py
@@ -3,7 +3,9 @@
 from blivet.devices import ParentList
 from blivet.devices import Device
 
+
 class ParentListTestCase(unittest.TestCase):
+
     def test_parent_list(self):
         items = list(range(5))
         length = len(items)
diff --git a/tests/partitioning_test.py b/tests/partitioning_test.py
index 30d54ca..05ed22e 100644
--- a/tests/partitioning_test.py
+++ b/tests/partitioning_test.py
@@ -36,7 +36,9 @@
                    'gpt': (128, False, 0),
                    'mac': (62, False, 0)}
 
+
 class PartitioningTestCase(unittest.TestCase):
+
     def get_disk(self, disk_type, primary_count=0,
                 has_extended=False, logical_count=0):
         """ Return a mock representing a parted.Disk. """
@@ -56,7 +58,7 @@ def get_disk(self, disk_type, primary_count=0,
 
         # logical partitions
         disk.getMaxLogicalPartitions = Mock(return_value=max_logicals)
-        disk.getLogicalPartitions = Mock(return_value=[0]*logical_count)
+        disk.getLogicalPartitions = Mock(return_value=[0] * logical_count)
 
         return disk
 
@@ -172,14 +174,14 @@ def test_add_partition(self):
             #
             opt_str = 'parted.Device.optimumAlignment'
             min_str = 'parted.Device.minimumAlignment'
-            opt_al = parted.Alignment(offset=0, grainSize=8192) # 4 MiB
-            min_al = parted.Alignment(offset=0, grainSize=2048) # 1 MiB
+            opt_al = parted.Alignment(offset=0, grainSize=8192)  # 4 MiB
+            min_al = parted.Alignment(offset=0, grainSize=2048)  # 1 MiB
             with patch(opt_str, opt_al) as optimal, patch(min_str, min_al) as minimal:
                 optimal_end = disk.format.get_end_alignment(alignment=optimal)
                 minimal_end = disk.format.get_end_alignment(alignment=minimal)
 
                 sector_size = Size(disk.format.sector_size)
-                length = 4096 # 2 MiB
+                length = 4096  # 2 MiB
                 size = Size(sector_size * length)
                 part = add_partition(disk.format, free, parted.PARTITION_NORMAL,
                                     size)
@@ -220,7 +222,7 @@ def test_add_partition(self):
                 part = add_partition(disk.format, free, parted.PARTITION_LOGICAL,
                                     Size("10 MiB"))
 
-            ## add an extended partition to the disk
+            # add an extended partition to the disk
             placeholder = add_partition(disk.format, free,
                                        parted.PARTITION_NORMAL, Size("10 MiB"))
             all_free = disk.format.parted_disk.getFreeSpaceRegions()
@@ -252,7 +254,6 @@ def test_add_partition(self):
                                     parted.PARTITION_NORMAL,
                                     Size("10 MiB"), all_free[1].start)
 
-
     def test_chunk(self):
         dev1 = Mock()
         attrs = {"req_grow": True,
@@ -641,6 +642,7 @@ def test_align_free_regions(self):
         self.assertEqual(free[0].length, 2048)
         self.assertEqual(free[1].length, 2048)
 
+
 class ExtendedPartitionTestCase(ImageBackedTestCase):
 
     disks = {"disk1": Size("2 GiB")}
diff --git a/tests/pylint/runpylint.py b/tests/pylint/runpylint.py
index cc3d2fb..bc836a6 100755
--- a/tests/pylint/runpylint.py
+++ b/tests/pylint/runpylint.py
@@ -4,11 +4,13 @@
 
 from pocketlint import FalsePositive, PocketLintConfig, PocketLinter
 
+
 class BlivetLintConfig(PocketLintConfig):
+
     def __init__(self):
         PocketLintConfig.__init__(self)
 
-        self.falsePositives = [ FalsePositive(r"BTRFSVolumeDevice._create: Instance of 'DeviceFormat' has no 'label' member"),
+        self.falsePositives = [FalsePositive(r"BTRFSVolumeDevice._create: Instance of 'DeviceFormat' has no 'label' member"),
                                 FalsePositive(r"Catching an exception which doesn't inherit from BaseException: (BlockDev|DM|Crypto|Swap|LVM|Btrfs|MDRaid|G)Error$"),
                                 FalsePositive(r"Function 'run_program' has no 'called' member"),
                                 FalsePositive(r"(PartitioningTestCase|PartitionDeviceTestCase).*: Instance of 'DeviceFormat' has no .* member"),
@@ -22,7 +24,7 @@ def __init__(self):
 
     @property
     def disabledOptions(self):
-        return [ "W0105",           # String statement has no effect
+        return ["W0105",           # String statement has no effect
                  "W0110",           # map/filter on lambda could be replaced by comprehension
                  "W0141",           # Used builtin function %r
                  "W0142",           # Used * or ** magic
diff --git a/tests/size_test.py b/tests/size_test.py
index 7a1fb9e..089f8ee 100644
--- a/tests/size_test.py
+++ b/tests/size_test.py
@@ -28,7 +28,7 @@
 import os
 import unittest
 
-from six.moves import cPickle # pylint: disable=import-error
+from six.moves import cPickle  # pylint: disable=import-error
 
 from decimal import Decimal
 
@@ -38,6 +38,7 @@
 from blivet.size import Size, _EMPTY_PREFIX, _BINARY_PREFIXES, _DECIMAL_PREFIXES
 from blivet.size import B, KiB, MiB, GiB, TiB
 
+
 class SizeTestCase(unittest.TestCase):
 
     def test_exceptions(self):
@@ -118,7 +119,7 @@ def test_human_readable(self):
 
         # a fractional quantity is shown if the value deviates
         # from the whole number of units by more than 1%
-        s = Size(16384 - (1024/100 + 1))
+        s = Size(16384 - (1024 / 100 + 1))
         self.assertEqual(s.human_readable(max_places=2), "15.99 KiB")
 
         # if max_places is set to None, all digits are displayed
@@ -130,13 +131,13 @@ def test_human_readable(self):
         self.assertEqual(s.human_readable(max_places=None), "64.0009765625 KiB")
 
         # test a very large quantity with no associated abbreviation or prefix
-        s = Size(1024**9)
+        s = Size(1024 ** 9)
         self.assertEqual(s.human_readable(max_places=2), "1024 YiB")
-        s = Size(1024**9 - 1)
+        s = Size(1024 ** 9 - 1)
         self.assertEqual(s.human_readable(max_places=2), "1024 YiB")
-        s = Size(1024**9 + 1)
+        s = Size(1024 ** 9 + 1)
         self.assertEqual(s.human_readable(max_places=2, strip=False), "1024.00 YiB")
-        s = Size(1024**10)
+        s = Size(1024 ** 10)
         self.assertEqual(s.human_readable(max_places=2), "1048576 YiB")
 
     def test_human_readable_fractional_quantities(self):
@@ -152,16 +153,15 @@ def test_human_readable_fractional_quantities(self):
         self.assertEqual(s.human_readable(max_places=None), "63.9990234375 KiB")
 
         # deviation is less than 1/2 of 1% of 1024
-        s = Size(16384 - (1024/100//2))
+        s = Size(16384 - (1024 / 100 // 2))
         self.assertEqual(s.human_readable(max_places=2), "16 KiB")
         # deviation is greater than 1/2 of 1% of 1024
-        s = Size(16384 - ((1024/100//2) + 1))
+        s = Size(16384 - ((1024 / 100 // 2) + 1))
         self.assertEqual(s.human_readable(max_places=2), "15.99 KiB")
 
         s = Size(0x10000000000000)
         self.assertEqual(s.human_readable(max_places=2), "4 PiB")
 
-
     def test_min_value(self):
         s = Size("9 MiB")
         self.assertEqual(s.human_readable(), "9 MiB")
@@ -196,8 +196,8 @@ def test_negative(self):
 
     def test_partial_bytes(self):
         self.assertEqual(Size("1024.6"), Size(1024))
-        self.assertEqual(Size("%s KiB" % (1/1025.0,)), Size(0))
-        self.assertEqual(Size("%s KiB" % (1/1023.0,)), Size(1))
+        self.assertEqual(Size("%s KiB" % (1 / 1025.0,)), Size(0))
+        self.assertEqual(Size("%s KiB" % (1 / 1023.0,)), Size(1))
 
     def test_no_units_in_string(self):
         self.assertEqual(Size("1024"), Size("1 KiB"))
@@ -264,6 +264,7 @@ def test_pickling(self):
         s = Size("10 MiB")
         self.assertEqual(s, cPickle.loads(cPickle.dumps(s)))
 
+
 class TranslationTestCase(unittest.TestCase):
 
     def __init__(self, methodName='run_test'):
@@ -285,7 +286,7 @@ def tearDown(self):
 
     def test_make_spec(self):
         """ Tests for _make_specs(). """
-        for lang in  self.TEST_LANGS:
+        for lang in self.TEST_LANGS:
             os.environ['LANG'] = lang
             locale.setlocale(locale.LC_ALL, '')
 
@@ -307,7 +308,7 @@ def test_make_spec(self):
 
     def test_parse_spec(self):
         """ Tests for parse_spec(). """
-        for lang in  self.TEST_LANGS:
+        for lang in self.TEST_LANGS:
             os.environ['LANG'] = lang
             locale.setlocale(locale.LC_ALL, '')
 
@@ -337,7 +338,7 @@ def test_parse_spec(self):
 
     def test_translated(self):
         s = Size("56.19 MiB")
-        for lang in  self.TEST_LANGS:
+        for lang in self.TEST_LANGS:
             os.environ['LANG'] = lang
             locale.setlocale(locale.LC_ALL, '')
 
@@ -423,6 +424,7 @@ def test_round_to_nearest(self):
         with self.assertRaises(ValueError):
             s.round_to_nearest(Size("-1 B"))
 
+
 class UtilityMethodsTestCase(unittest.TestCase):
 
     def test_lower_ascii(self):
@@ -434,27 +436,26 @@ def test_arithmetic(self):
         s = Size("2GiB")
 
         # Make sure arithmatic operations with Size always result in the expected type
-        self.assertIsInstance(s+s, Size)
-        self.assertIsInstance(s-s, Size)
-        self.assertIsInstance(s*s, Size)
-        self.assertIsInstance(s/s, Size)
-        self.assertIsInstance(s**Size(2), Decimal)
+        self.assertIsInstance(s + s, Size)
+        self.assertIsInstance(s - s, Size)
+        self.assertIsInstance(s * s, Size)
+        self.assertIsInstance(s / s, Size)
+        self.assertIsInstance(s ** Size(2), Decimal)
         self.assertIsInstance(s % Size(7), Size)
 
-
         # Make sure operations with non-Size on the right result in the expected type
-        self.assertIsInstance(s+2, Size)
-        self.assertIsInstance(s-2, Size)
-        self.assertIsInstance(s*2, Size)
-        self.assertIsInstance(s/2, Size)
-        self.assertIsInstance(s//2, Size)
-        self.assertIsInstance(s**2, Decimal)
+        self.assertIsInstance(s + 2, Size)
+        self.assertIsInstance(s - 2, Size)
+        self.assertIsInstance(s * 2, Size)
+        self.assertIsInstance(s / 2, Size)
+        self.assertIsInstance(s // 2, Size)
+        self.assertIsInstance(s ** 2, Decimal)
         self.assertIsInstance(s % 127, Size)
 
         # Make sure operations with non-Size on the left result in the expected type
-        self.assertIsInstance(2+s, Size)
-        self.assertIsInstance(2-s, Decimal)
-        self.assertIsInstance(2*s, Size)
-        self.assertIsInstance(2/s, Decimal)
-        self.assertIsInstance(2**Size(2), Decimal)
+        self.assertIsInstance(2 + s, Size)
+        self.assertIsInstance(2 - s, Decimal)
+        self.assertIsInstance(2 * s, Size)
+        self.assertIsInstance(2 / s, Decimal)
+        self.assertIsInstance(2 ** Size(2), Decimal)
         self.assertIsInstance(1024 % Size(127), Decimal)
diff --git a/tests/storagetestcase.py b/tests/storagetestcase.py
index 347acc8..4b58f59 100644
--- a/tests/storagetestcase.py
+++ b/tests/storagetestcase.py
@@ -11,7 +11,9 @@
 from blivet.devices import StorageDevice
 from blivet.devices import PartitionDevice
 
+
 class StorageTestCase(unittest.TestCase):
+
     """ StorageTestCase
 
         This is a base class for storage test cases. It sets up imports of
@@ -21,6 +23,7 @@ class StorageTestCase(unittest.TestCase):
         system, along with a couple of convenience methods.
 
     """
+
     def setUp(self):
         self.storage = blivet.Blivet()
 
@@ -99,7 +102,7 @@ def new_device(self, *args, **kwargs):
             device._current_size = kwargs.get("size")
 
         if isinstance(device, blivet.devices.PartitionDevice):
-            #if exists:
+            # if exists:
             #    device.parents = device.req_disks
             device.parents = device.req_disks
 
diff --git a/tests/tasks_test/basic_tests.py b/tests/tasks_test/basic_tests.py
index c14133e..c314f16 100644
--- a/tests/tasks_test/basic_tests.py
+++ b/tests/tasks_test/basic_tests.py
@@ -3,6 +3,7 @@
 import blivet.tasks.task as task
 import blivet.tasks.availability as availability
 
+
 class BasicUnavailableApplication(task.BasicApplication):
     ext = availability.unavailable_resource("unavailable")
     description = "unavailable application"
@@ -10,6 +11,7 @@ class BasicUnavailableApplication(task.BasicApplication):
     def do_task(self):
         pass
 
+
 class BasicAvailableApplication(task.BasicApplication):
     ext = availability.available_resource("available")
     description = "available application"
@@ -17,6 +19,7 @@ class BasicAvailableApplication(task.BasicApplication):
     def do_task(self):
         pass
 
+
 class ResourceTestCase(unittest.TestCase):
 
     def test_availabililty(self):
@@ -28,6 +31,7 @@ def test_availabililty(self):
         self.assertEqual(available_resource.availability_errors, [])
         self.assertTrue(available_resource.available)
 
+
 class TasksTestCase(unittest.TestCase):
 
     def test_availability(self):
diff --git a/tests/tsort_test.py b/tests/tsort_test.py
index 912cd97..1d34957 100644
--- a/tests/tsort_test.py
+++ b/tests/tsort_test.py
@@ -2,7 +2,9 @@
 import unittest
 import blivet.tsort
 
+
 class TopologicalSortTestCase(unittest.TestCase):
+
     def run_test(self):
         items = [1, 2, 3, 4, 5]
         edges = [(5, 4), (4, 3), (3, 2), (2, 1)]
@@ -39,7 +41,7 @@ def check_order(order, graph):
 
         try:
             order = blivet.tsort.tsort(graph)
-        except Exception as e: # pylint: disable=broad-except
+        except Exception as e:  # pylint: disable=broad-except
             self.fail(e)
 
         # verify output list is of the correct length
diff --git a/tests/udev_test.py b/tests/udev_test.py
index dff8c1b..5cc81a0 100644
--- a/tests/udev_test.py
+++ b/tests/udev_test.py
@@ -2,6 +2,7 @@
 import unittest
 import mock
 
+
 class UdevTest(unittest.TestCase):
 
     def setUp(self):
diff --git a/tests/util_test.py b/tests/util_test.py
index 2e3cbf5..e113efd 100644
--- a/tests/util_test.py
+++ b/tests/util_test.py
@@ -4,6 +4,7 @@
 
 from blivet import util
 
+
 class MiscTest(unittest.TestCase):
 
     # Disable this warning, which will only be triggered on python3.  For


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/7a55ce8997bf427f456afdbfbfae64426162a678


More information about the anaconda-patches mailing list