[blivet:master 1/6] Fix logging function string format warnings.

mulhern amulhern at redhat.com
Fri Mar 21 20:17:10 UTC 2014


From: David Shea <dshea at redhat.com>

Specify parameters to logging function strings as parameters to the
logging function so that the format operation does not need to be
evaluated for message levels that will not be logged.

Signed-off-by: mulhern <amulhern at redhat.com>

Note that this can mean the difference between crashing and not-crashing,
if your __repr__ function is unkind enough to throw an AttributeError,
for instance.
---
 blivet/__init__.py          | 130 ++++++++++-----------
 blivet/arch.py              |   6 +-
 blivet/dasd.py              | 216 ++++++++++++++++++++++++++++++++++
 blivet/deviceaction.py      |   2 +-
 blivet/devicefactory.py     | 110 +++++++++---------
 blivet/devicelibs/dasd.py   |   3 +-
 blivet/devicelibs/edd.py    |  28 ++---
 blivet/devicelibs/lvm.py    |   6 +-
 blivet/devicelibs/mdraid.py |   6 +-
 blivet/devicelibs/swap.py   |   6 +-
 blivet/devices.py           |  72 ++++++------
 blivet/devicetree.py        | 278 ++++++++++++++++++++++----------------------
 blivet/fcoe.py              |  12 +-
 blivet/formats/__init__.py  |  18 +--
 blivet/formats/disklabel.py |  10 +-
 blivet/formats/fs.py        |  36 +++---
 blivet/formats/luks.py      |   6 +-
 blivet/formats/prepboot.py  |   2 +-
 blivet/formats/swap.py      |   2 +-
 blivet/iscsi.py             |  35 +++---
 blivet/partitioning.py      | 266 +++++++++++++++++++++---------------------
 blivet/platform.py          |  12 +-
 blivet/udev.py              |  16 +--
 blivet/util.py              |  30 ++---
 blivet/zfcp.py              |  34 +++---
 25 files changed, 776 insertions(+), 566 deletions(-)
 create mode 100644 blivet/dasd.py

diff --git a/blivet/__init__.py b/blivet/__init__.py
index f361844..00c5143 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -154,7 +154,7 @@ def storageInitialize(storage, ksdata, protected):
         if not ksdata.ignoredisk.onlyuse:
             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)))
+            log.debug("onlyuse is now: %s", ",".join(ksdata.ignoredisk.onlyuse))
 
 def turnOnFilesystems(storage, mountOnly=False):
     """ Perform installer-specific activation of storage configuration. """
@@ -208,14 +208,14 @@ def writeEscrowPackets(storage):
         log.debug("escrow: writing escrow packets to %s", escrowDir)
         util.makedirs(escrowDir)
         for device in escrowDevices:
-            log.debug("escrow: device %s: %s" %
-                      (repr(device.path), repr(device.format.type)))
+            log.debug("escrow: device %s: %s",
+                      repr(device.path), repr(device.format.type))
             device.format.escrow(escrowDir,
                                  backupPassphrase)
 
     except (IOError, RuntimeError) as e:
         # TODO: real error handling
-        log.error("failed to store encryption key: %s" % e)
+        log.error("failed to store encryption key: %s", e)
 
     log.debug("escrow: writeEscrowPackets done")
 
@@ -386,7 +386,7 @@ class Blivet(object):
         try:
             self.devicetree.teardownAll()
         except Exception as e:
-            log.error("failure tearing down device tree: %s" % e)
+            log.error("failure tearing down device tree: %s", e)
 
     def reset(self, cleanupOnly=False):
         """ Reset storage configuration to reflect actual system state.
@@ -400,7 +400,7 @@ class Blivet(object):
             See :meth:`devicetree.Devicetree.populate` for more information
             about the cleanupOnly keyword argument.
         """
-        log.info("resetting Blivet (version %s) instance %s" % (__version__, self))
+        log.info("resetting Blivet (version %s) instance %s", __version__, self)
         if flags.installer_mode:
             # save passphrases for luks devices so we don't have to reprompt
             self.encryptionPassphrase = None
@@ -439,7 +439,7 @@ class Blivet(object):
             try:
                 self.roots = findExistingInstallations(self.devicetree)
             except Exception as e:
-                log.info("failure detecting existing installations: %s" % e)
+                log.info("failure detecting existing installations: %s", e)
 
             self.dumpState("initial")
 
@@ -494,7 +494,7 @@ class Blivet(object):
         for device in self.devicetree.devices:
             if device.isDisk:
                 if not device.mediaPresent:
-                    log.info("Skipping disk: %s: No media present" % device.name)
+                    log.info("Skipping disk: %s: No media present", device.name)
                     continue
                 disks.append(device)
         disks.sort(key=lambda d: d.name, cmp=self.compareDisks)
@@ -519,7 +519,7 @@ class Blivet(object):
                 continue
 
             if not device.mediaPresent:
-                log.info("Skipping device: %s: No media present" % device.name)
+                log.info("Skipping device: %s: No media present", device.name)
                 continue
 
             partitioned.append(device)
@@ -759,7 +759,7 @@ class Blivet(object):
             formatting is removed by no attempt is made to actually remove the
             disk device.
         """
-        log.debug("removing %s" % device.name)
+        log.debug("removing %s", device.name)
         devices = self.deviceDeps(device)
 
         # this isn't strictly necessary, but it makes the action list easier to
@@ -769,9 +769,9 @@ class Blivet(object):
         devices.reverse()
 
         while devices:
-            log.debug("devices to remove: %s" % ([d.name for d in devices],))
+            log.debug("devices to remove: %s", [d.name for d in devices])
             leaves = [d for d in devices if d.isleaf]
-            log.debug("leaves to remove: %s" % ([d.name for d in leaves],))
+            log.debug("leaves to remove: %s", [d.name for d in leaves])
             for leaf in leaves:
                 self.destroyDevice(leaf)
                 devices.remove(leaf)
@@ -791,12 +791,12 @@ class Blivet(object):
                             key=lambda p: p.partedPartition.number,
                             reverse=True)
         for part in partitions:
-            log.debug("clearpart: looking at %s" % part.name)
+            log.debug("clearpart: looking at %s", part.name)
             if not self.shouldClear(part):
                 continue
 
             self.recursiveRemove(part)
-            log.debug("partitions: %s" % [p.getDeviceNodeName() for p in part.partedPartition.disk.partitions])
+            log.debug("partitions: %s", [p.getDeviceNodeName() for p in part.partedPartition.disk.partitions])
 
         # now remove any empty extended partitions
         self.removeEmptyExtendedPartitions()
@@ -806,7 +806,7 @@ class Blivet(object):
             if not self.shouldClear(disk):
                 continue
 
-            log.debug("clearpart: initializing %s" % disk.name)
+            log.debug("clearpart: initializing %s", disk.name)
             self.recursiveRemove(disk)
             self.initializeDisk(disk)
 
@@ -834,7 +834,7 @@ class Blivet(object):
                 # remove the magic partition
                 for part in self.devicetree.getChildren(disk):
                     if part.partedPartition.number == magic:
-                        log.debug("removing %s" % part.name)
+                        log.debug("removing %s", part.name)
                         # We can't schedule the magic partition for removal
                         # because parted will not allow us to remove it from the
                         # disk. Still, we need it out of the devicetree.
@@ -857,12 +857,12 @@ class Blivet(object):
 
     def removeEmptyExtendedPartitions(self):
         for disk in self.partitioned:
-            log.debug("checking whether disk %s has an empty extended" % disk.name)
+            log.debug("checking whether disk %s has an empty extended", disk.name)
             extended = disk.format.extendedPartition
             logical_parts = disk.format.logicalPartitions
-            log.debug("extended is %s ; logicals is %s" % (extended, [p.getDeviceNodeName() for p in logical_parts]))
+            log.debug("extended is %s ; logicals is %s", extended, [p.getDeviceNodeName() for p in logical_parts])
             if extended and not logical_parts:
-                log.debug("removing empty extended partition from %s" % disk.name)
+                log.debug("removing empty extended partition from %s", disk.name)
                 extended_name = devicePathToName(extended.getDeviceNodeName())
                 extended = self.devicetree.getDeviceByName(extended_name)
                 self.destroyDevice(extended)
@@ -1006,8 +1006,8 @@ class Blivet(object):
         if name:
             safe_name = self.safeDeviceName(name)
             if safe_name != name:
-                log.warning("using '%s' instead of specified name '%s'"
-                                % (safe_name, name))
+                log.warning("using '%s' instead of specified name '%s'",
+                                safe_name, name)
                 name = safe_name
         else:
             swap = getattr(kwargs.get("format"), "type", None) == "swap"
@@ -1039,8 +1039,8 @@ class Blivet(object):
         if name:
             safe_name = self.safeDeviceName(name)
             if safe_name != name:
-                log.warning("using '%s' instead of specified name '%s'"
-                                % (safe_name, name))
+                log.warning("using '%s' instead of specified name '%s'",
+                                safe_name, name)
                 name = safe_name
         else:
             hostname = ""
@@ -1102,8 +1102,8 @@ class Blivet(object):
             safe_name = self.safeDeviceName(full_name)
             if safe_name != full_name:
                 new_name = safe_name[len(safe_vg_name)+1:]
-                log.warning("using '%s' instead of specified name '%s'"
-                                % (new_name, name))
+                log.warning("using '%s' instead of specified name '%s'",
+                                new_name, name)
                 name = new_name
         else:
             if kwargs.get("format") and kwargs["format"].type == "swap":
@@ -1157,7 +1157,7 @@ class Blivet(object):
                 contain the volume you want to contain the subvolume.
 
         """
-        log.debug("newBTRFS: args = %s ; kwargs = %s" % (args, kwargs))
+        log.debug("newBTRFS: args = %s ; kwargs = %s", args, kwargs)
         name = kwargs.pop("name", None)
         if args:
             name = args[0]
@@ -1404,7 +1404,7 @@ class Blivet(object):
 
             if not name:
                 log.error("failed to create device name based on prefix "
-                          "'%s' and hostname '%s'" % (prefix, hostname))
+                          "'%s' and hostname '%s'", prefix, hostname)
                 raise RuntimeError("unable to find suitable device name")
 
         return name
@@ -1459,8 +1459,8 @@ class Blivet(object):
 
             if not name:
                 log.error("failed to create device name based on parent '%s', "
-                          "prefix '%s', mountpoint '%s', swap '%s'"
-                          % (parent.name, prefix, mountpoint, swap))
+                          "prefix '%s', mountpoint '%s', swap '%s'",
+                          parent.name, prefix, mountpoint, swap)
                 raise RuntimeError("unable to find suitable device name")
 
         return name
