[PATCH 05/10] Remove unused imports and variables

David Shea dshea at redhat.com
Wed Sep 25 18:21:49 UTC 2013


---
 scripts/anaconda-cleanup                |  2 --
 scripts/anaconda-yum                    |  1 -
 scripts/instperf                        |  2 --
 scripts/makebumpver                     |  4 ++--
 scripts/makeupdates                     | 15 ++-------------
 tests/pyanaconda_tests/timezone_test.py |  1 -
 tests/regex_tests/groupparse_test.py    |  2 +-
 tests/regex_tests/proxy_test.py         |  2 +-
 8 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/scripts/anaconda-cleanup b/scripts/anaconda-cleanup
index 1682f59..8664685 100755
--- a/scripts/anaconda-cleanup
+++ b/scripts/anaconda-cleanup
@@ -38,8 +38,6 @@ flags.imageInstall = True
 import pyanaconda.anaconda_log
 pyanaconda.anaconda_log.init()
 
-from pyanaconda import iutil
-
 from blivet import StorageDiscoveryConfig
 from blivet.devicetree import DeviceTree
 from blivet import devicelibs
diff --git a/scripts/anaconda-yum b/scripts/anaconda-yum
index da40fcc..98ebcd1 100755
--- a/scripts/anaconda-yum
+++ b/scripts/anaconda-yum
@@ -18,7 +18,6 @@
 #
 # Red Hat Author(s): Brian C. Lane <bcl at redhat.com>
 #
-import logging
 import os
 import sys
 import argparse
diff --git a/scripts/instperf b/scripts/instperf
index f0f53cc..2caa222 100755
--- a/scripts/instperf
+++ b/scripts/instperf
@@ -22,8 +22,6 @@ def logit():
     swapTotal = 0
     swapFree = 0
 
-    global mem_logger
-
     with open("/proc/meminfo") as f:
         for line in f.readlines():
             if line.startswith("Buffers:"):
diff --git a/scripts/makebumpver b/scripts/makebumpver
index b70a006..cac6bc3 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -400,10 +400,10 @@ def main(argv):
     name, version, release, bugreport = None, None, None, None
     ignore, bugmap = None, None
     show_help, unknown = False, False
-    opts, args = [], []
+    opts = []
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:d?',
+        opts, _args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:d?',
                                    ['name=', 'version=', 'release=',
                                     'bugreport=', 'ignore=', 'map=',
                                     'debug', 'help'])
diff --git a/scripts/makeupdates b/scripts/makeupdates
index 71f2b4f..ef935ca 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -134,7 +134,7 @@ def get_req_tuple(pkg_tuple, version_request):
     :returns: version request tuple
     :rtype: tuple
     """
-    name, arch, epoch, version, release = pkg_tuple
+    name, _arch, epoch, version, release = pkg_tuple
     return (name, version_request, (epoch, version, release))
 
 
@@ -191,15 +191,6 @@ def create_RPM_cache_folder():
         os.makedirs(RPM_FOLDER_NAME)
 
 def copyUpdatedFiles(tag, updates, cwd):
-    def pruneFile(src, names):
-        lst = []
-
-        for name in names:
-            if name.startswith('Makefile') or name.endswith('.pyc'):
-                lst.append(name)
-
-        return lst
-
     def install_to_dir(fname, relpath):
         sys.stdout.write("Including %s\n" % fname)
         outdir = os.path.join(updates, relpath)
@@ -207,8 +198,6 @@ def copyUpdatedFiles(tag, updates, cwd):
             os.makedirs(outdir)
         shutil.copy2(file, outdir)
 
-    subdirs = []
-
     # Updates get overlaid onto the runtime filesystem. Anaconda expects them
     # to be in /run/install/updates, so put them in
     # $updatedir/run/install/updates.
@@ -644,7 +633,7 @@ def get_RPMs_from_koji(packages, fedora_number, arch):
 
     index = 1
     print("starting %d worker threads" % len(packages))
-    for package_name, package in packages.iteritems():
+    for _package_name, package in packages.iteritems():
         thread = threading.Thread(name=index, target=get_rpm_from_Koji_thread,
                                   args=(package, fedora_number,
                                         arch, rpm_paths, print_lock))
diff --git a/tests/pyanaconda_tests/timezone_test.py b/tests/pyanaconda_tests/timezone_test.py
index c277bd0..3514d1f 100644
--- a/tests/pyanaconda_tests/timezone_test.py
+++ b/tests/pyanaconda_tests/timezone_test.py
@@ -20,7 +20,6 @@
 
 from pyanaconda import timezone
 import unittest
-import langtable
 import mock
 
 class TimezonesListings(unittest.TestCase):
diff --git a/tests/regex_tests/groupparse_test.py b/tests/regex_tests/groupparse_test.py
index 2802cad..6d5b793 100644
--- a/tests/regex_tests/groupparse_test.py
+++ b/tests/regex_tests/groupparse_test.py
@@ -53,7 +53,7 @@ class GroupParseTestCase(unittest.TestCase):
         for group, result in tests:
             try:
                 self.assertEqual(GROUPLIST_FANCY_PARSE.match(group).groups(), result)
-            except AssertionError as error:
+            except AssertionError:
                 got_error = True
                 print("Group parse error: `%s' did not not parse as `%s'" % (group, result))
 
diff --git a/tests/regex_tests/proxy_test.py b/tests/regex_tests/proxy_test.py
index 0e551f1..6fae463 100644
--- a/tests/regex_tests/proxy_test.py
+++ b/tests/regex_tests/proxy_test.py
@@ -111,7 +111,7 @@ class ProxyRegexTestCase(unittest.TestCase):
         for proxy, result in tests:
             try:
                 self.assertEqual(PROXY_URL_PARSE.match(proxy).groups(), result)
-            except AssertionError as error:
+            except AssertionError:
                 got_error = True
                 print("Proxy parse error: `%s' did not parse as `%s'" % (proxy, result))
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list