Flake8: Fix F401

Fix:
F401 'XXX' imported but unused
Add noqa where needed, remove extra imports otherwise.

Remove F401 from ignore list.

Partial-Bug: #1333290
Change-Id: Ib71f0dd001c4e4899200b5e60b3a38e4a6c40555
This commit is contained in:
Andreas Jaeger 2014-08-20 18:54:10 +02:00 committed by Andreas Jaeger
parent 2965d59541
commit 290769f087
28 changed files with 8 additions and 43 deletions

View File

@ -42,7 +42,7 @@ if os.path.exists(os.path.join(possible_topdir, "manila", "__init__.py")):
from manila.openstack.common import gettextutils
gettextutils.install('manila')
from manila.common import config # Need to register global_opts
from manila.common import config # Need to register global_opts # noqa
from manila.openstack.common import log as logging
from manila import service
from manila import utils

View File

@ -39,7 +39,7 @@ if os.path.exists(os.path.join(possible_topdir, "manila", "__init__.py")):
from manila.openstack.common import gettextutils
gettextutils.install('manila')
from manila.common import config # Need to register global_opts
from manila.common import config # Need to register global_opts # noqa
from manila.openstack.common import log as logging
from manila import service
from manila import utils

View File

@ -73,7 +73,7 @@ gettextutils.install('manila')
from oslo.config import cfg
from manila.common import config # Need to register global_opts
from manila.common import config # Need to register global_opts # noqa
from manila import context
from manila import db
from manila.db import migration
@ -162,7 +162,7 @@ class ShellCommands(object):
else:
# We don't have to wrap the following import in a 'try',
# because we already know 'readline' was imported successfully.
import rlcompleter
import rlcompleter # noqa
readline.parse_and_bind("tab:complete")
code.interact()

View File

@ -37,7 +37,7 @@ if os.path.exists(os.path.join(possible_topdir, 'manila', '__init__.py')):
from manila.openstack.common import gettextutils
gettextutils.install('manila')
from manila.common import config # Need to register global_opts
from manila.common import config # Need to register global_opts # noqa
from manila.openstack.common import log as logging
from manila import service
from manila import utils

View File

@ -36,7 +36,7 @@ if os.path.exists(os.path.join(possible_topdir, 'manila', '__init__.py')):
from manila.openstack.common import gettextutils
gettextutils.install('manila')
from manila.common import config # Need to register global_opts
from manila.common import config # Need to register global_opts # noqa
from manila.openstack.common import log as logging
from manila import service
from manila import utils

View File

@ -14,7 +14,6 @@
# under the License.
import re
import subprocess
from tempest.cli import manilaclient
from tempest import config_share as config

View File

@ -20,7 +20,6 @@ from manila.api.openstack import wsgi
from manila import db
from manila import exception
from manila.openstack.common import log as logging
from manila.openstack.common import strutils
from manila import share

View File

@ -23,10 +23,8 @@ from webob import exc
from manila.api.openstack import wsgi
from manila.api.views import share_networks as share_networks_views
from manila.api import xmlutil
from manila.common import constants
from manila.db import api as db_api
from manila import exception
from manila.openstack.common import importutils
from manila.openstack.common import log as logging
from manila import policy
from manila import quota

View File

@ -23,7 +23,6 @@ from manila.api import common
from manila.api.openstack import wsgi
from manila.api.views import shares as share_views
from manila.api import xmlutil
from manila.common import constants
from manila import exception
from manila.openstack.common import log as logging
from manila.openstack.common import uuidutils

View File

@ -16,7 +16,6 @@
# under the License.
from manila.api import common
from manila.openstack.common import log as logging
class ViewBuilder(common.ViewBuilder):

View File

@ -16,7 +16,6 @@
# under the License.
from manila.api import common
from manila.openstack.common import log as logging
class ViewBuilder(common.ViewBuilder):

View File

@ -27,7 +27,6 @@ TODO(rraja): support SMB protocol.
import errno
import os
import pdb
from pipes import quote as shellquote
import re
import xml.etree.cElementTree as etree
@ -35,7 +34,6 @@ import xml.etree.cElementTree as etree
from manila import exception
from manila.openstack.common import log as logging
from manila.share import driver
from manila import utils
from oslo.config import cfg