@@ -1821,14 +1821,14 @@ class Blivet(object):
 
             Raise ValueError on invalid input.
         """
-        log.debug("trying to set new default fstype to '%s'" % newtype)
+        log.debug("trying to set new default fstype to '%s'", newtype)
         fmt = getFormat(newtype)
         if fmt.type is None:
             raise ValueError("unrecognized value %s for new default fs type" % newtype)
 
         if (not fmt.mountable or not fmt.formattable or not fmt.supported or
             not fmt.linuxNative):
-            log.debug("invalid default fstype: %r" % fmt)
+            log.debug("invalid default fstype: %r", fmt)
             raise ValueError("new value %s is not valid as a default fs type" % fmt)
 
         self._defaultFSType = newtype
@@ -1946,7 +1946,7 @@ class Blivet(object):
 
         # we can't do anything with existing devices
         #if device and device.exists:
-        #    log.info("factoryDevice refusing to change device %s" % device)
+        #    log.info("factoryDevice refusing to change device %s", device)
         #    return
 
         if not kwargs.get("fstype"):
@@ -2099,7 +2099,7 @@ class Blivet(object):
                     break
 
             if not class_attr or not list_attr:
-                log.info("omitting ksdata: %s" % device)
+                log.info("omitting ksdata: %s", device)
                 continue
 
             cls = getattr(self.ksdata, class_attr)
@@ -2183,8 +2183,8 @@ def mountExistingSystem(fsset, rootDevice,
             continue
 
         if device.format.needsFSCheck:
-            log.info("%s contains a dirty %s filesystem" % (device.path,
-                                                            device.format.type))
+            log.info("%s contains a dirty %s filesystem", device.path,
+                                                          device.format.type)
             dirtyDevs.append(device.path)
 
     if dirtyDevs and (not allowDirty or dirtyCB(dirtyDevs)):
@@ -2201,7 +2201,7 @@ class BlkidTab(object):
 
     def parse(self):
         path = "%s/etc/blkid/blkid.tab" % self.chroot
-        log.debug("parsing %s" % path)
+        log.debug("parsing %s", path)
         with open(path) as f:
             for line in f.readlines():
                 # this is pretty ugly, but an XML parser is more work than
@@ -2244,7 +2244,7 @@ class CryptTab(object):
             chroot = ""
 
         path = "%s/etc/crypttab" % chroot
-        log.debug("parsing %s" % path)
+        log.debug("parsing %s", path)
         with open(path) as f:
             if not self.blkidTab:
                 try:
@@ -2496,15 +2496,15 @@ class FSSet(object):
                 device = NoDevice(format=format)
 
         if device is None:
-            log.error("failed to resolve %s (%s) from fstab" % (devspec,
-                                                                fstype))
+            log.error("failed to resolve %s (%s) from fstab", devspec,
+                                                              fstype)
             raise UnrecognizedFSTabEntryError()
 
         device.setup()
         fmt = getFormat(fstype, device=device.path, exists=True)
         if fstype != "auto" and None in (device.format.type, fmt.type):
-            log.info("Unrecognized filesystem type for %s (%s)"
-                     % (device.name, fstype))
+            log.info("Unrecognized filesystem type for %s (%s)",
+                     device.name, fstype)
             device.teardown()
             raise UnrecognizedFSTabEntryError()
 
@@ -2513,7 +2513,7 @@ class FSSet(object):
         ftype = getattr(fmt, "mountType", fmt.type)
         dtype = getattr(device.format, "mountType", device.format.type)
         if fstype != "auto" and ftype != dtype:
-            log.info("fstab says %s at %s is %s" % (dtype, mountpoint, ftype))
+            log.info("fstab says %s at %s is %s", dtype, mountpoint, ftype)
             if fmt.testMount():
                 device.format = fmt
             else:
@@ -2554,30 +2554,30 @@ class FSSet(object):
         path = "%s/etc/fstab" % chroot
         if not os.access(path, os.R_OK):
             # XXX should we raise an exception instead?
-            log.info("cannot open %s for read" % path)
+            log.info("cannot open %s for read", path)
             return
 
         blkidTab = BlkidTab(chroot=chroot)
         try:
             blkidTab.parse()
-            log.debug("blkid.tab devs: %s" % blkidTab.devices.keys())
+            log.debug("blkid.tab devs: %s", blkidTab.devices.keys())
         except Exception as e:
-            log.info("error parsing blkid.tab: %s" % e)
+            log.info("error parsing blkid.tab: %s", e)
             blkidTab = None
 
         cryptTab = CryptTab(self.devicetree, blkidTab=blkidTab, chroot=chroot)
         try:
             cryptTab.parse(chroot=chroot)
-            log.debug("crypttab maps: %s" % cryptTab.mappings.keys())
+            log.debug("crypttab maps: %s", cryptTab.mappings.keys())
         except Exception as e:
-            log.info("error parsing crypttab: %s" % e)
+            log.info("error parsing crypttab: %s", e)
             cryptTab = None
 
         self.blkidTab = blkidTab
         self.cryptTab = cryptTab
 
         with open(path) as f:
-            log.debug("parsing %s" % path)
+            log.debug("parsing %s", path)
 
             lines = f.readlines()
 
@@ -2627,7 +2627,7 @@ class FSSet(object):
                 parent = get_containing_device(targetDir, self.devicetree)
                 if not parent:
                     log.error("cannot determine which device contains "
-                              "directory %s" % device.path)
+                              "directory %s", device.path)
                     device.parents = []
                     self.devicetree._removeDevice(device)
                     continue
@@ -2676,7 +2676,7 @@ class FSSet(object):
                 parent = get_containing_device(targetDir, self.devicetree)
                 if not parent:
                     log.error("cannot determine which device contains "
-                              "directory %s" % device.path)
+                              "directory %s", device.path)
                     device.parents = []
                     self.devicetree._removeDevice(device)
                     continue
@@ -2698,8 +2698,8 @@ class FSSet(object):
                 device.format.setup(options=options,
                                     chroot=rootPath)
             except Exception as e:
-                log.error("error mounting %s on %s: %s"
-                          % (device.path, device.format.mountpoint, e))
+                log.error("error mounting %s on %s: %s",
+                          device.path, device.format.mountpoint, e)
                 if errorHandler.cb(e, device) == ERROR_RAISE:
                     raise
 
@@ -2891,9 +2891,9 @@ class FSSet(object):
                 mountpoint = device.format.mountpoint
                 options = device.format.options
                 if not mountpoint:
-                    log.warning("%s filesystem on %s has no mountpoint" % \
-                                                            (fstype,
-                                                             device.path))
+                    log.warning("%s filesystem on %s has no mountpoint",
+                                                            fstype,
+                                                            device.path)
                     continue
 
             options = options or "defaults"
@@ -3064,16 +3064,16 @@ def findExistingInstallations(devicetree):
         try:
             device.setup()
         except Exception as e:
-            log.warning("setup of %s failed: %s" % (device.name, e))
+            log.warning("setup of %s failed: %s", device.name, e)
             continue
 
         options = device.format.options + ",ro"
         try:
             device.format.mount(options=options, mountpoint=ROOT_PATH)
         except Exception as e:
-            log.warning("mount of %s as %s failed: %s" % (device.name,
-                                                          device.format.type,
-                                                          e))
+            log.warning("mount of %s as %s failed: %s", device.name,
+                                                        device.format.type,
+                                                        e)
             device.teardown()
             continue
 
@@ -3145,27 +3145,27 @@ def parseFSTab(devicetree, chroot=None):
     path = "%s/etc/fstab" % chroot
     if not os.access(path, os.R_OK):
         # XXX should we raise an exception instead?
-        log.info("cannot open %s for read" % path)
+        log.info("cannot open %s for read", path)
         return (mounts, swaps)
 
     blkidTab = BlkidTab(chroot=chroot)
     try:
         blkidTab.parse()
-        log.debug("blkid.tab devs: %s" % blkidTab.devices.keys())
+        log.debug("blkid.tab devs: %s", blkidTab.devices.keys())
     except Exception as e:
-        log.info("error parsing blkid.tab: %s" % e)
+        log.info("error parsing blkid.tab: %s", e)
         blkidTab = None
 
     cryptTab = CryptTab(devicetree, blkidTab=blkidTab, chroot=chroot)
     try:
         cryptTab.parse(chroot=chroot)
-        log.debug("crypttab maps: %s" % cryptTab.mappings.keys())
+        log.debug("crypttab maps: %s", cryptTab.mappings.keys())
     except Exception as e:
-        log.info("error parsing crypttab: %s" % e)
+        log.info("error parsing crypttab: %s", e)
         cryptTab = None
 
     with open(path) as f:
-        log.debug("parsing %s" % path)
+        log.debug("parsing %s", path)
         for line in f.readlines():
             # strip off comments
             (line, pound, comment) = line.partition("#")
diff --git a/blivet/arch.py b/blivet/arch.py
index 831f6ea..5312a53 100644
--- a/blivet/arch.py
+++ b/blivet/arch.py
@@ -94,7 +94,7 @@ def getPPCMachine():
             if _type[0] in part:
                 return _type[1]
 
-    log.warning("Unknown PowerPC machine type: %s platform: %s" % (machine, platform,))
+    log.warning("Unknown PowerPC machine type: %s platform: %s", machine, platform)
 
     return None
 
@@ -148,7 +148,7 @@ def getPPCMacGen():
         if _type in gen:
             return _type
 
-    log.warning("Unknown Power Mac generation: %s" %(gen,))
+    log.warning("Unknown Power Mac generation: %s", gen)
     return None
 
 def getPPCMacBook():
@@ -370,5 +370,5 @@ def bits():
         bits = int(bits)
         return bits
     except Exception as e:
-        log.error("architecture word size detection failed: %s" % e)
+        log.error("architecture word size detection failed: %s", e)
         return None
diff --git a/blivet/dasd.py b/blivet/dasd.py
new file mode 100644
index 0000000..1bd8fee
--- /dev/null
+++ b/blivet/dasd.py
@@ -0,0 +1,216 @@
+#
+# dasd.py - DASD class
+#
+# Copyright (C) 2009, 2010  Red Hat, Inc.  All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Red Hat Author(s): David Cantrell <dcantrell at redhat.com>
+#
+
+import sys
+import os
+from .errors import DasdFormatError
+from .devices import deviceNameToDiskByPath
+from . import util
+from . import arch
+from .udev import udev_trigger
+from .i18n import P_
+
+import logging
+log = logging.getLogger("blivet")
+
+def getDasdPorts():
+    """ Return comma delimited string of valid DASD ports. """
+    ports = []
+
+    f = open("/proc/dasd/devices", "r")
+    lines = map(lambda x: x.strip(), f.readlines())
+    f.close()
+
+    for line in lines:
+        if "unknown" in line:
+            continue
+
+        if "(FBA )" in line or "(ECKD)" in line:
+            ports.append(line.split('(')[0])
+
+    return ','.join(ports)
+
+class DASD:
+    """ Controlling class for DASD interaction before the storage code in
+        anaconda has initialized.
+
+        The DASD class can determine if any DASD devices on the system are
+        unformatted and can perform a dasdfmt on them.
+    """
+
+    def __init__(self):
+        self._dasdlist = []
+        self._devices = []                  # list of DASDDevice objects
+        self.totalCylinders = 0
+        self._completedCylinders = 0.0
+        self._maxFormatJobs = 0
+        self.dasdfmt = "/sbin/dasdfmt"
+        self.commonArgv = ["-y", "-d", "cdl", "-b", "4096"]
+        self.started = False
+
+    def __call__(self):
+        return self
+
+    def startup(self, intf, exclusiveDisks, zeroMbr):
+        """ Look for any unformatted DASDs in the system and offer the user
+            the option for format them with dasdfmt or exit the installer.
+        """
+        if self.started:
+            return
+
+        self.started = True
+
+        if not arch.isS390():
+            return
+
+        # Trigger udev data about the dasd devices on the system
+        udev_trigger(action="change", name="dasd*")
+
+        log.info("Checking for unformatted DASD devices:")
+
+        for device in os.listdir("/sys/block"):
+            if not device.startswith("dasd"):
+                continue
+
+            statusfile = "/sys/block/%s/device/status" % (device,)
+            if not os.path.isfile(statusfile):
+                continue
+
+            f = open(statusfile, "r")
+            status = f.read().strip()
+            f.close()
+
+            if status in ["unformatted"] and device not in exclusiveDisks:
+                bypath = deviceNameToDiskByPath(device)
+                if not bypath:
+                    bypath = "/dev/" + device
+
+                log.info("    %s (%s) status is %s, needs dasdfmt", device,
+                                                                    bypath,
+                                                                    status)
+                self._dasdlist.append((device, bypath))
+
+        if not len(self._dasdlist):
+            log.info("    no unformatted DASD devices found")
+            return
+
+        askUser = True
+
+        if zeroMbr:
+            askUser = False
+        elif not intf and not zeroMbr:
+            log.info("    non-interactive kickstart install without zerombr "
+                     "command, unable to run dasdfmt, exiting installer")
+            sys.exit(0)
+
+        c = len(self._dasdlist)
+
+        if intf and askUser:
+            devs = ''
+            for dasd, bypath in self._dasdlist:
+                devs += "%s\n" % (bypath,)
+
+            rc = intf.questionInitializeDASD(c, devs)
+            if rc == 1:
+                log.info("    not running dasdfmt, continuing installation")
+                return
+
+        # gather total cylinder count
+        argv = ["-t", "-v"] + self.commonArgv
+        for dasd, bypath in self._dasdlist:
+            buf = util.capture_output([self.dasdfmt, argv, "/dev/" + dasd])
+            for line in buf.splitlines():
+                if line.startswith("Drive Geometry: "):
+                    # line will look like this:
+                    # Drive Geometry: 3339 Cylinders * 15 Heads =  50085 Tracks
+                    cyls = long(filter(lambda s: s, line.split(' '))[2])
+                    self.totalCylinders += cyls
+                    break
+
+        # format DASDs
+        argv = ["-P"] + self.commonArgv
+        update = self._updateProgressWindow
+
+        title = P_("Formatting DASD Device", "Formatting DASD Devices", c)
+        msg = P_("Preparing %d DASD device for use with Linux..." % c,
+                 "Preparing %d DASD devices for use with Linux..." % c, c)
+
+        if intf:
+            if self.totalCylinders:
+                pw = intf.progressWindow(title, msg, 1.0)
+            else:
+                pw = intf.progressWindow(title, msg, 100, pulse=True)
+
+        for dasd, bypath in self._dasdlist:
+            log.info("Running dasdfmt on %s", bypath)
+            arglist = argv + ["/dev/" + dasd]
+
+            try:
+                rc = util.run_program([self.dasdfmt] + arglist)
+            except Exception as e:
+                raise DasdFormatError(e, bypath)
+
+            if rc:
+                raise DasdFormatError("dasdfmt failed: %s" % rc, bypath)
+
+        if intf:
+            pw.pop()
+
+    def addDASD(self, dasd):
+        """ Adds a DASDDevice to the internal list of DASDs. """
+        if dasd and dasd not in self._devices:
+            self._devices.append(dasd)
+
+    def removeDASD(self, dasd):
+        """ Removes a DASDDevice from the internal list of DASDs. """
+        if dasd and dasd in self._devices:
+            self._devices.remove(dasd)
+
+    def clear_device_list(self):
+        """ Clear the device list to force re-populate on next access. """
+        self._devices = []
+
+    def write(self, ROOT_PATH):
+        """ Write /etc/dasd.conf to target system for all DASD devices
+            configured during installation.
+        """
+        if self._devices == []:
+            return
+
+        f = open(os.path.realpath(ROOT_PATH + "/etc/dasd.conf"), "w")
+        for dasd in sorted(self._devices, key=lambda d: d.name):
+            fields = [dasd.busid] + dasd.getOpts()
+            f.write("%s\n" % (" ".join(fields),))
+        f.close()
+
+    def _updateProgressWindow(self, data, callback_data=None):
+        """ Reads progress output from dasdfmt and collects the number of
+            cylinders completed so the progress window can update.
+        """
+        if not callback_data:
+            return
+
+        if data == '\n':
+            # each newline we see in this output means one more cylinder done
+            self._completedCylinders += 1.0
+            callback_data.set(self._completedCylinders / self.totalCylinders)
+
+# vim:tw=78:ts=4:et:sw=4
diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
index d9a6a87..6d4ac45 100644
--- a/blivet/deviceaction.py
+++ b/blivet/deviceaction.py
@@ -477,7 +477,7 @@ class ActionCreateFormat(DeviceAction):
                 self.device.deviceLinks = udev_device_get_symlinks(info)
             elif self.device.format.type != "tmpfs":
                 # udev lookup failing is a serious issue for anything other than tmpfs
-                log.error("udev lookup failed for device: %s" % self.device)
+                log.error("udev lookup failed for device: %s", self.device)
 
     def cancel(self):
         self.device.format = self.origFormat
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index d1e4779..0221503 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -102,8 +102,8 @@ def get_device_factory(blivet, device_type, size, **kwargs):
                    DEVICE_TYPE_DISK: DeviceFactory}
 
     factory_class = class_table[device_type]
-    log.debug("instantiating %s: %s, %s, %s, %s" % (factory_class,
-                blivet, size, [d.name for d in disks], kwargs))
+    log.debug("instantiating %s: %s, %s, %s, %s", factory_class,
+                blivet, size, [d.name for d in disks], kwargs)
     return factory_class(blivet, size, disks, **kwargs)
 
 
@@ -478,8 +478,8 @@ class DeviceFactory(object):
             return
 
         members = self.child_factory.devices
-        log.debug("new member set: %s" % [d.name for d in members])
-        log.debug("old member set: %s" % [d.name for d in self.container.parents])
+        log.debug("new member set: %s", [d.name for d in members])
+        log.debug("old member set: %s", [d.name for d in self.container.parents])
         for member in self.container.parents[:]:
             if member not in members:
                 self.container.removeMember(member)
@@ -553,7 +553,7 @@ class DeviceFactory(object):
                                           fmt_args=fmt_args,
                                           **kwa)
         except (StorageError, ValueError) as e:
-            log.error("device instance creation failed: %s" % e)
+            log.error("device instance creation failed: %s", e)
             raise
 
         self.storage.createDevice(device)
@@ -561,7 +561,7 @@ class DeviceFactory(object):
         try:
             self._post_create()
         except StorageError as e:
-            log.error("device post-create method failed: %s" % e)
+            log.error("device post-create method failed: %s", e)
         else:
             if not device.size:
                 e = StorageError("failed to create device")
@@ -617,7 +617,7 @@ class DeviceFactory(object):
         try:
             self._post_create()
         except StorageError as e:
-            log.error("device post-create method failed: %s" % e)
+            log.error("device post-create method failed: %s", e)
         else:
             if self.device.size <= self.device.format.minSize:
                 e = StorageError("failed to adjust device -- not enough free space in specified disks?")
@@ -680,12 +680,12 @@ class DeviceFactory(object):
         safe_new_name = self.storage.safeDeviceName(self.device_name)
         if self.device.name != safe_new_name:
             if safe_new_name in self.storage.names:
-                log.error("not renaming '%s' to in-use name '%s'"
-                            % (self.device._name, safe_new_name))
+                log.error("not renaming '%s' to in-use name '%s'",
+                            self.device._name, safe_new_name)
                 return
 
-            log.debug("renaming device '%s' to '%s'"
-                        % (self.device._name, safe_new_name))
+            log.debug("renaming device '%s' to '%s'",
+                        self.device._name, safe_new_name)
             self.device._name = safe_new_name
 
     def _post_create(self):
@@ -705,9 +705,9 @@ class DeviceFactory(object):
 
         args = self._get_child_factory_args()
         kwargs = self._get_child_factory_kwargs()
-        log.debug("child factory class: %s" % self.child_factory_class)
-        log.debug("child factory args: %s" % args)
-        log.debug("child factory kwargs: %s" % kwargs)
+        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)
         self.child_factory = factory
         factory.parent_factory = self
@@ -732,7 +732,7 @@ class DeviceFactory(object):
         try:
             self._configure()
         except Exception as e:
-            log.error("failed to configure device factory: %s" % e)
+            log.error("failed to configure device factory: %s", e)
             if self.parent_factory is None:
                 # only do the backup/restore error handling at the top-level
                 self._revert_devicetree()
@@ -829,8 +829,8 @@ class PartitionFactory(DeviceFactory):
     def _set_device_size(self):
         """ Set the size of a defined factory device. """
         if self.device and self.size != self.raw_device.size:
-            log.info("adjusting device size from %s to %s"
-                            % (self.raw_device.size, self.size))
+            log.info("adjusting device size from %s to %s",
+                            self.raw_device.size, self.size)
 
             base_size = self._get_base_size()
             size = self._get_device_size()
@@ -875,7 +875,7 @@ class PartitionFactory(DeviceFactory):
         try:
             doPartitioning(self.storage)
         except StorageError as e:
-            log.error("failed to allocate partitions: %s" % e)
+            log.error("failed to allocate partitions: %s", e)
             raise
 
 class PartitionSetFactory(PartitionFactory):
@@ -929,7 +929,7 @@ class PartitionSetFactory(PartitionFactory):
         # Grab the starting member list from the parent factory.
         members = self._devices
         container = self.parent_factory.container
-        log.debug("parent factory container: %s" % self.parent_factory.container)
+        log.debug("parent factory container: %s", self.parent_factory.container)
         if container:
             if container.exists:
                 log.info("parent factory container exists -- nothing to do")
@@ -939,7 +939,7 @@ class PartitionSetFactory(PartitionFactory):
             members = container.parents[:]
             self._devices = members
 
-        log.debug("members: %s" % [d.name for d in members])
+        log.debug("members: %s", [d.name for d in members])
 
         ##
         ## Determine the target disk set.
@@ -962,8 +962,8 @@ class PartitionSetFactory(PartitionFactory):
         add_disks = [d for d in add_disks if d.partitioned and
                                              d.format.free >= min_free]
 
-        log.debug("add_disks: %s" % [d.name for d in add_disks])
-        log.debug("remove_disks: %s" % [d.name for d in remove_disks])
+        log.debug("add_disks: %s", [d.name for d in add_disks])
+        log.debug("remove_disks: %s", [d.name for d in remove_disks])
 
         ##
         ## Remove members from dropped disks.
@@ -1045,7 +1045,7 @@ class PartitionSetFactory(PartitionFactory):
                                            size=base_size,
                                            fmt_type=member_format)
             except StorageError as e:
-                log.error("failed to create new member partition: %s" % e)
+                log.error("failed to create new member partition: %s", e)
                 continue
 
             self.storage.createDevice(member)
@@ -1068,8 +1068,8 @@ class PartitionSetFactory(PartitionFactory):
         ##
         ## 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))
+        log.debug("adding a %s with size %s",
+                  self.parent_factory.size_set_class.__name__, total_space)
         size_set = self.parent_factory.size_set_class(members, total_space)
         self.storage.size_sets.append(size_set)
         for member in members[:]:
@@ -1125,7 +1125,7 @@ class LVMFactory(DeviceFactory):
 
         if free < size:
             log.info("adjusting size from %s to %s so it fits "
-                     "in container %s" % (size, free, self.container.name))
+                     "in container %s", size, free, self.container.name)
             size = free
 
         return size
@@ -1133,8 +1133,8 @@ class LVMFactory(DeviceFactory):
     def _set_device_size(self):
         size = self._get_device_size()
         if self.device and size != self.raw_device.size:
-            log.info("adjusting device size from %s to %s"
-                            % (self.raw_device.size, size))
+            log.info("adjusting device size from %s to %s",
+                            self.raw_device.size, size)
             self.raw_device.size = size
             self.raw_device.req_grow = False
 
@@ -1153,10 +1153,10 @@ class LVMFactory(DeviceFactory):
             # grow the container as large as possible
             if self.container:
                 size += sum(p.size for p in self.container.parents)
-                log.debug("size bumped to %s to include container parents" % size)
+                log.debug("size bumped to %s to include container parents", size)
 
             size += self._get_free_disk_space()
-            log.debug("size bumped to %s to include free disk space" % size)
+            log.debug("size bumped to %s to include free disk space", size)
         else:
             # container_size is a request for a fixed size for the container
             size += get_pv_space(self.container_size, len(self.disks))
@@ -1164,14 +1164,14 @@ class LVMFactory(DeviceFactory):
         # this does not apply if a specific container size was requested
         if self.container_size in [SIZE_POLICY_AUTO, SIZE_POLICY_MAX]:
             size += self._get_device_space()
-            log.debug("size bumped to %s to include new device space" % size)
+            log.debug("size bumped to %s to include new device space", size)
             if self.device and self.container_size == SIZE_POLICY_AUTO:
                 # The member count here uses the container's current member set
                 # since that's the basis for the current device's disk space
                 # usage.
                 size -= get_pv_space(self.device.size,
                    len(self.container.parents))
-                log.debug("size cut to %s to omit old device space" % size)
+                log.debug("size cut to %s to omit old device space", size)
 
         if self.container_raid_level:
             # add five extents per disk to account for md metadata
@@ -1244,18 +1244,18 @@ class LVMFactory(DeviceFactory):
         safe_new_name = self.storage.safeDeviceName(lvname)
         if self.device.name != safe_new_name:
             if safe_new_name in self.storage.names:
-                log.error("not renaming '%s' to in-use name '%s'"
-                            % (self.device._name, safe_new_name))
+                log.error("not renaming '%s' to in-use name '%s'",
+                            self.device._name, safe_new_name)
                 return
 
             if not safe_new_name.startswith(self.container.name):
-                log.error("device rename failure (%s)" % safe_new_name)
+                log.error("device rename failure (%s)", safe_new_name)
                 return
 
             # strip off the vg name before setting
             safe_new_name = safe_new_name[len(self.container.name)+1:]
-            log.debug("renaming device '%s' to '%s'"
-                        % (self.device._name, safe_new_name))
+            log.debug("renaming device '%s' to '%s'",
+                        self.device._name, safe_new_name)
             self.device._name = safe_new_name
 
     def _configure(self):
@@ -1339,7 +1339,7 @@ class LVMThinPFactory(LVMFactory):
     def _get_device_size(self):
         # calculate device size based on space in the pool
         pool_size = self.pool.size
-        log.debug("pool size is %s" % pool_size)
+        log.debug("pool size is %s", pool_size)
         free = pool_size - self.pool.usedSpace
         if self.device:
             free += self.raw_device.poolSpaceUsed
@@ -1347,7 +1347,7 @@ class LVMThinPFactory(LVMFactory):
         size = self.size
         if free < size:
             log.info("adjusting size from %s to %s so it fits "
-                     "in pool %s" % (size, free, self.pool.name))
+                     "in pool %s", size, free, self.pool.name)
             size = free
 
         return size
@@ -1363,9 +1363,9 @@ class LVMThinPFactory(LVMFactory):
             Our container will still be None if we are going to create it.
         """
         space = super(LVMThinPFactory, self)._get_device_space()
-        log.debug("calculated total disk space prior to padding: %s" % space)
+        log.debug("calculated total disk space prior to padding: %s", space)
         space += get_pool_padding(space, pesize=self._pesize)
-        log.debug("total disk space needed: %s" % space)
+        log.debug("total disk space needed: %s", space)
         return space
 
     def _get_total_space(self):
@@ -1380,13 +1380,13 @@ class LVMThinPFactory(LVMFactory):
                self.pool and not self.pool.exists and self.pool.freeSpace > 0:
                 # this is mostly for cleaning up after removing a thin lv
                 size -= self.pool.freeSpace
-                log.debug("size cut to %s to omit pool free space" % size)
+                log.debug("size cut to %s to omit pool free space", size)
 
                 pad = get_pool_padding(self.pool.freeSpace,
                                        pesize=self._pesize)
                 size -= pad
                 log.debug("size cut to %s to omit pool padding from free "
-                          "space" % size)
+                          "space", size)
 
             if self.device and self.container_size == SIZE_POLICY_AUTO:
                 # Now we have to reduce the space again by the current device's
@@ -1396,9 +1396,9 @@ class LVMThinPFactory(LVMFactory):
                 # usage.
                 pad = get_pool_padding(self.device.size,
                                        pesize=self._pesize)
-                log.debug("old device size: %s ; old pad: %s" % (self.device.size, pad))
+                log.debug("old device size: %s ; old pad: %s", self.device.size, pad)
                 size -= pad
-                log.debug("size cut to %s to omit old device padding" % size)
+                log.debug("size cut to %s to omit old device padding", size)
 
         return size
 
@@ -1445,7 +1445,7 @@ class LVMThinPFactory(LVMFactory):
         if self.pool and self.pool.exists:
             return self.pool.size
 
