Enable F40X checking
Clean up imports due to F401 and F403 checks. F401 'module' imported but unused F403 unable to detect undefined names with wildcard import Change-Id: I487edb157de1a6babc7ad8a3fb65f195e476c490
This commit is contained in:
parent
7ca0174d8c
commit
88bb1af1d5
@ -27,9 +27,7 @@ from webob.exc import (HTTPNotFound,
|
||||
HTTPConflict,
|
||||
HTTPBadRequest,
|
||||
HTTPForbidden,
|
||||
HTTPRequestEntityTooLarge,
|
||||
HTTPInternalServerError,
|
||||
HTTPServiceUnavailable)
|
||||
HTTPRequestEntityTooLarge)
|
||||
from webob import Response
|
||||
|
||||
from glance.api import common
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import json
|
||||
import re
|
||||
import urllib
|
||||
|
@ -24,7 +24,6 @@ from __future__ import print_function
|
||||
from __future__ import with_statement
|
||||
|
||||
import argparse
|
||||
import errno
|
||||
import fcntl
|
||||
import os
|
||||
import resource
|
||||
|
@ -36,7 +36,7 @@ except ImportError:
|
||||
import ssl
|
||||
|
||||
try:
|
||||
import sendfile
|
||||
import sendfile # noqa
|
||||
SENDFILE_SUPPORTED = True
|
||||
except ImportError:
|
||||
SENDFILE_SUPPORTED = False
|
||||
|
@ -24,7 +24,6 @@ import logging
|
||||
import logging.config
|
||||
import logging.handlers
|
||||
import os
|
||||
import sys
|
||||
|
||||
from oslo.config import cfg
|
||||
from paste import deploy
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, Integer, String, Text, from_migration_import)
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, Integer, String, Text, from_migration_import)
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, BigInteger, Integer, String,
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, Integer, String, Text, from_migration_import)
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, BigInteger, Integer, String,
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, Integer, String, create_tables,
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import (
|
||||
Boolean, DateTime, Integer, String, Text, from_migration_import)
|
||||
|
@ -15,8 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from migrate.changeset import *
|
||||
from sqlalchemy import *
|
||||
from migrate.changeset import * # noqa
|
||||
from sqlalchemy import * # noqa
|
||||
|
||||
from glance.db.sqlalchemy.migrate_repo.schema import from_migration_import
|
||||
|
||||
|
@ -28,7 +28,7 @@ migration performs the following steps for every entry in the images table:
|
||||
|
||||
Fixes bug #1081043
|
||||
"""
|
||||
import types
|
||||
import types # noqa
|
||||
import urllib
|
||||
import urlparse
|
||||
|
||||
@ -38,7 +38,7 @@ import sqlalchemy
|
||||
from glance.common import crypt
|
||||
from glance.common import exception
|
||||
import glance.openstack.common.log as logging
|
||||
import glance.store.swift
|
||||
import glance.store.swift # noqa
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
@ -19,7 +19,7 @@ import json
|
||||
import pickle
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy import MetaData, Table, Column
|
||||
from sqlalchemy import MetaData, Table, Column # noqa
|
||||
from glance.db.sqlalchemy import models
|
||||
|
||||
|
||||
|
@ -55,7 +55,6 @@ $image_cache_dir/
|
||||
|
||||
from __future__ import absolute_import
|
||||
from contextlib import contextmanager
|
||||
import datetime
|
||||
import errno
|
||||
import os
|
||||
import stat
|
||||
|
@ -16,7 +16,6 @@
|
||||
# under the License.
|
||||
|
||||
import routes
|
||||
from webob import exc
|
||||
|
||||
from glance.common import wsgi
|
||||
from glance.registry.api.v2 import rpc
|
||||
|
@ -16,13 +16,10 @@
|
||||
# under the License.
|
||||
|
||||
import collections
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from glance.common import crypt
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
import glance.context
|
||||
|
@ -19,7 +19,6 @@
|
||||
"""Base class for all storage backends"""
|
||||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import importutils
|
||||
import glance.openstack.common.log as logging
|
||||
from glance.openstack.common import strutils
|
||||
|
@ -28,7 +28,6 @@ from oslo.config import cfg
|
||||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
from glance.openstack.common import excutils
|
||||
import glance.openstack.common.log as logging
|
||||
from glance.openstack.common import units
|
||||
import glance.store
|
||||
|
@ -15,8 +15,6 @@
|
||||
|
||||
from glance.api import CONF
|
||||
import glance.db.registry.api
|
||||
from glance.db.sqlalchemy import api
|
||||
from glance.db.sqlalchemy import models as db_models
|
||||
import glance.tests.functional.db as db_tests
|
||||
from glance.tests import functional
|
||||
from glance.tests.functional.db import base
|
||||
|
@ -733,7 +733,7 @@ class TestImageCacheXattr(functional.FunctionalTest,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import xattr
|
||||
import xattr # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
@ -779,7 +779,7 @@ class TestImageCacheManageXattr(functional.FunctionalTest,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import xattr
|
||||
import xattr # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
@ -825,7 +825,7 @@ class TestImageCacheSqlite(functional.FunctionalTest,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import sqlite3
|
||||
import sqlite3 # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
@ -864,7 +864,7 @@ class TestImageCacheManageSqlite(functional.FunctionalTest,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import sqlite3
|
||||
import sqlite3 # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
|
@ -31,7 +31,7 @@ from glance.openstack.common import units
|
||||
from glance.tests import functional
|
||||
from glance.tests.functional.store_utils import (setup_http,
|
||||
get_http_uri)
|
||||
from glance.tests.utils import skip_if_disabled, requires
|
||||
from glance.tests.utils import skip_if_disabled
|
||||
|
||||
FIVE_KB = 5 * units.Ki
|
||||
|
||||
|
@ -20,9 +20,7 @@ import webob
|
||||
import glance.api.common
|
||||
from glance.common import config
|
||||
from glance.common import exception
|
||||
from glance.common import wsgi
|
||||
from glance.tests import utils as test_utils
|
||||
from glance.tests.unit import base
|
||||
|
||||
|
||||
class SimpleIterator(object):
|
||||
|
@ -21,7 +21,6 @@ import shutil
|
||||
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
import stubout
|
||||
|
||||
from glance import store
|
||||
from glance.store import location
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import httplib
|
||||
import StringIO
|
||||
|
||||
import mox
|
||||
import testtools
|
||||
|
@ -15,12 +15,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import socket
|
||||
import time
|
||||
|
||||
import datetime
|
||||
import eventlet.patcher
|
||||
import httplib2
|
||||
import webob
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import stubout
|
||||
import testtools
|
||||
import webob
|
||||
|
||||
|
@ -20,7 +20,7 @@ from glance.common import crypt
|
||||
from glance.common import exception
|
||||
import glance.context
|
||||
import glance.db
|
||||
from glance.openstack.common import uuidutils, timeutils
|
||||
from glance.openstack.common import uuidutils
|
||||
import glance.tests.unit.utils as unit_test_utils
|
||||
import glance.tests.utils as test_utils
|
||||
|
||||
|
@ -30,7 +30,7 @@ from glance.common import exception
|
||||
from glance import image_cache
|
||||
from glance.openstack.common import units
|
||||
#NOTE(bcwaldon): This is imported to load the registry config options
|
||||
import glance.registry
|
||||
import glance.registry # noqa
|
||||
import glance.store.filesystem as fs_store
|
||||
import glance.store.s3 as s3_store
|
||||
from glance.tests import utils as test_utils
|
||||
@ -483,7 +483,7 @@ class TestImageCacheXattr(test_utils.BaseTestCase,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import xattr
|
||||
import xattr # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
@ -521,7 +521,7 @@ class TestImageCacheSqlite(test_utils.BaseTestCase,
|
||||
|
||||
if not getattr(self, 'inited', False):
|
||||
try:
|
||||
import sqlite3
|
||||
import sqlite3 # noqa
|
||||
except ImportError:
|
||||
self.inited = True
|
||||
self.disabled = True
|
||||
|
@ -18,10 +18,8 @@
|
||||
import copy
|
||||
import datetime
|
||||
import os
|
||||
import stubout
|
||||
|
||||
import mox
|
||||
|
||||
import testtools
|
||||
|
||||
from glance.common import config
|
||||
|
@ -26,7 +26,6 @@ import shutil
|
||||
import socket
|
||||
import StringIO
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
|
@ -26,7 +26,6 @@ Installation script for Glance's development virtualenv
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import install_venv_common as install_venv
|
||||
|
4
tox.ini
4
tox.ini
@ -32,8 +32,6 @@ commands = {posargs}
|
||||
# E126 continuation line over-indented for hanging indent
|
||||
# E711 comparison to None should be 'if cond is not None:'
|
||||
# E712 comparison to True should be 'if cond is True:' or 'if cond:'
|
||||
# F401 'module' imported but unused
|
||||
# F403 unable to detect undefined names with wildcard import
|
||||
# F811 redefinition of function
|
||||
# F821 undefined name 'name'
|
||||
# F841 local variable 'name' assigned but never used
|
||||
@ -49,6 +47,6 @@ commands = {posargs}
|
||||
# H701 Empty localisation string
|
||||
# H702 Formatting operation should be outside of localization
|
||||
# H703 multiple positional placeholders
|
||||
ignore = E125,E126,E711,E712,F401,F403,F811,F821,F841,H102,H201,H202,H233,H301,H302,H306,H402,H404,H701,H702,H703
|
||||
ignore = E125,E126,E711,E712,F811,F821,F841,H102,H201,H202,H233,H301,H302,H306,H402,H404,H701,H702,H703
|
||||
builtins = _
|
||||
exclude = .venv,.git,.tox,dist,doc,etc,*glance/locale*,*openstack/common*,*lib/python*,*egg,build
|
||||
|
Loading…
Reference in New Issue
Block a user