[PATCH] Fix problems reported by pylint

David Shea dshea at redhat.com
Mon Jan 13 16:03:18 UTC 2014


This fixes errors ranging in severity from that log parameter thing to
syntax errors
---
 pyanaconda/kickstart.py             | 4 ++--
 pyanaconda/ui/gui/spokes/custom.py  | 2 +-
 pyanaconda/ui/gui/spokes/storage.py | 6 +++---
 pyanaconda/ui/lib/disks.py          | 1 -
 pyanaconda/ui/tui/hubs/summary.py   | 2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index dbcc90d..b1b1ef3 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -841,7 +841,7 @@ class LogVolData(commands.logvol.F20_LogVolData):
                                     thin_pool=self.thin_pool,
                                     thin_volume=self.thin_volume,
                                     grow=self.grow,
-                                    maxsize=max_size,
+                                    maxsize=maxsize,
                                     percent=self.percent,
                                     **pool_args)
 
@@ -1467,7 +1467,7 @@ class VolGroupData(commands.volgroup.FC16_VolGroupData):
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="Volume group defined without any physical volumes.  Either specify physical volumes or use --useexisting."))
 
         pesize = Size(spec="%d KiB" % self.pesize)
-        if pesize not in getPossiblePhysicalExtents(floor=1024):
+        if pesize not in getPossiblePhysicalExtents():
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="Volume group specified invalid pesize"))
 
         # If --noformat or --useexisting was given, there's really nothing to do.
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 6cbf67e..8bd6a3b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -871,7 +871,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
     def _currentTotalSpace(self):
         """Add up the sizes of all selected disks and return it as a Size."""
-        totalSpace = sum(disk.size for disk in self._clearpartDevices,
+        totalSpace = sum((disk.size for disk in self._clearpartDevices),
                          Size(bytes=0))
         return totalSpace
 
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 5d1c9a6..a9d1460 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -768,7 +768,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
         # show the installation options dialog
         disks = [d for d in self.disks if d.name in self.selected_disks]
-        disks_size = sum(d.size for d in disks, Size(bytes=0))
+        disks_size = sum((d.size for d in disks), Size(bytes=0))
 
         # No disks selected?  The user wants to back out of the storage spoke.
         if not disks:
@@ -793,8 +793,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
             fs_free = sum(f[1] for f in free_space.itervalues())
 
         required_space = self.payload.spaceRequired
-        auto_swap = sum(r.size for r in self.storage.autoPartitionRequests
-                                if r.fstype == "swap", Size(bytes=0))
+        auto_swap = sum((r.size for r in self.storage.autoPartitionRequests
+                                if r.fstype == "swap"), Size(bytes=0))
 
         log.debug("disk free: %s  fs free: %s  sw needs: %s  auto swap: %s",
                   disk_free, fs_free, required_space, auto_swap)
diff --git a/pyanaconda/ui/lib/disks.py b/pyanaconda/ui/lib/disks.py
index c437d06..ddeaa41 100644
--- a/pyanaconda/ui/lib/disks.py
+++ b/pyanaconda/ui/lib/disks.py
@@ -21,7 +21,6 @@
 #
 
 from blivet.devices import MultipathDevice, iScsiDiskDevice, FcoeDiskDevice
-from blivet.size import Size
 
 from pyanaconda.flags import flags
 
diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
index fb2abf3..d7c0a52 100644
--- a/pyanaconda/ui/tui/hubs/summary.py
+++ b/pyanaconda/ui/tui/hubs/summary.py
@@ -69,7 +69,7 @@ class SummaryHub(TUIHub):
         if not flags.ksprompt:
             errtxt = _("The following mandatory spokes are not completed:") + \
                      "\n" + "\n".join(spoke.title for spoke in incompleteSpokes)
-            log.error("CmdlineError: %s" % errtxt)
+            log.error("CmdlineError: %s", errtxt)
             raise CmdlineError(errtxt)
 
         return TUIHub.prompt(self, args)
-- 
1.8.5.2



More information about the anaconda-patches mailing list