-        log.debug("requested size is %s" % self.size)
+        log.debug("requested size is %s", self.size)
         size = self.size    # projected size for the pool (not padded)
         free = Size(bytes=0)# total space within the vg that is available to us
         if self.pool:
@@ -1453,15 +1453,15 @@ class LVMThinPFactory(LVMFactory):
             # pool lv sizes go toward projected pool size and vg free space
             size += self.pool.usedSpace
             free += self.pool.usedSpace
-            log.debug("increasing free and size by pool used (%s)" % self.pool.usedSpace)
+            log.debug("increasing free and size by pool used (%s)", self.pool.usedSpace)
             if self.device:
-                log.debug("reducing size by device space (%s)" % self.device.poolSpaceUsed)
+                log.debug("reducing size by device space (%s)", self.device.poolSpaceUsed)
                 size -= self.device.poolSpaceUsed   # don't count our device
 
             # increase vg free space by the size of the current pool's pad
             pad = get_pool_padding(self.pool.size,
                                    pesize=self._pesize)
-            log.debug("increasing free by current pool pad size (%s)" % pad)
+            log.debug("increasing free by current pool pad size (%s)", pad)
             free += pad
 
         # round to nearest extent. free rounds down, size rounds up.
@@ -1470,12 +1470,12 @@ class LVMThinPFactory(LVMFactory):
 
         pad = get_pool_padding(size, pesize=self._pesize)
 
-        log.debug("size is %s ; pad is %s ; free is %s" % (size, pad, free))
+        log.debug("size is %s ; pad is %s ; free is %s", size, pad, free)
         if free < (size + pad):
             pad = int(get_pool_padding(free, pesize=self._pesize, reverse=True))
             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))
+                     "in container %s", size, free, self.container.name)
             size = free
 
         return size
@@ -1508,11 +1508,11 @@ class LVMThinPFactory(LVMFactory):
         super(LVMThinPFactory, self)._set_container()
         self.pool = self.get_pool()
         if self.pool:
-            log.debug("pool is %s ; size: %s ; free: %s" % (self.pool.name,
-                                                            self.pool.size,
-                                                            self.pool.freeSpace))
+            log.debug("pool is %s ; size: %s ; free: %s", self.pool.name,
+                                                          self.pool.size,
+                                                          self.pool.freeSpace)
             for lv in self.pool.lvs:
-                log.debug("  %s size is %s" % (lv.name, lv.size))
+                log.debug("  %s size is %s", lv.name, lv.size)
 
     def _reconfigure_container(self):
         """ Reconfigure a defined container required by this factory device. """
diff --git a/blivet/devicelibs/dasd.py b/blivet/devicelibs/dasd.py
index 7eb2551..de4e8ec 100644
--- a/blivet/devicelibs/dasd.py
+++ b/blivet/devicelibs/dasd.py
@@ -103,8 +103,7 @@ def dasd_needs_format(dasd):
         if not bypath:
             bypath = "/dev/" + dasd
 
-        log.info("  %s (%s) status is %s, needs dasdfmt" % (dasd, bypath,
-                                                            status,))
+        log.info("  %s (%s) status is %s, needs dasdfmt", dasd, bypath, status)
         return True
 
     return False
diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index dab37f0..d72ea25 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -88,7 +88,7 @@ class EddEntry(object):
                 self.pci_dev = match.group(1)
                 self.channel = int(match.group(2))
             else:
-                log.warning("edd: can not match host_bus: %s" % hbus)
+                log.warning("edd: can not match host_bus: %s", hbus)
 
 class EddMatcher(object):
     """ This object tries to match given entry to a disk device name.
@@ -114,7 +114,7 @@ class EddMatcher(object):
                 if len(block_entries) == 1:
                     name = block_entries[0]
             else:
-                log.warning("edd: directory does not exist: %s" % path)
+                log.warning("edd: directory does not exist: %s", path)
         elif self.edd.type == "SCSI":
             pattern = "/sys/devices/pci0000:00/0000:%(pci_dev)s/virtio*/block" % \
                 {'pci_dev' : self.edd.pci_dev}
@@ -165,25 +165,25 @@ def collect_mbrs(devices):
             mbrsig = struct.unpack('I', os.read(fd, 4))
             os.close(fd)
         except OSError as e:
-            log.warning("edd: error reading mbrsig from disk %s: %s" %
-                        (dev.name, str(e)))
+            log.warning("edd: error reading mbrsig from disk %s: %s",
+                        dev.name, str(e))
             continue
 
         mbrsig_str = "0x%08x" % mbrsig
         # sanity check
         if mbrsig_str == '0x00000000':
-            log.info("edd: MBR signature on %s is zero. new disk image?" % dev.name)
+            log.info("edd: MBR signature on %s is zero. new disk image?", dev.name)
             continue
         else:
             for (dev_name, mbrsig_str_old) in mbr_dict.items():
                 if mbrsig_str_old == mbrsig_str:
-                    log.error("edd: dupicite MBR signature %s for %s and %s" %
-                              (mbrsig_str, dev_name, dev.name))
+                    log.error("edd: dupicite MBR signature %s for %s and %s",
+                              mbrsig_str, dev_name, dev.name)
                     # this actually makes all the other data useless
                     return {}
         # update the dictionary
         mbr_dict[dev.name] = mbrsig_str
-    log.info("edd: collected mbr signatures: %s" % mbr_dict)
+    log.info("edd: collected mbr signatures: %s", mbr_dict)
     return mbr_dict
 
 def get_edd_dict(devices):
@@ -204,28 +204,28 @@ def get_edd_dict(devices):
     edd_entries_dict = collect_edd_data()
     global edd_dict
     for (edd_number, edd_entry) in edd_entries_dict.items():
-        log.debug("edd: data extracted from 0x%x:\n%s" % (edd_number, edd_entry))
+        log.debug("edd: data extracted from 0x%x:\n%s", edd_number, edd_entry)
         matcher = EddMatcher(edd_entry)
         # first try to match through the pci dev etc.
         name = matcher.devname_from_pci_dev()
         # next try to compare mbr signatures
         if name:
-            log.debug("edd: matched 0x%x to %s using pci_dev" % (edd_number, name))
+            log.debug("edd: matched 0x%x to %s using pci_dev", edd_number, name)
         else:
             name = matcher.match_via_mbrsigs(mbr_dict)
             if name:
-                log.info("edd: matched 0x%x to %s using MBR sig" % (edd_number, name))
+                log.info("edd: matched 0x%x to %s using MBR sig", edd_number, name)
 
         if name:
             old_edd_number = edd_dict.get(name)
             if old_edd_number:
-                log.info("edd: both edd entries 0x%x and 0x%x seem to map to %s" %
-                          (old_edd_number, edd_number, name))
+                log.info("edd: both edd entries 0x%x and 0x%x seem to map to %s",
+                          old_edd_number, edd_number, name)
                 # this means all the other data can be confused and useless
                 return {}
             edd_dict[name] = edd_number
             continue
-        log.error("edd: unable to match edd entry 0x%x" % edd_number)
+        log.error("edd: unable to match edd entry 0x%x", edd_number)
     return edd_dict
 
 edd_dict = {}
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 67f4c5f..024108d 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -93,17 +93,17 @@ def _getConfigArgs(**kwargs):
 def lvm_cc_addFilterRejectRegexp(regexp):
     """ Add a regular expression to the --config string."""
     global config_args_data
-    log.debug("lvm filter: adding %s to the reject list" % regexp)
+    log.debug("lvm filter: adding %s to the reject list", regexp)
     config_args_data["filterRejects"].append(regexp)
 
 def lvm_cc_removeFilterRejectRegexp(regexp):
     """ Remove a regular expression from the --config string."""
     global config_args_data
-    log.debug("lvm filter: removing %s from the reject list" % regexp)
+    log.debug("lvm filter: removing %s from the reject list", regexp)
     try:
         config_args_data["filterRejects"].remove(regexp)
     except ValueError:
-        log.debug("%s wasn't in the reject list" % regexp)
+        log.debug("%s wasn't in the reject list", regexp)
         return
 
 def lvm_cc_resetFilter():
diff --git a/blivet/devicelibs/mdraid.py b/blivet/devicelibs/mdraid.py
index b5bf688..655e1bb 100644
--- a/blivet/devicelibs/mdraid.py
+++ b/blivet/devicelibs/mdraid.py
@@ -101,7 +101,7 @@ def get_raid_superblock_size(size, version=None):
 
         headroom = Size(bytes=headroom)
 
-    log.info("Using %s superBlockSize" % (headroom))
+    log.info("Using %s superBlockSize", headroom)
     return headroom
 
 def mdadm(args):
@@ -220,7 +220,7 @@ def name_from_md_node(node):
         for link in os.listdir(md_dir):
             full_path = "%s/%s" % (md_dir, link)
             md_name = os.path.basename(os.readlink(full_path))
-            log.debug("link: %s -> %s" % (link, os.readlink(full_path)))
+            log.debug("link: %s -> %s", link, os.readlink(full_path))
             if md_name == node:
                 name = link
                 break
@@ -228,5 +228,5 @@ def name_from_md_node(node):
     if not name:
         raise MDRaidError("name_from_md_node(%s) failed" % node)
 
-    log.debug("returning %s" % name)
+    log.debug("returning %s", name)
     return name
diff --git a/blivet/devicelibs/swap.py b/blivet/devicelibs/swap.py
index 74e0710..6f06a2a 100644
--- a/blivet/devicelibs/swap.py
+++ b/blivet/devicelibs/swap.py
@@ -166,9 +166,9 @@ def swapSuggestion(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,
-                                   "swap": swap,
-                                   "size": max_swap})
+                     "instead.", {"percent": MAX_SWAP_DISK_RATIO*100,
+                                  "swap": swap,
+                                  "size": max_swap})
             swap = max_swap
 
     if not quiet:
diff --git a/blivet/devices.py b/blivet/devices.py
index 2df9a43..01c13d6 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -533,7 +533,7 @@ class StorageDevice(Device):
     @property
     def partedDevice(self):
         if self.exists and self.status and not self._partedDevice:
-            log.debug("looking up parted Device: %s" % self.path)
+            log.debug("looking up parted Device: %s", self.path)
 
             # We aren't guaranteed to be able to get a device.  In
             # particular, built-in USB flash readers show up as devices but
@@ -602,7 +602,7 @@ class StorageDevice(Device):
         sysfsName = self.name.replace("/", "!")
         path = os.path.join("/sys", self.sysfsBlockDir, sysfsName)
         self.sysfsPath = os.path.realpath(path)[4:]
-        log.debug("%s sysfsPath set to %s" % (self.name, self.sysfsPath))
+        log.debug("%s sysfsPath set to %s", self.name, self.sysfsPath)
 
     @property
     def formatArgs(self):
@@ -631,7 +631,7 @@ class StorageDevice(Device):
         try:
             util.notify_kernel(path, action="change")
         except (ValueError, IOError) as e:
-            log.warning("failed to notify kernel of change: %s" % e)
+            log.warning("failed to notify kernel of change: %s", e)
 
     @property
     def fstabSpec(self):
@@ -1153,7 +1153,7 @@ class PartitionDevice(StorageDevice):
         #        parted.
 
         if self.exists and not flags.testing:
-            log.debug("looking up parted Partition: %s" % self.path)
+            log.debug("looking up parted Partition: %s", self.path)
             self._partedPartition = self.disk.format.partedDisk.getPartitionByPath(self.path)
             if not self._partedPartition:
                 raise DeviceError("cannot find parted partition instance", self.name)
@@ -1317,7 +1317,7 @@ class PartitionDevice(StorageDevice):
         else:
             raise ValueError("partition must be a parted.Partition instance")
 
-        log.debug("device %s new partedPartition %s" % (self.name, partition))
+        log.debug("device %s new partedPartition %s", self.name, partition)
         self._partedPartition = partition
         self.updateName()
 
@@ -1524,8 +1524,8 @@ class PartitionDevice(StorageDevice):
             start = self.partedPartition.geometry.start
             partition = self.disk.format.partedDisk.getPartitionBySector(start)
 
-        log.debug("post-commit partition path is %s" % getattr(partition,
-                                                               "path", None))
+        log.debug("post-commit partition path is %s", getattr(partition,
+                                                             "path", None))
         self.partedPartition = partition
         if not self.isExtended:
             # Ensure old metadata which lived in freespace so did not get
@@ -1942,7 +1942,7 @@ class DMLinearDevice(DMDevice):
         if not self._preTeardown(recursive=recursive):
             return
 
-        log.debug("not tearing down dm-linear device %s" % self.name)
+        log.debug("not tearing down dm-linear device %s", self.name)
 
     @property
     def description(self):
@@ -2304,7 +2304,7 @@ class LVMVolumeGroupDevice(DMDevice):
            lv.size > self.freeSpace:
             raise DeviceError("new lv is too large to fit in free space", self.name)
 
-        log.debug("Adding %s/%s to %s" % (lv.name, lv.size, self.name))
+        log.debug("Adding %s/%s to %s", lv.name, lv.size, self.name)
         self._lvs.append(lv)
 
     def _removeLogVol(self, lv):
@@ -2422,7 +2422,7 @@ class LVMVolumeGroupDevice(DMDevice):
                 raid_disks = max([raid_disks, len(pv.disks)])
 
         # total the sizes of any LVs
-        log.debug("%s size is %s" % (self.name, self.size))
+        log.debug("%s size is %s", self.name, self.size)
         used = sum(lv.vgSpaceUsed for lv in self.lvs) + self.snapshotSpace
         if not self.exists and raid_disks:
             # (only) we allocate (5 * num_disks) extra extents for LV metadata
@@ -2432,7 +2432,7 @@ class LVMVolumeGroupDevice(DMDevice):
         used += self.reservedSpace
         used += self.poolMetaData
         free = self.size - used
-        log.debug("vg %s has %s free" % (self.name, free))
+        log.debug("vg %s has %s free", self.name, free)
         return free
 
     @property
@@ -2623,12 +2623,12 @@ class LVMLogicalVolumeDevice(DMDevice):
             raise ValueError("new size must of type Size")
 
         size = self.vg.align(size)
-        log.debug("trying to set lv %s size to %s" % (self.name, size))
+        log.debug("trying to set lv %s size to %s", self.name, size)
         if size <= self.vg.freeSpace + self.vgSpaceUsed:
             self._size = size
             self.targetSize = size
         else:
-            log.debug("failed to set size: %s short" % (size - (self.vg.freeSpace + self.vgSpaceUsed),))
+            log.debug("failed to set size: %s short", size - (self.vg.freeSpace + self.vgSpaceUsed))
             raise ValueError("not enough free space in volume group")
 
     size = property(StorageDevice._getSize, _setSize)
@@ -2709,7 +2709,7 @@ class LVMLogicalVolumeDevice(DMDevice):
             StorageDevice._postTeardown(self, recursive=recursive)
         except StorageError:
             if recursive:
-                log.debug("vg %s teardown failed; continuing" % self.vg.name)
+                log.debug("vg %s teardown failed; continuing", self.vg.name)
             else:
                 raise
 
@@ -2886,7 +2886,7 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice):
 
         # TODO: add some checking to prevent overcommit for preexisting
         self.vg._addLogVol(lv)
-        log.debug("Adding %s/%s to %s" % (lv.name, lv.size, self.name))
+        log.debug("Adding %s/%s to %s", lv.name, lv.size, self.name)
         self._lvs.append(lv)
 
     def _removeLogVol(self, lv):
@@ -3105,7 +3105,7 @@ class MDRaidArrayDevice(StorageDevice):
         smallestMemberSize = smallestMember.size
         size = self.level.get_raw_array_size(self.memberDevices,
            smallestMemberSize)
-        log.debug("raw RAID %s size == %s" % (self.level, size))
+        log.debug("raw RAID %s size == %s", self.level, size)
         return size
 
     @property
@@ -3142,10 +3142,10 @@ class MDRaidArrayDevice(StorageDevice):
                    self.chunkSize)
             except (MDRaidError, RaidError):
                 size = 0
-            log.debug("non-existent RAID %s size == %s" % (self.level, size))
+            log.debug("non-existent RAID %s size == %s", self.level, size)
         else:
             size = Size(bytes=self.partedDevice.getLength(unit="B"))
-            log.debug("existing RAID %s size == %s" % (self.level, size))
+            log.debug("existing RAID %s size == %s", self.level, size)
 
         return size
 
@@ -3288,8 +3288,8 @@ class MDRaidArrayDevice(StorageDevice):
                 # mdadd causes udev events
                 udev_settle()
             except MDRaidError as e:
-                log.warning("failed to add member %s to md array %s: %s"
-                            % (device.path, self.path, e))
+                log.warning("failed to add member %s to md array %s: %s",
+                            device.path, self.path, e)
 
         if self.status:
             # we always probe since the device may not be set up when we want
@@ -3621,7 +3621,7 @@ class DMRaidArrayDevice(DMDevice):
         if not self._preTeardown(recursive=recursive):
             return
 
-        log.debug("not tearing down dmraid device %s" % self.name)
+        log.debug("not tearing down dmraid device %s", self.name)
 
     @property
     def description(self):
@@ -4071,17 +4071,17 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
             NetworkStorageDevice.__init__(self,
                                           host_address=address,
                                           nic=self.nic)
-            log.debug("created new iscsi disk %s %s:%s using fw initiator %s"
-                      % (name, address, port, self.initiator))
+            log.debug("created new iscsi disk %s %s:%s using fw initiator %s",
+                      name, address, port, self.initiator)
         else:
             DiskDevice.__init__(self, device, **kwargs)
             NetworkStorageDevice.__init__(self, host_address=self.node.address,
                                           nic=self.nic)
-            log.debug("created new iscsi disk %s %s:%d via %s:%s" % (self.node.name,
-                                                                  self.node.address,
-                                                                  self.node.port,
-                                                                  self.node.iface,
-                                                                  self.nic))
+            log.debug("created new iscsi disk %s %s:%d via %s:%s", self.node.name,
+                                                                   self.node.address,
+                                                                   self.node.port,
+                                                                   self.node.iface,
+                                                                   self.nic)
 
     def dracutSetupArgs(self):
         if self.ibft:
@@ -4140,8 +4140,8 @@ class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
         self.identifier = kwargs.pop("identifier")
         DiskDevice.__init__(self, device, **kwargs)
         NetworkStorageDevice.__init__(self, nic=self.nic)
-        log.debug("created new fcoe disk %s (%s) @ %s" %
-                  (device, self.identifier, self.nic))
+        log.debug("created new fcoe disk %s (%s) @ %s",
+                  device, self.identifier, self.nic)
 
     def dracutSetupArgs(self):
         dcb = True
@@ -4211,7 +4211,7 @@ class OpticalDevice(StorageDevice):
         try:
             util.run_program(["eject", self.name]) 
         except OSError as e:
-            log.warning("error ejecting cdrom %s: %s" % (self.name, e))
+            log.warning("error ejecting cdrom %s: %s", self.name, e)
 
 
 class ZFCPDiskDevice(DiskDevice):
@@ -4328,7 +4328,7 @@ class DASDDevice(DiskDevice):
                 # If we don't know what the feature is (feat not in translate
                 # or if we get a val that doesn't cleanly convert to an int
                 # we can't do anything with it.
-                log.warning("failed to parse dasd feature %s" % chunk)
+                log.warning("failed to parse dasd feature %s", chunk)
 
         if opts:
             return set(["rd.dasd=%s(%s)" % (self.busid,
@@ -4400,7 +4400,7 @@ class BTRFSDevice(StorageDevice):
         log_method_call(self, self.name, status=self.status)
         self.parents[0].updateSysfsPath()
         self.sysfsPath = self.parents[0].sysfsPath
-        log.debug("%s sysfsPath set to %s" % (self.name, self.sysfsPath))
+        log.debug("%s sysfsPath set to %s", self.name, self.sysfsPath)
 
     def _postCreate(self):
         super(BTRFSDevice, self)._postCreate()
@@ -4602,13 +4602,13 @@ class BTRFSVolumeDevice(BTRFSDevice):
         try:
             self._do_temp_mount(orig=True)
         except FSError as e:
-            log.debug("btrfs temp mount failed: %s" % e)
+            log.debug("btrfs temp mount failed: %s", e)
             return subvols
 
         try:
             subvols = btrfs.list_subvolumes(self.originalFormat._mountpoint)
         except BTRFSError as e:
-            log.debug("failed to list subvolumes: %s" % e)
+            log.debug("failed to list subvolumes: %s", e)
         else:
             self._getDefaultSubVolumeID()
         finally:
@@ -4632,7 +4632,7 @@ class BTRFSVolumeDevice(BTRFSDevice):
         try:
             subvolid = btrfs.get_default_subvolume(self.originalFormat._mountpoint)
         except BTRFSError as e:
-            log.debug("failed to get default subvolume id: %s" % e)
+            log.debug("failed to get default subvolume id: %s", e)
 
         self._defaultSubVolumeID = subvolid
 
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index c166e3d..d75549e 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -165,13 +165,13 @@ class DeviceTree(object):
         """ Remove redundant/obsolete actions from the action list. """
         for action in reversed(self._actions[:]):
             if action not in self._actions:
-                log.debug("action %d already pruned" % action.id)
+                log.debug("action %d already pruned", action.id)
                 continue
 
             for obsolete in self._actions[:]:
                 if action.obsoletes(obsolete):
-                    log.info("removing obsolete action %d (%d)"
-                             % (obsolete.id, action.id))
+                    log.info("removing obsolete action %d (%d)",
+                             obsolete.id, action.id)
                     self._actions.remove(obsolete)
 
     def sortActions(self):
@@ -244,7 +244,7 @@ class DeviceTree(object):
                 self._actions.append(ActionCreateDevice(device))
 
         for action in self._actions:
-            log.debug("action: %s" % action)
+            log.debug("action: %s", action)
 
         log.info("pruning action queue...")
         self.pruneActions()
@@ -252,14 +252,14 @@ class DeviceTree(object):
         log.info("sorting actions...")
         self.sortActions()
         for action in self._actions:
-            log.debug("action: %s" % action)
+            log.debug("action: %s", action)
 
             # Remove lvm filters for devices we are operating on
             for device in (d for d in self._devices if d.dependsOn(action.device)):
                 lvm.lvm_cc_removeFilterRejectRegexp(device.name)
 
         for action in self._actions[:]:
-            log.info("executing action: %s" % action)
+            log.info("executing action: %s", action)
             if not dryRun:
                 try:
                     action.execute()
@@ -320,9 +320,9 @@ class DeviceTree(object):
             newdev.type != "btrfs volume" and
             newdev.name not in self.names):
             self.names.append(newdev.name)
-        log.info("added %s %s (id %d) to device tree" % (newdev.type,
-                                                          newdev.name,
-                                                          newdev.id))
+        log.info("added %s %s (id %d) to device tree", newdev.type,
+                                                       newdev.name,
+                                                       newdev.id)
 
     def _removeDevice(self, dev, force=None, moddisk=True):
         """ Remove a device from the tree.
