From 86dc475bd6de08c8a329a26f988d0fff8868c8a0 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Fri, 4 May 2012 15:54:12 -0700 Subject: [PATCH] pylint cleanup Mostly remove unused imports Change-Id: Icdb3ec77537b2568f4e85843bab89eb63cd17d8e --- nova/api/openstack/compute/contrib/floating_ips.py | 1 - nova/api/validator.py | 2 -- nova/cloudpipe/pipelib.py | 1 - nova/consoleauth/manager.py | 2 -- nova/db/sqlalchemy/migration.py | 1 - nova/network/ldapdns.py | 3 --- nova/rpc/impl_fake.py | 3 --- nova/testing/runner.py | 2 -- nova/tests/test_auth.py | 2 -- nova/utils.py | 4 +--- 10 files changed, 1 insertion(+), 20 deletions(-) diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index 4a5cec8d2235..11da0d770cc3 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -26,7 +26,6 @@ from nova import compute from nova import exception from nova import log as logging from nova import network -from nova.rpc import common as rpc_common LOG = logging.getLogger(__name__) diff --git a/nova/api/validator.py b/nova/api/validator.py index 4d4c9457ae3c..beee370b9d29 100644 --- a/nova/api/validator.py +++ b/nova/api/validator.py @@ -21,8 +21,6 @@ import logging import re import socket -from nova import exception - LOG = logging.getLogger(__name__) diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index 497ee6ffcc1e..0f9f782b082c 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -24,7 +24,6 @@ an instance with it. import os import string -import tempfile import zipfile # NOTE(vish): cloud is only for the _gen_key functionality diff --git a/nova/consoleauth/manager.py b/nova/consoleauth/manager.py index f43dbfb61fe5..27e3cb74d05e 100644 --- a/nova/consoleauth/manager.py +++ b/nova/consoleauth/manager.py @@ -18,8 +18,6 @@ """Auth Components for Consoles.""" -import os -import sys import time from nova import flags diff --git a/nova/db/sqlalchemy/migration.py b/nova/db/sqlalchemy/migration.py index 698e7875ab11..8658e7697fa7 100644 --- a/nova/db/sqlalchemy/migration.py +++ b/nova/db/sqlalchemy/migration.py @@ -18,7 +18,6 @@ import distutils.version as dist_version import os -import sys from nova.db import migration from nova.db.sqlalchemy.session import get_engine diff --git a/nova/network/ldapdns.py b/nova/network/ldapdns.py index c2470e127c3b..36ff21439e7c 100644 --- a/nova/network/ldapdns.py +++ b/nova/network/ldapdns.py @@ -13,9 +13,6 @@ # under the License. import ldap -import os -import shutil -import tempfile import time from nova.auth import fakeldap diff --git a/nova/rpc/impl_fake.py b/nova/rpc/impl_fake.py index 065cca699e7e..99c686901d72 100644 --- a/nova/rpc/impl_fake.py +++ b/nova/rpc/impl_fake.py @@ -19,10 +19,7 @@ queues. Casts will block, but this is very useful for tests. import inspect import json -import signal -import sys import time -import traceback import eventlet diff --git a/nova/testing/runner.py b/nova/testing/runner.py index 7ddf959dbd55..4ee88553b063 100644 --- a/nova/testing/runner.py +++ b/nova/testing/runner.py @@ -110,8 +110,6 @@ class _AnsiColorizer(object): curses.setupterm() return curses.tigetnum("colors") > 2 except Exception: - raise - # guess false in case of error return False supported = classmethod(supported) diff --git a/nova/tests/test_auth.py b/nova/tests/test_auth.py index 6549d6e96cd5..fb35b9c5a99f 100644 --- a/nova/tests/test_auth.py +++ b/nova/tests/test_auth.py @@ -18,13 +18,11 @@ import unittest -from nova import crypto from nova import exception from nova import flags from nova import log as logging from nova import test from nova.auth import manager -from nova.api.ec2 import cloud from nova.auth import fakeldap FLAGS = flags.FLAGS diff --git a/nova/utils.py b/nova/utils.py index 73ede52d5ffa..7d4cfd287fa5 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -337,7 +337,7 @@ def debug(arg): def generate_uid(topic, size=8): characters = '01234567890abcdefghijklmnopqrstuvwxyz' - choices = [random.choice(characters) for x in xrange(size)] + choices = [random.choice(characters) for _x in xrange(size)] return '%s-%s' % (topic, ''.join(choices)) @@ -1090,8 +1090,6 @@ def check_isinstance(obj, cls): if isinstance(obj, cls): return obj raise Exception(_('Expected object of type: %s') % (str(cls))) - # TODO(justinsb): Can we make this better?? - return cls() # Ugly PyLint hack def parse_server_string(server_str):