View File

@ -38,7 +38,6 @@ from manila.openstack.common import log as logging
from manila.openstack.common import timeutils
from manila import rpc
from manila import service
from manila import tests
from manila.tests import conf_fixture
from manila.tests import fake_notifier

View File

@ -12,16 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime
import uuid
from oslo.config import cfg
import webob
from manila.api.contrib import share_actions
from manila import exception
from manila.openstack.common import jsonutils
from manila import share
from manila.share import api as share_api
from manila import test
from manila.tests.api.contrib import stubs

View File

@ -15,7 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
import mock
import webob

View File

@ -20,7 +20,6 @@ import uuid
from oslo.config import cfg
import webob
from manila.api import extensions
from manila.api.v1 import share_metadata
from manila.api.v1 import shares
import manila.db

View File

@ -21,7 +21,6 @@ from manila.api.v1 import share_networks
from manila.common import constants
from manila.db import api as db_api
from manila import exception
from manila import policy
from manila import quota
from manila import test
from manila.tests.api import fakes

View File

@ -18,7 +18,6 @@ import datetime
import webob
from manila.api.v1 import share_snapshots
from manila import exception
from manila.share import api as share_api
from manila import test
from manila.tests.api.contrib import stubs

View File

@ -16,7 +16,6 @@
from oslo.db import exception as db_exception
import six
from manila.common import constants
from manila import context
from manila.db import api as db_api
from manila.db.sqlalchemy import api as sqlalchemy_api

View File

@ -18,7 +18,6 @@ Tests For Capacity Weigher.
import mock
from oslo.config import cfg
import testtools
from manila import context
from manila.openstack.common.scheduler.weights import HostWeightHandler

View File

@ -15,16 +15,11 @@
Tests For Scheduler Host Filters.
"""
import httplib
from manila import context
from manila import db
from manila import exception
from manila.openstack.common import jsonutils
from manila.openstack.common.scheduler import filters
from manila import test
from manila.tests.scheduler import fakes
from manila.tests import utils as test_utils
from manila import utils

View File

@ -47,7 +47,7 @@ class ConfigTestCase(test.TestCase):
def test_runtime_and_unknown_flags(self):
self.assertNotIn('runtime_answer', CONF)
import manila.tests.runtime_conf
import manila.tests.runtime_conf # noqa
self.assertIn('runtime_answer', CONF)
self.assertEqual(CONF.runtime_answer, 54)

View File

@ -19,7 +19,6 @@ import six
from manila import exception
from manila import test
from manila import utils
class FakeNotifier(object):

View File

@ -25,7 +25,6 @@ from manila import context
from manila import db
from manila import exception
from manila.openstack.common import importutils
import manila.policy
from manila.share import manager
from manila import test
from manila import utils

View File

@ -15,21 +15,17 @@
"""Unit tests for the Share API module."""
import datetime
import random
import uuid
import mock
import suds
from manila import context
from manila import db as db_driver
from manila import exception
from manila.openstack.common import timeutils
from manila import quota
from manila.scheduler import rpcapi as scheduler_rpcapi
from manila import share
from manila.share import api as share_api
from manila.share import rpcapi as share_rpcapi
from manila import test
from manila.tests.db import fakes as db_fakes
from manila import utils

View File

@ -17,7 +17,6 @@
"""Unit tests for `manila.wsgi`."""
import os.path
import ssl
import tempfile
import urllib2

View File

@ -19,7 +19,6 @@ Windows storage classes to be used in testing.
"""
import os
import sys
from oslo.config import cfg

View File

@ -49,6 +49,6 @@ commands = bash tools/lintstack.sh
#
# H904 wrap long lines in parentheses instead of a backslash
# reason: removed in hacking (https://review.openstack.org/#/c/101701/)
ignore = E126,E127,E128,H302,H404,H405,H501,H904,F401,F841
ignore = E126,E127,E128,H302,H404,H405,H501,H904,F841
builtins = _
exclude = .venv,.tox,dist,doc,openstack,*egg