@@ -342,7 +342,7 @@ class DeviceTree(object):
             raise ValueError("Device '%s' not in tree" % dev.name)
 
         if not dev.isleaf and not force:
-            log.debug("%s has %d kids" % (dev.name, dev.kids))
+            log.debug("%s has %d kids", dev.name, dev.kids)
             raise ValueError("Cannot remove non-leaf device '%s'" % dev.name)
 
         if moddisk:
@@ -374,9 +374,9 @@ class DeviceTree(object):
         self._devices.remove(dev)
         if dev.name in self.names and getattr(dev, "complete", True):
             self.names.remove(dev.name)
-        log.info("removed %s %s (id %d) from device tree" % (dev.type,
-                                                              dev.name,
-                                                              dev.id))
+        log.info("removed %s %s (id %d) from device tree", dev.type,
+                                                           dev.name,
+                                                           dev.id)
 
         for parent in dev.parents:
             # Will this cause issues with garbage collection?
@@ -419,7 +419,7 @@ class DeviceTree(object):
                action.device.format.mountpoint in self.filesystems:
                 raise DeviceTreeError("mountpoint already in use")
 
-        log.info("registered action: %s" % action)
+        log.info("registered action: %s", action)
         self._actions.append(action)
 
     def cancelAction(self, action):
@@ -579,7 +579,7 @@ class DeviceTree(object):
         if self.udevDeviceIsDisk(info):
             # Ignore any readonly disks
             if util.get_sysfs_attr(info["sysfs_path"], 'ro') == '1':
-                log.debug("Ignoring read only device %s" % name)
+                log.debug("Ignoring read only device %s", name)
                 # FIXME: We have to handle this better, ie: not ignore these.
                 self.addIgnoredDisk(name)
                 return True
@@ -619,7 +619,7 @@ class DeviceTree(object):
         vg_name = udev_device_get_lv_vg_name(info)
         device = self.getDeviceByName(vg_name, hidden=True)
         if device and not isinstance(device, LVMVolumeGroupDevice):
-            log.warning("found non-vg device with name %s" % vg_name)
+            log.warning("found non-vg device with name %s", vg_name)
             device = None
 
         if not device:
@@ -634,7 +634,7 @@ class DeviceTree(object):
         vg_name = udev_device_get_lv_vg_name(info)
         device = self.getDeviceByName(vg_name)
         if not device:
-            log.error("failed to find vg '%s' after scanning pvs" % vg_name)
+            log.error("failed to find vg '%s' after scanning pvs", vg_name)
 
         # Don't return the device like we do in the other addUdevFooDevice
         # methods. The device we have here is a vg, not an lv.
@@ -662,7 +662,7 @@ class DeviceTree(object):
                 # This is a little lame, but the VG device is a DMDevice
                 # and it won't have a dm node. At any rate, this is not
                 # important enough to crash the install.
-                log.debug("failed to find dm node for %s" % dmdev.name)
+                log.debug("failed to find dm node for %s", dmdev.name)
                 continue
 
         handle_luks = (udev_device_is_dm_luks(info) and
@@ -691,7 +691,7 @@ class DeviceTree(object):
                         if slave_dev is None:
                             # if the current slave is still not in
                             # the tree, something has gone wrong
-                            log.error("failure scanning device %s: could not add slave %s" % (name, dev_name))
+                            log.error("failure scanning device %s: could not add slave %s", name, dev_name)
                             return
 
                 if handle_luks:
@@ -728,7 +728,7 @@ class DeviceTree(object):
             # the tree, this device should be as well
             if device is None:
                 devicelibs.lvm.lvm_cc_addFilterRejectRegexp(name)
-                log.warning("ignoring dm device %s" % name)
+                log.warning("ignoring dm device %s", name)
 
         return device
 
@@ -763,7 +763,7 @@ class DeviceTree(object):
                     if slave_dev is None:
                         # if the current slave is still not in
                         # the tree, something has gone wrong
-                        log.error("failure scanning device %s: could not add slave %s" % (name, dev_name))
+                        log.error("failure scanning device %s: could not add slave %s", name, dev_name)
                         return
 
             slave_devs.append(slave_dev)
@@ -772,7 +772,7 @@ class DeviceTree(object):
             try:
                 serial = info["DM_UUID"].split("-", 1)[1]
             except (IndexError, AttributeError):
-                log.error("multipath device %s has no DM_UUID" % name)
+                log.error("multipath device %s has no DM_UUID", name)
                 raise DeviceTreeError("multipath %s has no DM_UUID" % name)
 
             device = MultipathDevice(name, parents=slave_devs,
@@ -809,7 +809,7 @@ class DeviceTree(object):
                     if self.getDeviceByName(dev_name) is None:
                         # if the current slave is still not in
                         # the tree, something has gone wrong
-                        log.error("failure scanning device %s: could not add slave %s" % (name, dev_name))
+                        log.error("failure scanning device %s: could not add slave %s", name, dev_name)
                         return
 
         # try to get the device again now that we've got all the slaves
@@ -828,11 +828,11 @@ class DeviceTree(object):
             else:
                 path = "/dev/md/" + name
 
-            log.error("failed to scan md array %s" % name)
+            log.error("failed to scan md array %s", name)
             try:
                 devicelibs.mdraid.mddeactivate(path)
             except MDRaidError:
-                log.error("failed to stop broken md array %s" % name)
+                log.error("failed to stop broken md array %s", name)
 
         return device
 
@@ -867,7 +867,7 @@ class DeviceTree(object):
             if disk is None:
                 # if the current device is still not in
                 # the tree, something has gone wrong
-                log.error("failure scanning device %s" % disk_name)
+                log.error("failure scanning device %s", disk_name)
                 devicelibs.lvm.lvm_cc_addFilterRejectRegexp(name)
                 return
 
@@ -888,7 +888,7 @@ class DeviceTree(object):
             if not disk.format.hidden:
                 devicelibs.lvm.lvm_cc_addFilterRejectRegexp(name)
 
-            log.debug("ignoring partition %s on %s" % (name, disk.format.type))
+            log.debug("ignoring partition %s on %s", name, disk.format.type)
             return
 
         try:
@@ -902,7 +902,7 @@ class DeviceTree(object):
             # prompt to re-initialize the disk, so simply skip the
             # faulty partitions.
             # XXX not sure about this
-            log.error("Failed to instantiate PartitionDevice: %s" % e)
+            log.error("Failed to instantiate PartitionDevice: %s", e)
             return
 
         self._addDevice(device)
@@ -937,7 +937,7 @@ class DeviceTree(object):
                 kwargs["node"] = node
                 kwargs["ibft"] = node in self.iscsi.ibftNodes
                 kwargs["nic"] = self.iscsi.ifaces.get(node.iface, node.iface)
-                log.info("%s is an iscsi disk" % name)
+                log.info("%s is an iscsi disk", name)
             else:
                 # qla4xxx partial offload
                 kwargs["node"] = None
@@ -950,7 +950,7 @@ class DeviceTree(object):
             diskType = FcoeDiskDevice
             kwargs["nic"]        = udev_device_get_fcoe_nic(info)
             kwargs["identifier"] = udev_device_get_fcoe_identifier(info)
-            log.info("%s is an fcoe disk" % name)
+            log.info("%s is an fcoe disk", name)
         elif udev_device_get_md_container(info):
             name = udev_device_get_md_name(info)
             diskType = MDRaidArrayDevice
@@ -962,14 +962,14 @@ class DeviceTree(object):
                 container_sysfs = "/class/block/" + parentSysName
                 container_info = udev_get_block_device(container_sysfs)
                 if not container_info:
-                    log.error("failed to find md container %s at %s"
-                                % (parentName, container_sysfs))
+                    log.error("failed to find md container %s at %s",
+                                parentName, container_sysfs)
                     return
 
                 self.addUdevDevice(container_info)
                 container = self.getDeviceByName(parentName)
                 if not container:
-                    log.error("failed to scan md container %s" % parentName)
+                    log.error("failed to scan md container %s", parentName)
                     return
 
             kwargs["parents"] = [container]
@@ -988,17 +988,17 @@ class DeviceTree(object):
             for attr in ['readonly', 'use_diag', 'erplog', 'failfast']:
                 kwargs["opts"][attr] = udev_device_get_dasd_flag(info, attr)
 
-            log.info("%s is a dasd device" % name)
+            log.info("%s is a dasd device", name)
         elif udev_device_is_zfcp(info):
             diskType = ZFCPDiskDevice
 
             for attr in ['hba_id', 'wwpn', 'fcp_lun']:
                 kwargs[attr] = udev_device_get_zfcp_attribute(info, attr=attr)
 
-            log.info("%s is a zfcp device" % name)
+            log.info("%s is a zfcp device", name)
         else:
             diskType = DiskDevice
-            log.info("%s is a disk" % name)
+            log.info("%s is a disk", name)
 
         device = diskType(name,
                           major=udev_device_get_major(info),
@@ -1068,7 +1068,7 @@ class DeviceTree(object):
                 else:
                     reason = "hidden"
 
-                log.debug("skipping %s device %s" % (reason, name))
+                log.debug("skipping %s device %s", reason, name)
                 return
 
         # make sure we note the name of every device we see
@@ -1076,13 +1076,13 @@ class DeviceTree(object):
             self.names.append(name)
 
         if self.isIgnored(info):
-            log.info("ignoring %s (%s)" % (name, sysfs_path))
+            log.info("ignoring %s (%s)", name, sysfs_path)
             if name not in self.ignoredDisks:
                 self.addIgnoredDisk(name)
 
             return
 
-        log.info("scanning %s (%s)..." % (name, sysfs_path))
+        log.info("scanning %s (%s)...", name, sysfs_path)
         device = self.getDeviceByName(name)
         if device is None and udev_device_is_md(info):
             device = self.getDeviceByName(udev_device_get_md_name(info))
@@ -1096,7 +1096,7 @@ class DeviceTree(object):
             info["ID_FS_TYPE"] = "multipath_member"
             # newly added device (eg iSCSI) could make this one a multipath member
             if device.format and device.format.type != "multipath_member":
-                log.debug("%s newly detected as multipath member, dropping old format and removing kids" % device.name)
+                log.debug("%s newly detected as multipath member, dropping old format and removing kids", device.name)
                 # remove children from tree so that we don't stumble upon them later
                 self._removeChildrenFromTree(device)
                 device.format = formats.DeviceFormat()
@@ -1109,20 +1109,20 @@ class DeviceTree(object):
             # first, grab the parted.Device while it's active
             _unused = device.partedDevice
         elif udev_device_is_loop(info):
-            log.info("%s is a loop device" % name)
+            log.info("%s is a loop device", name)
             device = self.addUdevLoopDevice(info)
         elif udev_device_is_dm_mpath(info) and \
              not udev_device_is_dm_partition(info):
-            log.info("%s is a multipath device" % name)
+            log.info("%s is a multipath device", name)
             device = self.addUdevMultiPathDevice(info)
         elif udev_device_is_dm_lvm(info):
-            log.info("%s is an lvm logical volume" % name)
+            log.info("%s is an lvm logical volume", name)
             device = self.addUdevLVDevice(info)
         elif udev_device_is_dm(info):
-            log.info("%s is a device-mapper device" % name)
+            log.info("%s is a device-mapper device", name)
             device = self.addUdevDMDevice(info)
         elif udev_device_is_md(info) and not udev_device_get_md_container(info):
-            log.info("%s is an md device" % name)
+            log.info("%s is an md device", name)
             if uuid:
                 # try to find the device by uuid
                 device = self.getDeviceByUuid(uuid)
@@ -1130,10 +1130,10 @@ class DeviceTree(object):
             if device is None:
                 device = self.addUdevMDDevice(info)
         elif udev_device_is_cdrom(info):
-            log.info("%s is a cdrom" % name)
+            log.info("%s is a cdrom", name)
             device = self.addUdevOpticalDevice(info)
         elif udev_device_is_biosraid_member(info) and udev_device_is_disk(info):
-            log.info("%s is part of a biosraid" % name)
+            log.info("%s is part of a biosraid", name)
             device = DiskDevice(name,
                             major=udev_device_get_major(info),
                             minor=udev_device_get_minor(info),
@@ -1142,10 +1142,10 @@ class DeviceTree(object):
         elif udev_device_is_disk(info):
             device = self.addUdevDiskDevice(info)
         elif udev_device_is_partition(info):
-            log.info("%s is a partition" % name)
+            log.info("%s is a partition", name)
             device = self.addUdevPartitionDevice(info)
         else:
-            log.error("Unknown block device type for: %s" % name)
+            log.error("Unknown block device type for: %s", name)
             return
 
         # If this device is protected, mark it as such now. Once the tree
@@ -1176,9 +1176,9 @@ class DeviceTree(object):
 
         # now handle the device's formatting
         self.handleUdevDeviceFormat(info, device)
-        log.info("got device: %r" % device)
+        log.info("got device: %r", device)
         if device.format.type:
-            log.info("got format: %r" % device.format)
+            log.info("got format: %r", device.format)
         device.originalFormat = copy.copy(device.format)
         device.deviceLinks = udev_device_get_symlinks(info)
 
@@ -1188,19 +1188,19 @@ class DeviceTree(object):
         # if there is no disklabel on the device
         if disklabel_type is None and \
            getFormat(udev_device_get_format(info)).type is not None:
-            log.debug("device %s does not contain a disklabel" % device.name)
+            log.debug("device %s does not contain a disklabel", device.name)
             return
 
         if device.partitioned:
             # this device is already set up
-            log.debug("disklabel format on %s already set up" % device.name)
+            log.debug("disklabel format on %s already set up", device.name)
             return
 
         try:
             device.setup()
         except Exception as e:
-            log.debug("setup of %s failed: %s" % (device.name, e))
-            log.warning("aborting disklabel handler for %s" % device.name)
+            log.debug("setup of %s failed: %s", device.name, e)
+            log.warning("aborting disklabel handler for %s", device.name)
             return
 
         # special handling for unsupported partitioned devices
@@ -1211,8 +1211,8 @@ class DeviceTree(object):
                                    labelType=disklabel_type,
                                    exists=True)
             except InvalidDiskLabelError:
-                log.warning("disklabel detected but not usable on %s"
-                            % device.name)
+                log.warning("disklabel detected but not usable on %s",
+                            device.name)
                 pass
             return
 
@@ -1226,7 +1226,7 @@ class DeviceTree(object):
                                labelType=labelType,
                                exists=True)
         except InvalidDiskLabelError as e:
-            log.info("no usable disklabel on %s" % device.name)
+            log.info("no usable disklabel on %s", device.name)
             if disklabel_type == "gpt":
                 log.debug(e)
                 device.format = getFormat(_("Invalid Disk Label"))
@@ -1236,7 +1236,7 @@ class DeviceTree(object):
     def handleUdevLUKSFormat(self, info, device):
         log_method_call(self, name=device.name, type=device.format.type)
         if not device.format.uuid:
-            log.info("luks device %s has no uuid" % device.path)
+            log.info("luks device %s has no uuid", device.path)
             return
 
         # look up or create the mapped device
@@ -1247,8 +1247,8 @@ class DeviceTree(object):
             elif passphrase:
                 device.format.passphrase = passphrase
             elif device.format.uuid in self.__luksDevs:
-                log.info("skipping previously-skipped luks device %s"
-                            % device.name)
+                log.info("skipping previously-skipped luks device %s",
+                            device.name)
             elif self._cleanup or flags.testing:
                 # if we're only building the devicetree so that we can
                 # tear down all of the devices we don't need a passphrase
@@ -1275,15 +1275,14 @@ class DeviceTree(object):
             try:
                 luks_device.setup()
             except (LUKSError, CryptoError, DeviceError) as e:
-                log.info("setup of %s failed: %s" % (device.format.mapName,
-                                                     e))
+                log.info("setup of %s failed: %s", device.format.mapName, e)
                 device.removeChild()
             else:
                 luks_device.updateSysfsPath()
                 self._addDevice(luks_device)
         else:
-            log.warning("luks device %s already in the tree"
-                        % device.format.mapName)
+            log.warning("luks device %s already in the tree",
+                        device.format.mapName)
 
     def handleVgLvs(self, vg_device):
         """ Handle setup of the LV's in the vg_device. """
@@ -1296,11 +1295,11 @@ class DeviceTree(object):
         lv_types = vg_device.lv_types
 
         if not vg_device.complete:
-            log.warning("Skipping LVs for incomplete VG %s" % vg_name)
+            log.warning("Skipping LVs for incomplete VG %s", vg_name)
             return
 
         if not lv_names:
-            log.debug("no LVs listed for VG %s" % vg_name)
+            log.debug("no LVs listed for VG %s", vg_name)
             return
 
         def lv_attr_cmp(a, b):
@@ -1329,22 +1328,22 @@ class DeviceTree(object):
 
             if self.getDeviceByName(name):
                 # some lvs may have been added on demand below
-                log.debug("already added %s" % name)
+                log.debug("already added %s", name)
                 return
 
             if lv_attr[0] in 'Ss':
-                log.info("found lvm snapshot volume '%s'" % name)
+                log.info("found lvm snapshot volume '%s'", name)
                 origin_name = devicelibs.lvm.lvorigin(vg_name, lv_name)
                 if not origin_name:
-                    log.error("lvm snapshot '%s-%s' has unknown origin"
-                                % (vg_name, lv_name))
+                    log.error("lvm snapshot '%s-%s' has unknown origin",
+                                vg_name, lv_name)
                     return
 
                 origin_device_name = "%s-%s" % (vg_name, origin_name)
                 origin = self.getDeviceByName(origin_device_name)
                 if not origin:
                     if origin_name.endswith("_vorigin]"):
-                        log.info("snapshot volume '%s' has vorigin" % name)
+                        log.info("snapshot volume '%s' has vorigin", name)
                         vg_device.voriginSnapshots[lv_name] = lv_size
                         return
                     else:
@@ -1355,11 +1354,11 @@ class DeviceTree(object):
 
                         if origin is None:
                             log.warning("snapshot lv '%s' origin lv '%s' not "
-                                        "found" % (name, origin_device_name))
+                                        "found", name, origin_device_name)
                             return
 
-                log.debug("adding %s to %s snapshot total"
-                            % (lv_sizes[index], origin.name))
+                log.debug("adding %s to %s snapshot total",
+                            lv_sizes[index], origin.name)
                 origin.snapshotSpace += lv_size
                 return
             elif lv_attr[0] == 'v':
@@ -1425,7 +1424,7 @@ class DeviceTree(object):
                     lv_device.updateSysfsPath()
                     lv_info = udev_get_block_device(lv_device.sysfsPath)
                     if not lv_info:
-                        log.error("failed to get udev data for lv %s" % lv_device.name)
+                        log.error("failed to get udev data for lv %s", lv_device.name)
                         return
 
                     # do format handling now
@@ -1454,9 +1453,9 @@ class DeviceTree(object):
             lv_dev.metaDataSize = data["meta"]
             lv_dev.logSize = data["log"]
             log.debug("set %s copies to %d, metadata size to %s, log size "
-                      "to %s, total size %s"
-                        % (lv_dev.name, lv_dev.copies, lv_dev.metaDataSize,
-                           lv_dev.logSize, lv_dev.vgSpaceUsed))
+                      "to %s, total size %s",
+                        lv_dev.name, lv_dev.copies, lv_dev.metaDataSize,
+                        lv_dev.logSize, lv_dev.vgSpaceUsed)
 
     def handleUdevLVMPVFormat(self, info, device):
         log_method_call(self, name=device.name, type=device.format.type)
@@ -1469,7 +1468,7 @@ class DeviceTree(object):
             return
 
         if not vg_name:
-            log.info("lvm pv %s has no vg" % device.name)
+            log.info("lvm pv %s has no vg", device.name)
             return
 
         vg_device = self.getDeviceByUuid(vg_uuid, incomplete=True)
@@ -1484,7 +1483,7 @@ class DeviceTree(object):
                 pe_free = udev_device_get_vg_free_extents(info)
                 pv_count = udev_device_get_vg_pv_count(info)
             except (KeyError, ValueError) as e:
-                log.warning("invalid data for %s: %s" % (device.name, e))
+                log.warning("invalid data for %s: %s", device.name, e)
                 return
 
             vg_device = LVMVolumeGroupDevice(vg_name,
@@ -1511,7 +1510,7 @@ class DeviceTree(object):
             lv_attr = udev_device_get_lv_attr(info)
             lv_types = udev_device_get_lv_types(info)
         except KeyError as e:
-            log.warning("invalid data for %s: %s" % (device.name, e))
+            log.warning("invalid data for %s: %s", device.name, e)
             return
 
         for i in range(len(lv_names)):
@@ -1548,7 +1547,7 @@ class DeviceTree(object):
                 md_devices = int(udev_device_get_md_devices(info))
                 md_uuid = udev_device_get_md_uuid(info)
             except (KeyError, ValueError) as e:
-                log.warning("invalid data for %s: %s" % (name, e))
+                log.warning("invalid data for %s: %s", name, e)
                 return
 
             md_metadata = info.get("MD_METADATA")
@@ -1597,11 +1596,10 @@ class DeviceTree(object):
                     if md_name:
                         array = self.getDeviceByName(md_name, incomplete=True)
                         if array and array.uuid != md_uuid:
-                            log.error("found multiple devices with the name %s"
-                                        % md_name)
+                            log.error("found multiple devices with the name %s", md_name)
 
-            log.info("using name %s for md array containing member %s"
-                        % (md_name, device.name))
+            log.info("using name %s for md array containing member %s",
+                        md_name, device.name)
             try:
                 md_array = MDRaidArrayDevice(md_name,
                                              level=md_level,
@@ -1610,7 +1608,7 @@ class DeviceTree(object):
                                              metadataVersion=md_metadata,
                                              exists=True)
             except ValueError as e:
-                log.error("failed to create md array: %s" % e)
+                log.error("failed to create md array: %s", e)
                 return
 
             md_array.updateSysfsPath()
@@ -1638,7 +1636,7 @@ class DeviceTree(object):
                                             major=major, minor=minor)
         if len(rss) == 0:
             log.warning("dmraid member %s does not appear to belong to any "
-                        "array" % device.name)
+                        "array", device.name)
             return
 
         for rs in rss:
@@ -1686,11 +1684,11 @@ class DeviceTree(object):
                 break
 
         if btrfs_dev:
-            log.info("found btrfs volume %s" % btrfs_dev.name)
+            log.info("found btrfs volume %s", btrfs_dev.name)
             btrfs_dev._addDevice(device)
         else:
             label = udev_device_get_label(info)
-            log.info("creating btrfs volume btrfs.%s" % label)
+            log.info("creating btrfs volume btrfs.%s", label)
             btrfs_dev = BTRFSVolumeDevice(label, parents=[device], uuid=uuid,
                                           exists=True)
             self._addDevice(btrfs_dev)
@@ -1712,8 +1710,8 @@ class DeviceTree(object):
                         break
 
                 if parent is None:
-                    log.error("failed to find parent (%d) for subvol %s"
-                              % (parent_id, vol_path))
+                    log.error("failed to find parent (%d) for subvol %s",
+                              parent_id, vol_path)
                     raise DeviceTreeError("could not find parent for subvol")
 
                 fmt = getFormat("btrfs", device=btrfs_dev.path, exists=True,
@@ -1755,7 +1753,7 @@ class DeviceTree(object):
         if (not device) or (not format_type) or device.format.type:
             # this device has no formatting or it has already been set up
             # FIXME: this probably needs something special for disklabels
-            log.debug("no type or existing type for %s, bailing" % (name,))
+            log.debug("no type or existing type for %s, bailing", name)
             return
 
         # set up the common arguments for the format constructor
@@ -1777,7 +1775,7 @@ class DeviceTree(object):
             try:
                 kwargs["mdUuid"] = udev_device_get_md_uuid(info)
             except KeyError:
-                log.warning("mdraid member %s has no md uuid" % name)
+                log.warning("mdraid member %s has no md uuid", name)
             kwargs["biosraid"] = udev_device_is_biosraid_member(info)
         elif format_type == "LVM2_member":
             # lvm
@@ -1786,15 +1784,15 @@ class DeviceTree(object):
             try:
                 kwargs["vgName"] = udev_device_get_vg_name(info)
             except KeyError as e:
-                log.warning("PV %s has no vg_name" % name)
+                log.warning("PV %s has no vg_name", name)
             try:
                 kwargs["vgUuid"] = udev_device_get_vg_uuid(info)
             except KeyError:
-                log.warning("PV %s has no vg_uuid" % name)
+                log.warning("PV %s has no vg_uuid", name)
             try:
                 kwargs["peStart"] = udev_device_get_pv_pe_start(info)
             except KeyError:
-                log.warning("PV %s has no pe_start" % name)
+                log.warning("PV %s has no pe_start", name)
         elif format_type == "vfat":
             # efi magic
             if isinstance(device, PartitionDevice) and device.bootable:
@@ -1820,11 +1818,11 @@ class DeviceTree(object):
             kwargs["volUUID"] = uuid
 
         try:
-            log.info("type detected on '%s' is '%s'" % (name, format_type,))
+            log.info("type detected on '%s' is '%s'", name, format_type)
             device.format = formats.getFormat(*args, **kwargs)
         except FSError:
-            log.warning("type '%s' on '%s' invalid, assuming no format" %
-                      (format_type, name,))
+            log.warning("type '%s' on '%s' invalid, assuming no format",
+                      format_type, name)
             device.format = formats.DeviceFormat()
             return
 
@@ -1843,11 +1841,11 @@ class DeviceTree(object):
             self.handleBTRFSFormat(info, device)
 
     def updateDeviceFormat(self, device):
-        log.info("updating format of device: %s" % device)
+        log.info("updating format of device: %s", device)
         try:
             util.notify_kernel("/sys%s" % device.sysfsPath)
         except (ValueError, IOError) as e:
-            log.warning("failed to notify kernel of change: %s" % e)
+            log.warning("failed to notify kernel of change: %s", e)
 
         udev_settle()
         info = udev_get_device(device.sysfsPath)
@@ -1855,7 +1853,7 @@ class DeviceTree(object):
         if info:
             self.handleUdevDeviceFormat(info, device)
             if device.format.type:
-                log.info("got format: %s" % device.format)
+                log.info("got format: %s", device.format)
 
     def _handleInconsistencies(self):
         for vg in [d for d in self.devices if d.type == "lvmvg"]:
@@ -1908,9 +1906,9 @@ class DeviceTree(object):
         for d in self.getChildren(device):
             self.hide(d)
 
-        log.info("hiding device %s %s (id %d)" % (device.type,
-                                                  device.name,
-                                                  device.id))
+        log.info("hiding device %s %s (id %d)", device.type,
+                                                device.name,
+                                                device.id)
 
         for action in reversed(self._actions):
             self.cancelAction(action)
@@ -1945,9 +1943,9 @@ class DeviceTree(object):
         # the hidden list should be in leaves-first order
         for hidden in reversed(self._hidden):
             if hidden == device or hidden.dependsOn(device):
-                log.info("unhiding device %s %s (id %d)" % (hidden.type,
-                                                            hidden.name,
-                                                            hidden.id))
+                log.info("unhiding device %s %s (id %d)", hidden.type,
+                                                          hidden.name,
+                                                          hidden.id)
                 self._hidden.remove(hidden)
                 self._devices.append(hidden)
                 lvm.lvm_cc_removeFilterRejectRegexp(hidden.name)
@@ -1960,11 +1958,11 @@ class DeviceTree(object):
     def setupDiskImages(self):
         """ Set up devices to represent the disk image files. """
         for (name, path) in self.diskImages.items():
-            log.info("setting up disk image file '%s' as '%s'" % (path, name))
+            log.info("setting up disk image file '%s' as '%s'", path, name)
             try:
                 filedev = FileDevice(path, exists=True)
                 filedev.setup()
-                log.debug("%s" % filedev)
+                log.debug("%s", filedev)
 
                 loop_name = devicelibs.loop.get_loop_name(filedev.path)
                 loop_sysfs = None
@@ -1975,16 +1973,16 @@ class DeviceTree(object):
                                      sysfsPath=loop_sysfs,
                                      exists=True)
                 loopdev.setup()
-                log.debug("%s" % loopdev)
+                log.debug("%s", loopdev)
                 dmdev = DMLinearDevice(name,
                                        dmUuid="ANACONDA-%s" % name,
                                        parents=[loopdev],
                                        exists=True)
                 dmdev.setup()
                 dmdev.updateSysfsPath()
-                log.debug("%s" % dmdev)
+                log.debug("%s", dmdev)
             except (ValueError, DeviceError) as e:
-                log.error("failed to set up disk image: %s" % e)
+                log.error("failed to set up disk image: %s", e)
             else:
                 self._addDevice(filedev)
                 self._addDevice(loopdev)
@@ -2012,7 +2010,7 @@ class DeviceTree(object):
                     os.unlink(dst)
                 except OSError as e:
                     msg = str(e)
-                    log.info("failed to remove %s: %s" % (dst, msg))
+                    log.info("failed to remove %s: %s", dst, msg)
 
             if os.access(src, os.W_OK):
                 # copy the config to a backup with extension ".anacbak"
@@ -2020,18 +2018,18 @@ class DeviceTree(object):
                     func(src, dst)
                 except (IOError, OSError) as e:
                     msg = str(e)
-                    log.error("failed to %s of %s: %s" % (op, cfg, msg))
+                    log.error("failed to %s of %s: %s", op, cfg, msg)
             elif restore and os.access(cfg, os.W_OK):
                 # remove the config since we created it
-                log.info("removing anaconda-created %s" % cfg)
+                log.info("removing anaconda-created %s", cfg)
                 try:
                     os.unlink(cfg)
                 except OSError as e:
                     msg = str(e)
-                    log.error("failed to remove %s: %s" % (cfg, msg))
+                    log.error("failed to remove %s: %s", cfg, msg)
             else:
                 # don't try to backup non-existent configs
-                log.info("not going to %s of non-existent %s" % (op, cfg))
+                log.info("not going to %s of non-existent %s", op, cfg)
 
     def restoreConfigs(self):
         self.backupConfigs(restore=True)
@@ -2058,8 +2056,8 @@ class DeviceTree(object):
             self.restoreConfigs()
 
     def _populate(self):
-        log.info("DeviceTree.populate: ignoredDisks is %s ; exclusiveDisks is %s"
-                    % (self.ignoredDisks, self.exclusiveDisks))
+        log.info("DeviceTree.populate: ignoredDisks is %s ; exclusiveDisks is %s",
+                    self.ignoredDisks, self.exclusiveDisks)
 
         # this has proven useful when populating after opening a LUKS device
         udev_settle()
@@ -2076,7 +2074,7 @@ class DeviceTree(object):
         # resolve the protected device specs to device names
         for spec in self.protectedDevSpecs:
             name = udev_resolve_devspec(spec)
-            log.debug("protected device spec %s resolved to %s" % (spec, name))
+            log.debug("protected device spec %s resolved to %s", spec, name)
             if name:
                 self.protectedDevNames.append(name)
 
@@ -2088,8 +2086,8 @@ class DeviceTree(object):
                 continue
 
             live_device_name = mnt.split()[0].split("/")[-1]
-            log.info("%s looks to be the live device; marking as protected"
-                     % (live_device_name,))
+            log.info("%s looks to be the live device; marking as protected",
+                     live_device_name)
             self.protectedDevNames.append(live_device_name)
             self.liveBackingDevice = live_device_name
             break
@@ -2111,7 +2109,7 @@ class DeviceTree(object):
                 # nothing is changing -- we are finished building devices
                 break
 
-            log.info("devices to scan: %s" % [d['name'] for d in devices])
+            log.info("devices to scan: %s", [d['name'] for d in devices])
             for dev in devices:
                 self.addUdevDevice(dev)
 
@@ -2152,7 +2150,7 @@ class DeviceTree(object):
             try:
                 device.teardown(recursive=True)
             except StorageError as e:
-                log.info("teardown of %s failed: %s" % (device.name, e))
+                log.info("teardown of %s failed: %s", device.name, e)
 
     def setupAll(self):
         """ Run setup methods on all devices. """
@@ -2160,7 +2158,7 @@ class DeviceTree(object):
             try:
                 device.setup()
             except DeviceError as (msg, name):
-                log.error("setup of %s failed: %s" % (device.name, msg))
+                log.error("setup of %s failed: %s", device.name, msg)
 
     def getDeviceBySysfsPath(self, path, incomplete=False, hidden=False):
         """ Return a list of devices with a matching sysfs path.
@@ -2243,7 +2241,7 @@ class DeviceTree(object):
                 continue
 
             if not hasattr(device, "serial"):
-                log.warning("device %s has no serial attr" % device.name)
+                log.warning("device %s has no serial attr", device.name)
                 continue
             if device.serial == serial:
                 retval.append(device)
@@ -2528,7 +2526,7 @@ class DeviceTree(object):
                     try:
                         dm_name = devicelibs.dm.name_from_dm_node(devspec[5:])
                     except StorageError as e:
-                        log.info("failed to resolve %s: %s" % (devspec, e))
+                        log.info("failed to resolve %s: %s", devspec, e)
                         dm_name = None
 
                     if dm_name:
@@ -2538,7 +2536,7 @@ class DeviceTree(object):
                     try:
                         md_name = devicelibs.mdraid.name_from_md_node(devspec[5:])
                     except StorageError as e:
-                        log.info("failed to resolve %s: %s" % (devspec, e))
+                        log.info("failed to resolve %s: %s", devspec, e)
                         md_name = None
 
                     if md_name:
@@ -2553,7 +2551,7 @@ class DeviceTree(object):
                     # path with a UUID
                     blkidTabEnt = blkidTab.get(devspec)
                     if blkidTabEnt:
-                        log.debug("found blkid.tab entry for '%s'" % devspec)
+                        log.debug("found blkid.tab entry for '%s'", devspec)
                         uuid = blkidTabEnt.get("UUID")
                         if uuid:
                             device = self.getDeviceByUuid(uuid)
@@ -2561,11 +2559,11 @@ class DeviceTree(object):
                                 devstr = device.name
                             else:
                                 devstr = "None"
-                            log.debug("found device '%s' in tree" % devstr)
+                            log.debug("found device '%s' in tree", devstr)
                         if device and device.format and \
                            device.format.type == "luks":
                             map_name = device.format.mapName
-                            log.debug("luks device; map name is '%s'" % map_name)
+                            log.debug("luks device; map name is '%s'", map_name)
                             mapped_dev = self.getDeviceByName(map_name)
                             if mapped_dev:
                                 device = mapped_dev
@@ -2616,9 +2614,9 @@ class DeviceTree(object):
                         break
 
         if device:
-            log.debug("resolved '%s' to '%s' (%s)" % (devspec, device.name, device.type))
+            log.debug("resolved '%s' to '%s' (%s)", devspec, device.name, device.type)
         else:
-            log.debug("failed to resolve '%s'" % devspec)
+            log.debug("failed to resolve '%s'", devspec)
         return device
 
     def getActiveMounts(self):
@@ -2629,7 +2627,7 @@ class DeviceTree(object):
                 (devspec, mountpoint, fstype, options, rest) = line.split(None,
                                                                           4)
             except IndexError:
-                log.error("failed to parse /proc/mounts line: %s" % line)
+                log.error("failed to parse /proc/mounts line: %s", line)
                 continue
 
             if fstype == "btrfs":
@@ -2640,15 +2638,15 @@ class DeviceTree(object):
                     _mountpoint = fields[4]
                     _devspec = fields[9]
                     if _mountpoint == mountpoint and _devspec == devspec:
-                        log.debug("subvol %s" % _subvol)
+                        log.debug("subvol %s", _subvol)
                         options += ",subvol=%s" % _subvol[1:]
 
             if fstype in nodev_filesystems:
                 if not flags.include_nodev:
                     continue
 
-                log.info("found nodev %s filesystem mounted at %s"
-                            % (fstype, mountpoint))
+                log.info("found nodev %s filesystem mounted at %s",
+                            fstype, mountpoint)
                 # nodev filesystems require some special handling.
                 # For now, a lot of this is based on the idea that it's a losing
                 # battle to require the presence of an FS class for every type
diff --git a/blivet/fcoe.py b/blivet/fcoe.py
index 4187db8..854bd69 100644
--- a/blivet/fcoe.py
+++ b/blivet/fcoe.py
@@ -74,15 +74,15 @@ class fcoe(object):
             rc = e.strerror
 
         if not rc.startswith("NIC="):
-            log.info("No FCoE EDD info found: %s" % rc.rstrip())
+            log.info("No FCoE EDD info found: %s", rc.rstrip())
             return
 
         (key, val) = rc.strip().split("=", 1)
         #if val not in isys.getDeviceProperties():
-        #    log.error("Unknown FCoE NIC found in EDD: %s, ignoring" % val)
+        #    log.error("Unknown FCoE NIC found in EDD: %s, ignoring", val)
         #    return
 
-        log.info("FCoE NIC found in EDD: %s" % val)
+        log.info("FCoE NIC found in EDD: %s", val)
         self.addSan(val, dcb=True, auto_vlan=True)
 
     def startup(self):
@@ -110,8 +110,8 @@ class fcoe(object):
         if not has_fcoe():
             raise IOError, _("FCoE not available")
 
-        log.info("Activating FCoE SAN attached to %s, dcb: %s autovlan: %s" %
-                 (nic, dcb, auto_vlan))
+        log.info("Activating FCoE SAN attached to %s, dcb: %s autovlan: %s",
+                 nic, dcb, auto_vlan)
 
         util.run_program(["ip", "link", "set", nic, "up"])
 
@@ -139,7 +139,7 @@ class fcoe(object):
             self._stabilize()
             self.nics.append((nic, dcb, auto_vlan))
         else:
-            log.debug("Activating FCoE SAN failed: %s %s" % (rc, out))
+            log.debug("Activating FCoE SAN failed: %s %s", rc, out)
             error_msg = out
 
         return error_msg
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index cb8962d..38b273b 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -45,8 +45,8 @@ def register_device_format(fmt_class):
         raise ValueError("arg1 must be a subclass of DeviceFormat")
 
     device_formats[fmt_class._type] = fmt_class
-    log.debug("registered device format class %s as %s" % (fmt_class.__name__,
-                                                           fmt_class._type))
+    log.debug("registered device format class %s as %s", fmt_class.__name__,
+                                                         fmt_class._type)
 
 default_fstypes = ("ext4", "ext3", "ext2")
 def get_default_filesystem_type():
@@ -88,8 +88,8 @@ def getFormat(fmt_type, *args, **kwargs):
         # this should add/set an instance attribute
         fmt._name = fmt_type
 
-    log.debug("getFormat('%s') returning %s instance with object id %d" %
-       (fmt_type, fmt.__class__.__name__, fmt.id))
+    log.debug("getFormat('%s') returning %s instance with object id %d",
+       fmt_type, fmt.__class__.__name__, fmt.id)
     return fmt
 
 def collect_device_format_classes():
@@ -109,9 +109,9 @@ def collect_device_format_classes():
             try:
                 globals()[mod_name] = __import__(mod_name, globals(), locals(), [], -1)
             except ImportError:
-                log.error("import of device format module '%s' failed" % mod_name)
+                log.error("import of device format module '%s' failed", mod_name)
                 from traceback import format_exc
-                log.debug(format_exc())
+                log.debug("%s", format_exc())
 
 def get_device_format_class(fmt_type):
     """ Return an appropriate format class.
@@ -331,13 +331,13 @@ class DeviceFormat(ObjectID):
             try:
                 name = dm_node_from_name(os.path.basename(self.device))
             except DMError:
-                log.warning("failed to get dm node for %s" % self.device)
+                log.warning("failed to get dm node for %s", self.device)
                 return
         elif self.device.startswith("/dev/md/"):
             try:
                 name = md_node_from_name(os.path.basename(self.device))
             except MDRaidError:
-                log.warning("failed to get md node for %s" % self.device)
+                log.warning("failed to get md node for %s", self.device)
                 return
         else:
             name = self.device
@@ -346,7 +346,7 @@ class DeviceFormat(ObjectID):
         try:
             notify_kernel(path, action="change")
         except (ValueError, IOError) as e:
-            log.warning("failed to notify kernel of change: %s" % e)
+            log.warning("failed to notify kernel of change: %s", e)
 
     def cacheMajorminor(self):
         """ Cache the value of self.majorminor.
diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
index 8071abb..1653219 100644
--- a/blivet/formats/disklabel.py
+++ b/blivet/formats/disklabel.py
@@ -174,12 +174,12 @@ class DiskLabel(DeviceFormat):
                 # MAC can boot as EFI or as BIOS, neither should have PMBR boot set
                 if arch.isEfi() or arch.isMactel():
                     self._partedDisk.unsetFlag(parted.DISK_GPT_PMBR_BOOT)
-                    log.debug("Clear pmbr_boot on %s" % (self._partedDisk,))
+                    log.debug("Clear pmbr_boot on %s", self._partedDisk)
                 else:
                     self._partedDisk.setFlag(parted.DISK_GPT_PMBR_BOOT)
-                    log.debug("Set pmbr_boot on %s" % (self._partedDisk,))
+                    log.debug("Set pmbr_boot on %s", self._partedDisk)
             else:
-                log.debug("Did not change pmbr_boot on %s" % (self._partedDisk,))
+                log.debug("Did not change pmbr_boot on %s", self._partedDisk)
 
         return self._partedDisk
 
@@ -194,9 +194,9 @@ class DiskLabel(DeviceFormat):
                 try:
                     self._partedDevice = parted.Device(path=self.device)
                 except (_ped.IOException, _ped.DeviceException) as e:
-                    log.error("DiskLabel.partedDevice: Parted exception: %s" % e)
+                    log.error("DiskLabel.partedDevice: Parted exception: %s", e)
             else:
-                log.info("DiskLabel.partedDevice: %s does not exist" % self.device)
+                log.info("DiskLabel.partedDevice: %s does not exist", self.device)
 
         if not self._partedDevice:
             log.info("DiskLabel.partedDevice returning None")
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 7b0807b..18bd5fe 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -232,7 +232,7 @@ class FS(DeviceFormat):
             try:
                 buf = util.capture_output([self.infofsProg] + argv)
             except OSError as e:
-                log.error("failed to gather fs info: %s" % e)
+                log.error("failed to gather fs info: %s", e)
 
         return buf
 
@@ -315,8 +315,8 @@ class FS(DeviceFormat):
 
                 size = Size(bytes=size)
             except Exception as e:
-                log.error("failed to obtain size of filesystem on %s: %s"
-                          % (self.device, e))
+                log.error("failed to obtain size of filesystem on %s: %s",
+                          self.device, e)
 
         return size
 
@@ -439,8 +439,8 @@ class FS(DeviceFormat):
         self._minInstanceSize = None
         if self.targetSize < self.minSize:
             self.targetSize = self.minSize
-            log.info("Minimum size changed, setting targetSize on %s to %s" \
-                     % (self.device, self.targetSize))
+            log.info("Minimum size changed, setting targetSize on %s to %s",
+                     self.device, self.targetSize)
         try:
             ret = util.run_program([self.resizefsProg] + self.resizeArgs)
         except OSError as e:
@@ -504,12 +504,12 @@ class FS(DeviceFormat):
             try:
                 rc = util.run_program(["modprobe", module])
             except OSError as e:
-                log.error("Could not load kernel module %s: %s" % (module, e))
+                log.error("Could not load kernel module %s: %s", module, e)
                 self._supported = False
                 return
 
             if rc:
-                log.error("Could not load kernel module %s" % module)
+                log.error("Could not load kernel module %s", module)
                 self._supported = False
                 return
 
@@ -532,7 +532,7 @@ class FS(DeviceFormat):
         try:
             self.mount(mountpoint=mountpoint)
         except Exception as e:
-            log.info("test mount failed: %s" % e)
+            log.info("test mount failed: %s", e)
         else:
             self.unmount()
             ret = True
@@ -980,15 +980,15 @@ class Ext2FS(FS):
 
             if size is None:
                 log.warning("failed to get minimum size for %s filesystem "
-                            "on %s" % (self.mountType, self.device))
+                            "on %s", self.mountType, self.device)
             else:
                 orig_size = size
-                log.debug("size=%s, current=%s" % (size, self.currentSize))
+                log.debug("size=%s, current=%s", size, self.currentSize)
                 size = min(size * Decimal('1.1'), size + 500, self.currentSize)
                 if orig_size < size:
-                    log.debug("padding min size from %d up to %d" % (orig_size, size))
+                    log.debug("padding min size from %d up to %d", orig_size, size)
                 else:
-                    log.debug("using current size %d as min size" % size)
+                    log.debug("using current size %d as min size", size)
 
         self._minInstanceSize = size
 
@@ -1273,12 +1273,12 @@ class XFS(FS):
         try:
             util.run_program(["xfs_freeze", "-f", self.mountpoint], root=root)
         except OSError as e:
-            log.error("failed to run xfs_freeze: %s" % e)
+            log.error("failed to run xfs_freeze: %s", e)
 
         try:
             util.run_program(["xfs_freeze", "-u", self.mountpoint], root=root)
         except OSError as e:
-            log.error("failed to run xfs_freeze: %s" % e)
+            log.error("failed to run xfs_freeze: %s", e)
 
 register_device_format(XFS)
 
@@ -1383,17 +1383,17 @@ class NTFS(FS):
                     minSize = Size(spec="%d mb" % int(l.split(":")[1].strip()))
                 except (IndexError, ValueError) as e:
                     minSize = None
-                    log.warning("Unable to parse output for minimum size on %s: %s" %(self.device, e))
+                    log.warning("Unable to parse output for minimum size on %s: %s", self.device, e)
 
             if minSize is None:
                 log.warning("Unable to discover minimum size of filesystem "
-                            "on %s" %(self.device,))
+                            "on %s", self.device)
             else:
                 size = min(minSize * Decimal('1.1'), minSize + 500, self.currentSize)
                 if minSize < size:
-                    log.debug("padding min size from %d up to %d" % (minSize, size))
+                    log.debug("padding min size from %d up to %d", minSize, size)
                 else:
-                    log.debug("using current size %d as min size" % size)
+                    log.debug("using current size %d as min size", size)
 
         self._minInstanceSize = size
 
diff --git a/blivet/formats/luks.py b/blivet/formats/luks.py
index 8c99718..dea56b7 100644
--- a/blivet/formats/luks.py
+++ b/blivet/formats/luks.py
@@ -200,7 +200,7 @@ class LUKS(DeviceFormat):
             raise LUKSError("format has not been created")
 
         if self.status:
-            log.debug("unmapping %s" % self.mapName)
+            log.debug("unmapping %s", self.mapName)
             crypto.luks_close(self.mapName)
 
     def create(self, *args, **kwargs):
@@ -318,7 +318,7 @@ class LUKS(DeviceFormat):
         return volume_ident
 
     def escrow(self, directory, backupPassphrase):
-        log.debug("escrow: escrowVolume start for %s" % self.device)
+        log.debug("escrow: escrowVolume start for %s", self.device)
         if volume_key is None:
             raise LUKSError("Missing key escrow support libraries")
 
@@ -357,7 +357,7 @@ class LUKS(DeviceFormat):
                 f.write(backup_passphrase_packet)
             log.debug("escrow: backup packet written")
 
-        log.debug("escrow: escrowVolume done for %s" % repr(self.device))
+        log.debug("escrow: escrowVolume done for %s", repr(self.device))
 
 
 register_device_format(LUKS)
diff --git a/blivet/formats/prepboot.py b/blivet/formats/prepboot.py
index 3c73704..e22b420 100644
--- a/blivet/formats/prepboot.py
+++ b/blivet/formats/prepboot.py
@@ -90,7 +90,7 @@ class PPCPRePBoot(DeviceFormat):
                      length = 0
             os.close(fd)
         except OSError as e:
-            log.error("error zeroing out %s: %s" % (self.device, e))
+            log.error("error zeroing out %s: %s", self.device, e)
             if fd:
                 os.close(fd)
 
diff --git a/blivet/formats/swap.py b/blivet/formats/swap.py
index 8ffe415..7370715 100644
--- a/blivet/formats/swap.py
+++ b/blivet/formats/swap.py
@@ -129,7 +129,7 @@ class SwapSpace(DeviceFormat):
                 try:
                     self.priority = int(arg)
                 except ValueError:
-                    log.info("invalid value for swap priority: %s" % arg)
+                    log.info("invalid value for swap priority: %s", arg)
 
     options = property(_getOptions, _setOptions,
                        doc="The swap device's fstab options string")
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index f30a861..418c801 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -52,7 +52,7 @@ def has_iscsi():
         if not location:
             return False
         ISCSID = location
-        log.info("ISCSID is %s" % (ISCSID,))
+        log.info("ISCSID is %s", ISCSID)
 
     return True
 
@@ -156,12 +156,12 @@ class iscsi(object):
         for node in found_nodes:
             try:
                 node.login()
-                log.info("iscsi IBFT: logged into %s at %s:%s through %s" % (
-                    node.name, node.address, node.port, node.iface))
+                log.info("iscsi IBFT: logged into %s at %s:%s through %s",
+                    node.name, node.address, node.port, node.iface)
                 self.ibftNodes.append(node)
             except IOError as e:
-                log.error("Could not log into ibft iscsi target %s: %s" %
-                          (node.name, str(e)))
+                log.error("Could not log into ibft iscsi target %s: %s",
+                          node.name, str(e))
                 pass
 
         self.stabilize()
@@ -186,7 +186,7 @@ class iscsi(object):
                               "-n", "iface.net_ifacename", "-v", iface])
 
             self.ifaces[iscsi_iface_name] = iface
-            log.debug("created_interface %s:%s" % (iscsi_iface_name, iface))
+            log.debug("created_interface %s:%s", iscsi_iface_name, iface)
 
     def delete_interfaces(self):
         if not self.ifaces:
@@ -208,7 +208,7 @@ class iscsi(object):
             log.info("no initiator set")
             return
 
-        log.debug("Setting up %s" % (INITIATOR_FILE, ))
+        log.debug("Setting up %s", INITIATOR_FILE)
         log.info("iSCSI initiator name %s", self.initiator)
         if os.path.exists(INITIATOR_FILE):
             os.unlink(INITIATOR_FILE)
@@ -234,7 +234,7 @@ class iscsi(object):
         except RuntimeError:
             log.info("iscsi: iscsiuio not found.")
         else:
-            log.debug("iscsi: iscsiuio is at %s" % iscsiuio)
+            log.debug("iscsi: iscsiuio is at %s", iscsiuio)
             util.run_program([iscsiuio])
         # run the daemon
         util.run_program([ISCSID])
@@ -265,8 +265,8 @@ class iscsi(object):
             raise ValueError, _("No initiator name set")
 
         if self.active_nodes((ipaddr, port)):
-            log.debug("iSCSI: skipping discovery of %s:%s due to active nodes" %
-                      (ipaddr, port))
+            log.debug("iSCSI: skipping discovery of %s:%s due to active nodes",
+                      ipaddr, port)
         else:
             if username or password or r_username or r_password:
                 # Note may raise a ValueError
@@ -285,7 +285,7 @@ class iscsi(object):
             self.discovered_targets[(ipaddr, port)] = []
             for node in found_nodes:
                 self.discovered_targets[(ipaddr, port)].append([node, False])
-                log.debug("discovered iSCSI node: %s" % node.name)
+                log.debug("discovered iSCSI node: %s", node.name)
 
         # only return the nodes we are not logged into yet
         return [node for (node, logged_in) in
@@ -311,13 +311,13 @@ class iscsi(object):
             node.setAuth(authinfo)
             node.login()
             rc = True
-            log.info("iSCSI: logged into %s at %s:%s through %s" % (
-                    node.name, node.address, node.port, node.iface))
+            log.info("iSCSI: logged into %s at %s:%s through %s",
+                    node.name, node.address, node.port, node.iface)
             if not self._mark_node_active(node):
                 log.error("iSCSI: node not found among discovered")
         except (IOError, ValueError) as e:
             msg = str(e)
-            log.warning("iSCSI: could not log into %s: %s" % (node.name, msg))
+            log.warning("iSCSI: could not log into %s: %s", node.name, msg)
 
         return (rc, msg)
 
@@ -334,14 +334,13 @@ class iscsi(object):
 
         for node in found_nodes:
             if target and target != node.name:
-                log.debug("iscsi: skipping logging to iscsi node '%s'" %
-                          node.name)
+                log.debug("iscsi: skipping logging to iscsi node '%s'", node.name)
                 continue
             if iface:
                 node_net_iface = self.ifaces.get(node.iface, node.iface)
                 if iface != node_net_iface:
-                    log.debug("iscsi: skipping logging to iscsi node '%s' via %s" %
-                               (node.name, node_net_iface))
+                    log.debug("iscsi: skipping logging to iscsi node '%s' via %s",
+                               node.name, node_net_iface)
                     continue
 
             found = found + 1
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 55e3861..0b5f368 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -132,7 +132,7 @@ def _schedulePartitions(storage, disks):
     if not all_free:
         # this should never happen since we've already filtered the disks
         # to those with at least 500MiB free
-        log.error("no free space on disks %s" % ([d.name for d in disks],))
+        log.error("no free space on disks %s", [d.name for d in disks])
         return
 
     free = Size(bytes=all_free[0].getLength(unit="B"))
@@ -167,14 +167,14 @@ def _schedulePartitions(storage, disks):
              (storage.bootloader.skip_bootloader or stage1_device):
             # there should never be a need for more than one of these
             # partitions, so skip them.
-            log.info("skipping unneeded stage1 %s request" % request.fstype)
-            log.debug(request)
+            log.info("skipping unneeded stage1 %s request", request.fstype)
+            log.debug("%s", request)
 
             if request.fstype in ["efi", "macefi"] and stage1_device:
                 # Set the mountpoint for the existing EFI boot partition
                 stage1_device.format.mountpoint = "/boot/efi"
 
-            log.debug(stage1_device)
+            log.debug("%s", stage1_device)
             continue
         elif request.fstype == "biosboot":
             is_gpt = (stage1_device and
@@ -188,9 +188,9 @@ def _schedulePartitions(storage, disks):
                     is_gpt and not has_bios_boot)):
                 # there should never be a need for more than one of these
                 # partitions, so skip them.
-                log.info("skipping unneeded stage1 %s request" % request.fstype)
-                log.debug(request)
-                log.debug(stage1_device)
+                log.info("skipping unneeded stage1 %s request", request.fstype)
+                log.debug("%s", request)
+                log.debug("%s", stage1_device)
                 continue
 
         if request.encrypted and storage.encryptedAutoPart:
@@ -349,16 +349,16 @@ def doAutoPartition(storage, data):
             Clearing of partitions is handled separately, in
             :meth:`~.Blivet.clearPartitions`.
     """
-    log.debug("doAutoPart: %s" % storage.doAutoPart)
-    log.debug("encryptedAutoPart: %s" % storage.encryptedAutoPart)
-    log.debug("autoPartType: %s" % storage.autoPartType)
-    log.debug("clearPartType: %s" % storage.config.clearPartType)
-    log.debug("clearPartDisks: %s" % storage.config.clearPartDisks)
-    log.debug("autoPartitionRequests:\n%s" % "".join([str(p) for p in storage.autoPartitionRequests]))
-    log.debug("storage.disks: %s" % [d.name for d in storage.disks])
-    log.debug("storage.partitioned: %s" % [d.name for d in storage.partitioned])
-    log.debug("all names: %s" % [d.name for d in storage.devices])
-    log.debug("boot disk: %s" % getattr(storage.bootDisk, "name", None))
+    log.debug("doAutoPart: %s", storage.doAutoPart)
+    log.debug("encryptedAutoPart: %s", storage.encryptedAutoPart)
+    log.debug("autoPartType: %s", storage.autoPartType)
+    log.debug("clearPartType: %s", storage.config.clearPartType)
+    log.debug("clearPartDisks: %s", storage.config.clearPartDisks)
+    log.debug("autoPartitionRequests:\n%s", "".join([str(p) for p in storage.autoPartitionRequests]))
+    log.debug("storage.disks: %s", [d.name for d in storage.disks])
+    log.debug("storage.partitioned: %s", [d.name for d in storage.partitioned])
+    log.debug("all names: %s", [d.name for d in storage.devices])
+    log.debug("boot disk: %s", getattr(storage.bootDisk, "name", None))
 
     disks = []
     devs = []
@@ -371,8 +371,8 @@ def doAutoPartition(storage, data):
 
     disks = _getCandidateDisks(storage)
     devs = _scheduleImplicitPartitions(storage, disks)
-    log.debug("candidate disks: %s" % disks)
-    log.debug("devs: %s" % devs)
+    log.debug("candidate disks: %s", disks)
+    log.debug("devs: %s", devs)
 
     if disks == []:
         raise NotEnoughFreeSpaceError(_("Not enough free space on disks for "
@@ -407,9 +407,9 @@ def sanityCheck(storage):
     errors = [exc for exc in exns if isinstance(exc, SanityError)]
     warnings = [exc for exc in exns if isinstance(exc, SanityWarning)]
     for error in errors:
-        log.error(error.message)
+        log.error("%s", error.message)
     for warning in warnings:
-        log.warning(warning.message)
+        log.warning("%s", warning.message)
 
     if errors:
         raise PartitioningError("\n".join(error.message for error in errors))
@@ -572,14 +572,14 @@ def getBestFreeSpaceRegion(disk, part_type, req_size, start=None,
 
     """
     log.debug("getBestFreeSpaceRegion: disk=%s part_type=%d req_size=%s "
-              "boot=%s best=%s grow=%s start=%s" %
-              (disk.device.path, part_type, req_size, boot, best_free, grow,
-               start))
+              "boot=%s best=%s grow=%s start=%s",
+              disk.device.path, part_type, req_size, boot, best_free, grow,
+              start)
     extended = disk.getExtendedPartition()
 
     for free_geom in disk.getFreeSpaceRegions():
-        log.debug("checking %d-%d (%s)" % (free_geom.start, free_geom.end,
-                                           Size(bytes=free_geom.getLength(unit="B"))))
+        log.debug("checking %d-%d (%s)", free_geom.start, free_geom.end,
+                                         Size(bytes=free_geom.getLength(unit="B")))
         if start is not None and not free_geom.containsSector(start):
             log.debug("free region does not contain requested start sector")
             continue
@@ -604,9 +604,9 @@ def getBestFreeSpaceRegion(disk, part_type, req_size, start=None,
                             max_boot)
                 continue
 
-        log.debug("current free range is %d-%d (%s)" % (free_geom.start,
-                                                        free_geom.end,
-                                                        Size(bytes=free_geom.getLength(unit="B"))))
+        log.debug("current free range is %d-%d (%s)", free_geom.start,
+                                                      free_geom.end,
+                                                      Size(bytes=free_geom.getLength(unit="B")))
         free_size = Size(bytes=free_geom.getLength(unit="B"))
 
         # For boot partitions, we want the first suitable region we find.
@@ -666,10 +666,10 @@ def removeNewPartitions(disks, partitions):
         :returns: None
         :rtype: NoneType
     """
-    log.debug("removing all non-preexisting partitions %s from disk(s) %s"
-                % (["%s(id %d)" % (p.name, p.id) for p in partitions
+    log.debug("removing all non-preexisting partitions %s from disk(s) %s",
+                ["%s(id %d)" % (p.name, p.id) for p in partitions
                                                     if not p.exists],
-                   [d.name for d in disks]))
+                [d.name for d in disks])
     for part in partitions:
         if part.partedPartition and part.disk in disks:
             if part.exists:
@@ -691,7 +691,7 @@ def removeNewPartitions(disks, partitions):
         # remove empty extended so it doesn't interfere
         extended = disk.format.extendedPartition
         if extended and not disk.format.logicalPartitions:
-            log.debug("removing empty extended partition from %s" % disk.name)
+            log.debug("removing empty extended partition from %s", disk.name)
             disk.format.partedDisk.removePartition(extended)
 
 def addPartition(disklabel, free, part_type, size, start=None, end=None):
@@ -737,7 +737,7 @@ def addPartition(disklabel, free, part_type, size, start=None, end=None):
             start += disklabel.alignment.grainSize
 
         if start != free.start:
-            log.debug("adjusted start sector from %d to %d" % (free.start, start))
+            log.debug("adjusted start sector from %d to %d", free.start, start)
 
         if part_type == parted.PARTITION_EXTENDED:
             end = free.end
@@ -748,7 +748,7 @@ def addPartition(disklabel, free, part_type, size, start=None, end=None):
 
         if not disklabel.endAlignment.isAligned(free, end):
             end = disklabel.endAlignment.alignNearest(free, end)
-            log.debug("adjusted length from %d to %d" % (length, end - start + 1))
+            log.debug("adjusted length from %d to %d", length, end - start + 1)
             if start > end:
                 raise PartitioningError(_("unable to allocate aligned partition"))
 
@@ -858,7 +858,7 @@ def doPartitioning(storage):
         try:
             disk.setup()
         except DeviceError as (msg, name):
-            log.error("failed to set up disk %s: %s" % (name, msg))
+            log.error("failed to set up disk %s: %s", name, msg)
             raise PartitioningError(_("disk %s inaccessible") % disk.name)
 
     partitions = storage.partitions[:]
@@ -891,7 +891,7 @@ def doPartitioning(storage):
     else:
         # Mark all growable requests as no longer growable.
         for partition in storage.partitions:
-            log.debug("fixing size of %s" % partition)
+            log.debug("fixing size of %s", partition)
             partition.req_grow = False
             partition.req_base_size = partition.size
             partition.req_size = partition.size
@@ -947,9 +947,9 @@ def allocatePartitions(storage, disks, partitions, freespace):
         The :class:`~.devices.PartitionDevice` instances will have their name
         and parents attributes set once they have been allocated.
     """
-    log.debug("allocatePartitions: disks=%s ; partitions=%s" %
-                ([d.name for d in disks],
-                 ["%s(id %d)" % (p.name, p.id) for p in partitions]))
+    log.debug("allocatePartitions: disks=%s ; partitions=%s",
+                [d.name for d in disks],
+                ["%s(id %d)" % (p.name, p.id) for p in partitions])
 
     new_partitions = [p for p in partitions if not p.exists]
     new_partitions.sort(cmp=partitionCompare)
@@ -989,12 +989,12 @@ def allocatePartitions(storage, disks, partitions, freespace):
 
         log.debug("allocating partition: %s ; id: %d ; disks: %s ;\n"
                   "boot: %s ; primary: %s ; size: %s ; grow: %s ; "
-                  "max_size: %s ; start: %s ; end: %s" % (_part.name, _part.id,
+                  "max_size: %s ; start: %s ; end: %s", _part.name, _part.id,
                                     [d.name for d in req_disks],
                                     boot, _part.req_primary,
                                     _part.req_size, _part.req_grow,
                                     _part.req_max_size, _part.req_start_sector,
-                                    _part.req_end_sector))
+                                    _part.req_end_sector)
         free = None
         use_disk = None
         part_type = None
@@ -1013,12 +1013,12 @@ def allocatePartitions(storage, disks, partitions, freespace):
             if _part.req_grow:
                 current_free = None
 
-            log.debug("checking freespace on %s" % _disk.name)
+            log.debug("checking freespace on %s", _disk.name)
 
             new_part_type = getNextPartitionType(disklabel.partedDisk)
             if new_part_type is None:
                 # can't allocate any more partitions on this disk
-                log.debug("no free partition slots on %s" % _disk.name)
+                log.debug("no free partition slots on %s", _disk.name)
                 continue
 
             if _part.req_primary and new_part_type != parted.PARTITION_NORMAL:
@@ -1029,7 +1029,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
                     new_part_type = parted.PARTITION_NORMAL
                 else:
                     # we need a primary slot and none are free on this disk
-                    log.debug("no primary slots available on %s" % _disk.name)
+                    log.debug("no primary slots available on %s", _disk.name)
                     continue
             elif _part.req_partType is not None and \
                  new_part_type != _part.req_partType:
@@ -1065,7 +1065,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
                     log.debug("evaluating growth potential for new layout")
                     new_growth = 0
                     for disk_path in disklabels.keys():
-                        log.debug("calculating growth for disk %s" % disk_path)
+                        log.debug("calculating growth for disk %s", disk_path)
                         # Now we check, for growable requests, which of the two
                         # free regions will allow for more growth.
 
@@ -1124,18 +1124,18 @@ def allocatePartitions(storage, disks, partitions, freespace):
                             disk_growth += chunk.growth
                             for req in chunk.requests:
                                 log.debug("request %d (%s) growth: %d (%s) "
-                                          "size: %s" %
-                                          (req.device.id,
-                                           req.device.name,
-                                           req.growth,
-                                           sectorsToSize(req.growth,
-                                                         disk_sector_size),
-                                           sectorsToSize(req.growth + req.base,
-                                                         disk_sector_size)))
-                        log.debug("disk %s growth: %d (%s)" %
-                                        (disk_path, disk_growth,
-                                         sectorsToSize(disk_growth,
-                                                       disk_sector_size)))
+                                          "size: %s",
+                                          req.device.id,
+                                          req.device.name,
+                                          req.growth,
+                                          sectorsToSize(req.growth,
+                                                        disk_sector_size),
+                                          sectorsToSize(req.growth + req.base,
+                                                        disk_sector_size))
+                        log.debug("disk %s growth: %d (%s)",
+                                        disk_path, disk_growth,
+                                        sectorsToSize(disk_growth,
+                                                      disk_sector_size))
 
                     disklabel.partedDisk.removePartition(temp_part)
                     _part.partedPartition = None
@@ -1145,13 +1145,13 @@ def allocatePartitions(storage, disks, partitions, freespace):
                         e = disklabel.extendedPartition
                         disklabel.partedDisk.removePartition(e)
 
-                    log.debug("total growth: %d sectors" % new_growth)
+                    log.debug("total growth: %d sectors", new_growth)
 
                     # update the chosen free region unless the previous
                     # choice yielded greater total growth
                     if free is not None and new_growth <= growth:
-                        log.debug("keeping old free: %d <= %d" % (new_growth,
-                                                                  growth))
+                        log.debug("keeping old free: %d <= %d", new_growth,
+                                                                growth)
                         update = False
                     else:
                         growth = new_growth
@@ -1159,15 +1159,14 @@ def allocatePartitions(storage, disks, partitions, freespace):
                 if update:
                     # now we know we are choosing a new free space,
                     # so update the disk and part type
-                    log.debug("updating use_disk to %s, type: %s"
-                                % (_disk.name, new_part_type))
+                    log.debug("updating use_disk to %s, type: %s",
+                                _disk.name, new_part_type)
                     part_type = new_part_type
                     use_disk = _disk
-                    log.debug("new free: %d-%d / %s" % (best.start,
-                                                        best.end,
-                                                        Size(bytes=best.getLength(unit="B"))))
-                    log.debug("new free allows for %d sectors of growth" %
-                                growth)
+                    log.debug("new free: %d-%d / %s", best.start,
+                                                      best.end,
+                                                      Size(bytes=best.getLength(unit="B")))
+                    log.debug("new free allows for %d sectors of growth", growth)
                     free = best
 
             if free and boot:
@@ -1206,10 +1205,10 @@ def allocatePartitions(storage, disks, partitions, freespace):
 
         partition = addPartition(disklabel, free, part_type, _part.req_size,
                                  _part.req_start_sector, _part.req_end_sector)
-        log.debug("created partition %s of %s and added it to %s" %
-                (partition.getDeviceNodeName(),
-                 Size(bytes=partition.getLength(unit="B")),
-                 disklabel.device))
+        log.debug("created partition %s of %s and added it to %s",
+                partition.getDeviceNodeName(),
+                Size(bytes=partition.getLength(unit="B")),
+                disklabel.device)
 
         # this one sets the name
         _part.partedPartition = partition
@@ -1352,7 +1351,7 @@ class Chunk(object):
             :param req: the request to add
             :type req: :class:`Request`
         """
-        log.debug("adding request %d to chunk %s" % (req.device.id, self))
+        log.debug("adding request %d to chunk %s", req.device.id, self)
 
         self.requests.append(req)
         self.pool -= req.base
@@ -1370,10 +1369,10 @@ class Chunk(object):
             :raises: ValueError
             :returns: None
         """
-        log.debug("reclaim: %s %d (%s)" % (request, amount, self.lengthToSize(amount)))
+        log.debug("reclaim: %s %d (%s)", request, amount, self.lengthToSize(amount))
         if request.growth < amount:
-            log.error("tried to reclaim %d from request with %d of growth"
-                        % (amount, request.growth))
+            log.error("tried to reclaim %d from request with %d of growth",
+                        amount, request.growth)
             raise ValueError(_("cannot reclaim more than request has grown"))
 
         request.growth -= amount
@@ -1431,9 +1430,9 @@ class Chunk(object):
             if req.growth > max_growth:
                 # we've grown beyond the maximum. put some back.
                 extra = req.growth - max_growth
-                log.debug("taking back %d (%s) from %d (%s)" %
-                            (extra, self.lengthToSize(extra),
-                             req.device.id, req.device.name))
+                log.debug("taking back %d (%s) from %d (%s)",
+                            extra, self.lengthToSize(extra),
+                            req.device.id, req.device.name)
                 self.pool += extra
                 req.growth = max_growth
 
@@ -1463,11 +1462,11 @@ class Chunk(object):
             Under uniform growth, all requests receive an equal portion of the
             free units.
         """
-        log.debug("Chunk.growRequests: %r" % self)
+        log.debug("Chunk.growRequests: %r", self)
 
         self.sortRequests()
         for req in self.requests:
-            log.debug("req: %r" % req)
+            log.debug("req: %r", req)
 
         # we use this to hold the base for the next loop through the
         # chunk's requests since we want the base to be the same for
@@ -1480,8 +1479,8 @@ class Chunk(object):
             if uniform:
                 growth = int(last_pool / self.remaining)
 
-            log.debug("%d requests and %s (%s) left in chunk" %
-                        (self.remaining, self.pool, self.lengthToSize(self.pool)))
+            log.debug("%d requests and %s (%s) left in chunk",
+                        self.remaining, self.pool, self.lengthToSize(self.pool))
             for p in self.requests:
                 if p.done or p in self.skip_list:
                     continue
@@ -1495,15 +1494,15 @@ class Chunk(object):
 
                 p.growth += growth
                 self.pool -= growth
-                log.debug("adding %s (%s) to %d (%s)" %
-                            (growth, self.lengthToSize(growth),
-                             p.device.id, p.device.name))
+                log.debug("adding %s (%s) to %d (%s)",
+                            growth, self.lengthToSize(growth),
+                            p.device.id, p.device.name)
 
                 new_base = self.trimOverGrownRequest(p, base=new_base)
                 log.debug("new grow amount for request %d (%s) is %s "
-                          "units, or %s" %
-                            (p.device.id, p.device.name, p.growth,
-                             self.lengthToSize(p.growth)))
+                          "units, or %s",
+                            p.device.id, p.device.name, p.growth,
+                            self.lengthToSize(p.growth))
 
         if self.pool:
             # allocate any leftovers in pool to the first partition
@@ -1515,15 +1514,15 @@ class Chunk(object):
                 growth = self.pool
                 p.growth += growth
                 self.pool = 0
-                log.debug("adding %s (%s) to %d (%s)" %
-                            (growth, self.lengthToSize(growth),
-                             p.device.id, p.device.name))
+                log.debug("adding %s (%s) to %d (%s)",
+                            growth, self.lengthToSize(growth),
+                            p.device.id, p.device.name)
 
                 self.trimOverGrownRequest(p)
                 log.debug("new grow amount for request %d (%s) is %s "
-                          "units, or %s" %
-                            (p.device.id, p.device.name, p.growth,
-                             self.lengthToSize(p.growth)))
+                          "units, or %s",
+                            p.device.id, p.device.name, p.growth,
+                            self.lengthToSize(p.growth))
 
                 if self.pool == 0:
                     break
@@ -1590,8 +1589,7 @@ class DiskChunk(Chunk):
 
             new_pool = chunk_end - self.geometry.start + 1
             if new_pool != self.pool:
-                log.debug("adjusting pool to %d based on disklabel limits"
-                            % new_pool)
+                log.debug("adjusting pool to %d based on disklabel limits", new_pool)
                 self.pool = new_pool
 
         super(DiskChunk, self).addRequest(req)
@@ -1709,15 +1707,15 @@ class VGChunk(Chunk):
             growth = int(req.device.req_percent * 0.01 * self.length)# truncate
             req.growth += growth
             self.pool -= growth
-            log.debug("adding %d (%s) to %d (%s)" %
-                        (growth, self.lengthToSize(growth),
-                         req.device.id, req.device.name))
+            log.debug("adding %d (%s) to %d (%s)",
+                        growth, self.lengthToSize(growth),
+                        req.device.id, req.device.name)
 
             new_base = self.trimOverGrownRequest(req)
             log.debug("new grow amount for request %d (%s) is %d "
-                      "units, or %s" %
-                        (req.device.id, req.device.name, req.growth,
-                         self.lengthToSize(req.growth)))
+                      "units, or %s",
+                        req.device.id, req.device.name, req.growth,
+                        self.lengthToSize(req.growth))
 
             # we're done with this request, so remove its base from the
             # chunk's base
@@ -1804,11 +1802,11 @@ class TotalSizeSet(object):
         self.requests = []
 
         self.allocated = sum([d.req_base_size for d in self.devices])
-        log.debug("set.allocated = %d" % self.allocated)
+        log.debug("set.allocated = %d", self.allocated)
 
     def allocate(self, amount):
-        log.debug("allocating %d to TotalSizeSet with %d/%d (%d needed)"
-                    % (amount, self.allocated, self.size, self.needed))
+        log.debug("allocating %d to TotalSizeSet with %d/%d (%d needed)",
+                    amount, self.allocated, self.size, self.needed)
         self.allocated += amount
 
     @property
@@ -1816,8 +1814,8 @@ class TotalSizeSet(object):
         return self.size - self.allocated
 
     def deallocate(self, amount):
-        log.debug("deallocating %d from TotalSizeSet with %d/%d (%d needed)"
-                    % (amount, self.allocated, self.size, self.needed))
+        log.debug("deallocating %d from TotalSizeSet with %d/%d (%d needed)",
+                    amount, self.allocated, self.size, self.needed)
         self.allocated -= amount
 
 class SameSizeSet(object):
@@ -1864,8 +1862,8 @@ def manageSizeSets(size_sets, chunks):
             if isinstance(ss, TotalSizeSet):
                 # TotalSizeSet members are trimmed to achieve the requested
                 # total size
-                log.debug("set: %s %d/%d" % ([d.name for d in ss.devices],
-                                              ss.allocated, ss.size))
+                log.debug("set: %s %d/%d", [d.name for d in ss.devices],
+                                           ss.allocated, ss.size)
 
                 for device in ss.devices:
                     request = requests_by_device[device]
@@ -1882,8 +1880,8 @@ def manageSizeSets(size_sets, chunks):
                 needed = ss.needed
                 for request in requests:
                     chunk = chunks_by_request[request]
-                    log.debug("%s" % request)
-                    log.debug("needed: %d" % ss.needed)
+                    log.debug("%s", request)
+                    log.debug("needed: %d", ss.needed)
 
                     if ss.needed < 0:
                         # it would be good to take back some from each device
@@ -1907,12 +1905,12 @@ def manageSizeSets(size_sets, chunks):
                 # member
                 requests = [requests_by_device[d] for d in ss.devices]
                 _min_growth = min([r.growth for r in requests])
-                log.debug("set: %s %d" % ([d.name for d in ss.devices], ss.size))
-                log.debug("min growth is %d" % _min_growth)
+                log.debug("set: %s %d", [d.name for d in ss.devices], ss.size)
+                log.debug("min growth is %d", _min_growth)
                 for request in requests:
                     chunk = chunks_by_request[request]
                     _max_growth = chunk.sizeToLength(ss.size) - request.base
-                    log.debug("max growth for %s is %d" % (request, _max_growth))
+                    log.debug("max growth for %s is %d", request, _max_growth)
                     min_growth = max(min(_min_growth, _max_growth), 0)
                     if request.growth > min_growth:
                         extra = request.growth - min_growth
@@ -1953,9 +1951,9 @@ def growPartitions(disks, partitions, free, size_sets=None):
         :type size_sets: list of :class:`TotalSizeSet` or :class:`SameSizeSet`
         :returns: :const:`None`
     """
-    log.debug("growPartitions: disks=%s, partitions=%s" %
-            ([d.name for d in disks],
-             ["%s(id %d)" % (p.name, p.id) for p in partitions]))
+    log.debug("growPartitions: disks=%s, partitions=%s",
+            [d.name for d in disks],
+            ["%s(id %d)" % (p.name, p.id) for p in partitions])
     all_growable = [p for p in partitions if p.req_grow]
     if not all_growable:
         log.debug("no growable partitions")
@@ -1964,7 +1962,7 @@ def growPartitions(disks, partitions, free, size_sets=None):
     if size_sets is None:
         size_sets = []
 
-    log.debug("growable partitions are %s" % [p.name for p in all_growable])
+    log.debug("growable partitions are %s", [p.name for p in all_growable])
 
     #
     # collect info about each disk and the requests it contains
@@ -1974,11 +1972,11 @@ def growPartitions(disks, partitions, free, size_sets=None):
         # list of free space regions on this disk prior to partition allocation
         disk_free = [f for f in free if f.device.path == disk.path]
         if not disk_free:
-            log.debug("no free space on %s" % disk.name)
+            log.debug("no free space on %s", disk.name)
             continue
 
         disk_chunks = getDiskChunks(disk, partitions, disk_free)
-        log.debug("disk %s has %d chunks" % (disk.name, len(disk_chunks)))
+        log.debug("disk %s has %d chunks", disk.name, len(disk_chunks))
         chunks.extend(disk_chunks)
 
     #
@@ -1995,7 +1993,7 @@ def growPartitions(disks, partitions, free, size_sets=None):
     manageSizeSets(size_sets, chunks)
 
     for disk in disks:
-        log.debug("growing partitions on %s" % disk.name)
+        log.debug("growing partitions on %s", disk.name)
         for chunk in chunks:
             if chunk.path != disk.path:
                 continue
@@ -2019,8 +2017,8 @@ def growPartitions(disks, partitions, free, size_sets=None):
             new_partitions = []
             for p in chunk.requests:
                 ptype = p.device.partedPartition.type
-                log.debug("partition %s (%d): %s" % (p.device.name,
-                                                     p.device.id, ptype))
+                log.debug("partition %s (%d): %s", p.device.name,
+                                                   p.device.id, ptype)
                 if ptype == parted.PARTITION_EXTENDED:
                     continue
 
@@ -2039,8 +2037,8 @@ def growPartitions(disks, partitions, free, size_sets=None):
                 new_geometry = parted.Geometry(device=disklabel.partedDevice,
                                                start=start,
                                                end=end)
-                log.debug("new geometry for %s: %s" % (p.device.name,
-                                                       new_geometry))
+                log.debug("new geometry for %s: %s", p.device.name,
+                                                     new_geometry)
                 start = end + 1
                 new_partition = parted.Partition(disk=disklabel.partedDisk,
                                                  type=ptype,
@@ -2053,10 +2051,10 @@ def growPartitions(disks, partitions, free, size_sets=None):
 
             # adjust the extended partition as needed
             # we will ony resize an extended partition that we created
-            log.debug("extended: %s" % extended_geometry)
+            log.debug("extended: %s", extended_geometry)
             if extended_geometry and \
                chunk.geometry.contains(extended_geometry):
-                log.debug("setting up new geometry for extended on %s" % disk.name)
+                log.debug("setting up new geometry for extended on %s", disk.name)
                 ext_start = 0
                 for (partition, device) in new_partitions:
                     if partition.type != parted.PARTITION_LOGICAL:
@@ -2071,7 +2069,7 @@ def growPartitions(disks, partitions, free, size_sets=None):
                 new_geometry = parted.Geometry(device=disklabel.partedDevice,
                                                start=ext_start,
                                                end=chunk.geometry.end)
-                log.debug("new geometry for extended: %s" % new_geometry)
+                log.debug("new geometry for extended: %s", new_geometry)
                 new_extended = parted.Partition(disk=disklabel.partedDisk,
                                                 type=parted.PARTITION_EXTENDED,
                                                 geometry=new_geometry)
@@ -2091,8 +2089,8 @@ def growPartitions(disks, partitions, free, size_sets=None):
                     # PartitionDevice instance for it.
                     name = partition.getDeviceNodeName()
 
-                log.debug("setting %s new geometry: %s" % (name,
-                                                           partition.geometry))
+                log.debug("setting %s new geometry: %s", name,
+                                                         partition.geometry)
                 constraint = parted.Constraint(exactGeom=partition.geometry)
                 disklabel.partedDisk.addPartition(partition=partition,
                                                   constraint=constraint)
@@ -2157,11 +2155,11 @@ def growLVM(storage):
             # space in the VG we have a real problem
             raise PartitioningError(_("not enough space for LVM requests"))
         elif not total_free:
-            log.debug("vg %s has no free space" % vg.name)
+            log.debug("vg %s has no free space", vg.name)
             continue
 
-        log.debug("vg %s: %s free ; lvs: %s" % (vg.name, total_free,
-                                                  [l.lvname for l in vg.lvs]))
+        log.debug("vg %s: %s free ; lvs: %s", vg.name, total_free,
+                                              [l.lvname for l in vg.lvs])
 
         # don't include thin lvs in the vg's growth calculation
         fatlvs = [lv for lv in vg.lvs if lv not in vg.thinlvs]
diff --git a/blivet/platform.py b/blivet/platform.py
index d45e2fd..61b8da7 100644
--- a/blivet/platform.py
+++ b/blivet/platform.py
@@ -104,20 +104,20 @@ class Platform(object):
 
         # if there's a required type for this device type, use that
         labelType = self.requiredDiskLabelType(device.partedDevice.type)
-        log.debug("required disklabel type for %s (%s) is %s"
-                  % (device.name, device.partedDevice.type, labelType))
+        log.debug("required disklabel type for %s (%s) is %s",
+                  device.name, device.partedDevice.type, labelType)
         if not labelType:
             # otherwise, use the first supported type for this platform
             # that is large enough to address the whole device
             labelType = self.defaultDiskLabelType
-            log.debug("default disklabel type for %s is %s" % (device.name,
-                                                               labelType))
+            log.debug("default disklabel type for %s is %s", device.name,
+                                                             labelType)
             for lt in self.diskLabelTypes:
                 l = parted.freshDisk(device=device.partedDevice, ty=lt)
                 if l.maxPartitionStartSector > device.partedDevice.length:
                     labelType = lt
-                    log.debug("selecting %s disklabel for %s based on size"
-                              % (labelType, device.name))
+                    log.debug("selecting %s disklabel for %s based on size",
+                              labelType, device.name)
                     break
 
         return labelType
diff --git a/blivet/udev.py b/blivet/udev.py
index 24fa2fa..e71da12 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -40,7 +40,7 @@ def udev_enumerate_devices(deviceClass="block"):
 
 def udev_get_device(sysfs_path):
     if not os.path.exists("/sys%s" % sysfs_path):
-        log.debug("%s does not exist" % sysfs_path)
+        log.debug("%s does not exist", sysfs_path)
         return None
 
     # XXX we remove the /sys part when enumerating devices,
@@ -175,7 +175,7 @@ def __is_blacklisted_blockdev(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))
+                log.info("ignoring %s with model %s", dev_name, model)
                 return True
 
     return False
@@ -286,7 +286,7 @@ def udev_device_get_zfcp_attribute(info, attr=None):
     attribute = os.path.realpath(attribute)
 
     if not os.path.isfile(attribute):
-        log.warning("%s is not a valid zfcp attribute" % (attribute,))
+        log.warning("%s is not a valid zfcp attribute", attribute)
         return None
 
     return open(attribute, "r").read().strip()
@@ -624,7 +624,7 @@ def udev_device_get_iscsi_session(info):
     if match:
         session = match.groups()[0]
     else:
-        log.error("udev_device_get_iscsi_session: session not found in %s" % info)
+        log.error("udev_device_get_iscsi_session: session not found in %s", info)
     return session
 
 
@@ -644,8 +644,8 @@ def udev_device_get_iscsi_initiator(info):
             initiator_file = "/sys/class/iscsi_host/%s/initiatorname" % host
             if os.access(initiator_file, os.R_OK):
                 initiator = open(initiator_file).read().strip()
-                log.debug("found offload iscsi initiatorname %s in file %s" %
-                          (initiator, initiator_file))
+                log.debug("found offload iscsi initiatorname %s in file %s",
+                          initiator, initiator_file)
                 if initiator.lstrip("(").rstrip(")").lower() == "null":
                     initiator = None
     if initiator is None:
@@ -653,7 +653,7 @@ def udev_device_get_iscsi_initiator(info):
         if session:
             initiator = open("/sys/class/iscsi_session/%s/initiatorname" %
                              session).read().strip()
-            log.debug("found iscsi initiatorname %s" % initiator)
+            log.debug("found iscsi initiatorname %s", initiator)
     return initiator
 
 
@@ -725,7 +725,7 @@ def udev_device_get_fcoe_nic(info):
     if (sysfs_pci, host) != (None, None):
         net, iface = info['sysfs_path'].split("/")[5:7]
         if net != "net":
-            log.warning("unexpected sysfs_path of bnx2fc device: %s" % info['sysfs_path'])
+            log.warning("unexpected sysfs_path of bnx2fc device: %s", info['sysfs_path'])
             match = re.compile(r'.*/net/([^/]*)').match(info['sysfs_path'])
             if match:
                 return match.groups()[0].split(".")[0]
diff --git a/blivet/util.py b/blivet/util.py
index 6b0fca9..d609051 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -26,7 +26,7 @@ def _run_program(argv, root='/', stdin=None, env_prune=None):
             os.chroot(root)
 
     with program_log_lock:
-        program_log.info("Running... %s" % " ".join(argv))
+        program_log.info("Running... %s", " ".join(argv))
 
         env = os.environ.copy()
         env.update({"LC_ALL": "C",
@@ -45,13 +45,13 @@ def _run_program(argv, root='/', stdin=None, env_prune=None):
             out = proc.communicate()[0]
             if out:
                 for line in out.splitlines():
-                    program_log.info(line)
+                    program_log.info("%s", line)
 
         except OSError as e:
-            program_log.error("Error running %s: %s" % (argv[0], e.strerror))
+            program_log.error("Error running %s: %s", argv[0], e.strerror)
             raise
 
-        program_log.debug("Return code: %d" % proc.returncode)
+        program_log.debug("Return code: %d", proc.returncode)
 
     return (proc.returncode, out)
 
@@ -103,7 +103,7 @@ def get_mount_paths(dev):
             mount_paths.append(path)
 
     if mount_paths:
-        log.debug("%s is mounted on %s" % (dev, ', '.join(mount_paths)))
+        log.debug("%s is mounted on %s", dev, ', '.join(mount_paths))
     return mount_paths
 
 def get_mount_device(mountpoint):
@@ -124,11 +124,11 @@ def get_mount_device(mountpoint):
         from blivet.devicelibs import loop
         loop_name = os.path.basename(mount_device)
         mount_device = loop.get_backing_file(loop_name)
-        log.debug("found backing file %s for loop device %s" % (mount_device,
-                                                                loop_name))
+        log.debug("found backing file %s for loop device %s", mount_device,
+                                                              loop_name)
 
     if mount_device:
-        log.debug("%s is mounted on %s" % (mount_device, mountpoint))
+        log.debug("%s is mounted on %s", mount_device, mountpoint)
 
     return mount_device
 
@@ -157,10 +157,10 @@ def notify_kernel(path, action="change"):
 
         Exceptions raised: ValueError, IOError
     """
-    log.debug("notifying kernel of '%s' event on device %s" % (action, path))
+    log.debug("notifying kernel of '%s' event on device %s", action, path)
     path = os.path.join(path, "uevent")
     if not path.startswith("/sys/") or not os.access(path, os.W_OK):
-        log.debug("sysfs path '%s' invalid" % path)
+        log.debug("sysfs path '%s' invalid", path)
         raise ValueError("invalid sysfs path")
 
     f = open(path, "a")
@@ -176,7 +176,7 @@ def get_sysfs_attr(path, attr):
     attribute = os.path.realpath(attribute)
 
     if not os.path.isfile(attribute) and not os.path.islink(attribute):
-        log.warning("%s is not a valid attribute" % (attr,))
+        log.warning("%s is not a valid attribute", attr)
         return None
 
     return open(attribute, "r").read().strip()
@@ -208,7 +208,7 @@ def match_path_context(path):
     try:
         context = selinux.matchpathcon(os.path.normpath(path), 0)[1]
     except OSError as e:
-        log.info("failed to get default SELinux context for %s: %s" % (path, e))
+        log.info("failed to get default SELinux context for %s: %s", path, e)
 
     return context
 
@@ -238,7 +238,7 @@ def set_file_context(path, context, root=None):
     try:
         rc = (selinux.lsetfilecon(full_path, context) == 0)
     except OSError as e:
-        log.info("failed to set SELinux context for %s: %s" % (full_path, e))
+        log.info("failed to set SELinux context for %s: %s", full_path, e)
         rc = False
 
     return rc
@@ -284,12 +284,12 @@ def copy_to_system(source):
     from . import ROOT_PATH
 
     if not os.access(source, os.R_OK):
-        log.info("copy_to_system: source '%s' does not exist." % source)
+        log.info("copy_to_system: source '%s' does not exist.", source)
         return False
 
     target = ROOT_PATH + source
     target_dir = os.path.dirname(target)
-    log.debug("copy_to_system: '%s' -> '%s'." % (source, target))
+    log.debug("copy_to_system: '%s' -> '%s'.", source, target)
     if not os.path.isdir(target_dir):
         os.makedirs(target_dir)
     shutil.copy(source, target)
diff --git a/blivet/zfcp.py b/blivet/zfcp.py
index 1c31820..618c4ff 100644
--- a/blivet/zfcp.py
+++ b/blivet/zfcp.py
@@ -30,7 +30,7 @@ log = logging.getLogger("blivet")
 
 def loggedWriteLineToFile(fn, value):
     f = open(fn, "w")
-    log.debug("echo %s > %s" % (value, fn))
+    log.debug("echo %s > %s", value, fn)
     f.write("%s\n" % (value))
     f.close()
 
@@ -121,7 +121,7 @@ class ZFCPDevice:
         failed = "%s/failed" %(unitdir)
 
         if not os.path.exists(online):
-            log.info("Freeing zFCP device %s" % (self.devnum,))
+            log.info("Freeing zFCP device %s", self.devnum)
             util.run_program(["zfcp_cio_free", "-d", self.devnum])
 
         if not os.path.exists(online):
@@ -161,8 +161,8 @@ class ZFCPDevice:
             if os.path.exists(portadd):
                 # older zfcp sysfs interface
                 log.info("WWPN %(wwpn)s at zFCP device %(devnum)s already "
-                         "there." % {'wwpn': self.wwpn,
-                                     'devnum': self.devnum})
+                         "there.", {'wwpn': self.wwpn,
+                                    'devnum': self.devnum})
 
         if not os.path.exists(unitdir):
             try:
@@ -239,8 +239,8 @@ class ZFCPDevice:
                 udev_settle()
                 return
 
-        log.warn("no scsi device found to delete for zfcp %s %s %s"
-                 %(self.devnum, self.wwpn, self.fcplun))
+        log.warn("no scsi device found to delete for zfcp %s %s %s",
+                 self.devnum, self.wwpn, self.fcplun)
 
     def offlineDevice(self):
         offline = "%s/%s/online" %(zfcpsysfs, self.devnum)
@@ -273,8 +273,8 @@ class ZFCPDevice:
             for lun in os.listdir(portdir):
                 if lun.startswith("0x") and \
                         os.path.isdir(os.path.join(portdir, lun)):
-                    log.info("Not removing WWPN %s at zFCP device %s since port still has other LUNs, e.g. %s."
-                             %(self.wwpn, self.devnum, lun))
+                    log.info("Not removing WWPN %s at zFCP device %s since port still has other LUNs, e.g. %s.",
+                             self.wwpn, self.devnum, lun)
                     return True
 
             try:
@@ -290,8 +290,8 @@ class ZFCPDevice:
             for port in os.listdir(devdir):
                 if port.startswith("0x") and \
                         os.path.isdir(os.path.join(devdir, port)):
-                    log.info("Not setting zFCP device %s offline since it still has other ports, e.g. %s."
-                             %(self.devnum, port))
+                    log.info("Not setting zFCP device %s offline since it still has other ports, e.g. %s.",
+                             self.devnum, port)
                     return True
         else:
             # newer zfcp sysfs interface with auto port scan
@@ -299,8 +299,8 @@ class ZFCPDevice:
             luns = glob.glob("%s/0x????????????????/0x????????????????"
                           %(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]))
+                log.info("Not setting zFCP device %s offline since it still has other LUNs, e.g. %s.",
+                         self.devnum, luns[0])
                 return True
 
         try:
@@ -338,7 +338,7 @@ class ZFCP:
         try:
             f = open(zfcpconf, "r")
         except IOError:
-            log.info("no %s; not configuring zfcp" % (zfcpconf,))
+            log.info("no %s; not configuring zfcp", zfcpconf)
             return
 
         lines = map(lambda x: x.strip().lower(), f.readlines())
@@ -361,7 +361,7 @@ class ZFCP:
                 wwpn   = fields[2]
                 fcplun = fields[4]
             else:
-                log.warn("Invalid line found in %s: %s" % (zfcpconf, line,))
+                log.warn("Invalid line found in %s: %s", zfcpconf, line)
                 continue
 
             try:
@@ -370,7 +370,7 @@ class ZFCP:
                 if self.intf:
                     self.intf.messageWindow(_("Error"), str(e))
                 else:
-                    log.warning(str(e))
+                    log.warning("%s", str(e))
 
     def addFCP(self, devnum, wwpn, fcplun):
         d = ZFCPDevice(devnum, wwpn, fcplun)
@@ -387,7 +387,7 @@ class ZFCP:
             try:
                 d.offlineDevice()
             except ValueError as e:
-                log.warn(str(e))
+                log.warn("%s", str(e))
 
     def startup(self):
         if not self.down:
@@ -405,7 +405,7 @@ class ZFCP:
             try:
                 d.onlineDevice()
             except ValueError as e:
-                log.warn(str(e))
+                log.warn("%s", str(e))
 
     def write(self, ROOT_PATH):
         if len(self.fcpdevs) == 0:
-- 
1.8.3.1



More information about the anaconda-patches mailing list