From: Dirk Mueller Date: Fri, 13 Dec 2013 12:29:12 +0000 (+0100) Subject: Fix and enable gating on F401 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2de87b883ec0a8d7ceb2b67096423c8cb3e5d88b;p=openstack-build%2Fcinder-build.git Fix and enable gating on F401 Do not allow unused imports in modules, and remove those that are currently unused. Change-Id: I7600b1cce22eaef87633f98a89db2086a3ec2b55 --- diff --git a/bin/cinder-all b/bin/cinder-all index 3e9722231..a4785950e 100755 --- a/bin/cinder-all +++ b/bin/cinder-all @@ -46,7 +46,8 @@ if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")): from cinder.openstack.common import gettextutils gettextutils.install('cinder', lazy=False) -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder import service from cinder import utils diff --git a/bin/cinder-api b/bin/cinder-api index fda3e6a00..fe8611154 100755 --- a/bin/cinder-api +++ b/bin/cinder-api @@ -40,7 +40,8 @@ if os.path.exists(os.path.join(possible_topdir, "cinder", "__init__.py")): from cinder.openstack.common import gettextutils gettextutils.install('cinder', lazy=False) -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder import service from cinder import utils diff --git a/bin/cinder-backup b/bin/cinder-backup index 5f2a47587..c1555987c 100755 --- a/bin/cinder-backup +++ b/bin/cinder-backup @@ -38,7 +38,8 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder import service from cinder import utils diff --git a/bin/cinder-clear-rabbit-queues b/bin/cinder-clear-rabbit-queues index 541b28980..f2e9f33eb 100755 --- a/bin/cinder-clear-rabbit-queues +++ b/bin/cinder-clear-rabbit-queues @@ -23,10 +23,8 @@ """ -import datetime import os import sys -import time from oslo.config import cfg @@ -41,9 +39,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts -from cinder import context -from cinder import exception +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder.openstack.common import rpc from cinder import version diff --git a/bin/cinder-manage b/bin/cinder-manage index 76afaf6b5..8926b4527 100755 --- a/bin/cinder-manage +++ b/bin/cinder-manage @@ -74,7 +74,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder import context from cinder import db from cinder.db import migration @@ -168,7 +169,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() diff --git a/bin/cinder-scheduler b/bin/cinder-scheduler index 0a4c7a0d0..752b0cfef 100755 --- a/bin/cinder-scheduler +++ b/bin/cinder-scheduler @@ -40,7 +40,8 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder import service from cinder import utils diff --git a/bin/cinder-volume b/bin/cinder-volume index 08199f0a2..53f31edcf 100755 --- a/bin/cinder-volume +++ b/bin/cinder-volume @@ -44,7 +44,8 @@ if os.path.exists(os.path.join(possible_topdir, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder.openstack.common import log as logging from cinder import service from cinder import utils diff --git a/bin/cinder-volume-usage-audit b/bin/cinder-volume-usage-audit index 620fde3c9..40e31f1c5 100755 --- a/bin/cinder-volume-usage-audit +++ b/bin/cinder-volume-usage-audit @@ -53,11 +53,11 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'cinder', '__init__.py')): from cinder.openstack.common import gettextutils gettextutils.install('cinder') -from cinder.common import config # Need to register global_opts +# Need to register global_opts +from cinder.common import config # noqa from cinder import context from cinder import db from cinder.openstack.common import log as logging -from cinder.openstack.common import rpc from cinder import utils from cinder import version import cinder.volume.utils diff --git a/cinder/api/contrib/snapshot_actions.py b/cinder/api/contrib/snapshot_actions.py index 527891b5e..eec07f823 100644 --- a/cinder/api/contrib/snapshot_actions.py +++ b/cinder/api/contrib/snapshot_actions.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg import webob from cinder.api import extensions diff --git a/cinder/api/contrib/volume_encryption_metadata.py b/cinder/api/contrib/volume_encryption_metadata.py index e1a6a0535..af309f114 100644 --- a/cinder/api/contrib/volume_encryption_metadata.py +++ b/cinder/api/contrib/volume_encryption_metadata.py @@ -17,14 +17,10 @@ """The volume encryption metadata extension.""" -import webob - from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import db -from cinder import exception -from cinder.openstack.common.notifier import api as notifier_api from cinder.volume import volume_types authorize = extensions.extension_authorizer('volume', diff --git a/cinder/api/openstack/__init__.py b/cinder/api/openstack/__init__.py index 9eb2bdee3..008ff031f 100644 --- a/cinder/api/openstack/__init__.py +++ b/cinder/api/openstack/__init__.py @@ -22,7 +22,6 @@ import routes from cinder.api.openstack import wsgi from cinder.openstack.common import log as logging -from cinder import utils from cinder import wsgi as base_wsgi diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py index 15eaabf20..a994b0961 100644 --- a/cinder/compute/nova.py +++ b/cinder/compute/nova.py @@ -17,7 +17,6 @@ Handles all requests to Nova. """ -from novaclient import extension from novaclient import service_catalog from novaclient.v1_1 import client as nova_client from novaclient.v1_1.contrib import assisted_volume_snapshots diff --git a/cinder/db/sqlalchemy/migrate_repo/manage.py b/cinder/db/sqlalchemy/migrate_repo/manage.py index 826d56f30..ed526c6d0 100644 --- a/cinder/db/sqlalchemy/migrate_repo/manage.py +++ b/cinder/db/sqlalchemy/migrate_repo/manage.py @@ -23,7 +23,6 @@ from cinder.openstack.common import gettextutils gettextutils.install('cinder', lazy=False) from cinder.db.sqlalchemy import migrate_repo -import cinder.openstack.common.db.sqlalchemy.session from cinder import version from migrate.versioning.shell import main diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py b/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py index df4347101..1b9368cc9 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py @@ -19,8 +19,6 @@ from sqlalchemy import Column, ForeignKey, MetaData, Table from sqlalchemy import Boolean, DateTime, Integer, String from cinder.openstack.common import log as logging -from cinder.openstack.common import timeutils -from cinder.openstack.common import uuidutils LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py b/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py index c5fbe73be..76868bf6c 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py @@ -17,7 +17,7 @@ # under the License. from sqlalchemy import Boolean, Column, DateTime -from sqlalchemy import ForeignKey, MetaData, Integer, String, Table +from sqlalchemy import ForeignKey, MetaData, String, Table from cinder.openstack.common import log as logging diff --git a/cinder/exception.py b/cinder/exception.py index 5517aff05..f8f23ee54 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -31,7 +31,6 @@ import webob.exc from cinder.openstack.common.gettextutils import _ from cinder.openstack.common import log as logging -from cinder.openstack.common import processutils LOG = logging.getLogger(__name__) diff --git a/cinder/test.py b/cinder/test.py index 8eb253337..b572b369f 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -24,7 +24,6 @@ inline callbacks. """ -import functools import os import shutil import tempfile @@ -37,7 +36,7 @@ import stubout import testtools from testtools import matchers -from cinder.common import config # Need to register global_opts +from cinder.common import config # noqa Need to register global_opts from cinder.db import migration from cinder.openstack.common.db.sqlalchemy import session from cinder.openstack.common import log as logging diff --git a/cinder/tests/api/contrib/test_snapshot_actions.py b/cinder/tests/api/contrib/test_snapshot_actions.py index f8be77f8b..37b4d1971 100644 --- a/cinder/tests/api/contrib/test_snapshot_actions.py +++ b/cinder/tests/api/contrib/test_snapshot_actions.py @@ -12,19 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -import datetime -import uuid import webob from cinder import db -from cinder import exception from cinder.openstack.common import jsonutils -from cinder.openstack.common.rpc import common as rpc_common from cinder import test from cinder.tests.api import fakes from cinder.tests.api.v2 import stubs -from cinder import volume -from cinder.volume import api as volume_api class SnapshotActionsTest(test.TestCase): diff --git a/cinder/tests/api/contrib/test_volume_type_encryption.py b/cinder/tests/api/contrib/test_volume_type_encryption.py index 058f87b82..cb4cb0937 100644 --- a/cinder/tests/api/contrib/test_volume_type_encryption.py +++ b/cinder/tests/api/contrib/test_volume_type_encryption.py @@ -19,17 +19,13 @@ import json import webob -from xml.dom import minidom -from cinder.api.contrib import volume_type_encryption from cinder import context from cinder import db -from cinder import exception from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common.notifier import test_notifier from cinder import test from cinder.tests.api import fakes -from cinder.volume import volume_types def return_volume_type_encryption_db(context, volume_type_id, session): diff --git a/cinder/tests/backup/fake_service.py b/cinder/tests/backup/fake_service.py index a78d516e6..fa8fac4da 100644 --- a/cinder/tests/backup/fake_service.py +++ b/cinder/tests/backup/fake_service.py @@ -14,7 +14,6 @@ # under the License. from cinder.backup.driver import BackupDriver -from cinder.db import base from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/test_brick_connector.py b/cinder/tests/brick/test_brick_connector.py index ebb12e64e..a7b9b9c37 100644 --- a/cinder/tests/brick/test_brick_connector.py +++ b/cinder/tests/brick/test_brick_connector.py @@ -23,9 +23,6 @@ import mox from cinder.brick import exception from cinder.brick.initiator import connector from cinder.brick.initiator import host_driver -from cinder.brick.initiator import linuxfc -from cinder.brick.initiator import linuxscsi -from cinder.brick.remotefs import remotefs from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.openstack.common import processutils as putils diff --git a/cinder/tests/brick/test_brick_linuxscsi.py b/cinder/tests/brick/test_brick_linuxscsi.py index a2be40d47..5fa80dff0 100644 --- a/cinder/tests/brick/test_brick_linuxscsi.py +++ b/cinder/tests/brick/test_brick_linuxscsi.py @@ -20,7 +20,6 @@ import string from cinder.brick.initiator import linuxscsi from cinder.openstack.common import log as logging from cinder import test -from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/test_brick_remotefs.py b/cinder/tests/brick/test_brick_remotefs.py index 32ae8c447..7f2e95416 100644 --- a/cinder/tests/brick/test_brick_remotefs.py +++ b/cinder/tests/brick/test_brick_remotefs.py @@ -19,7 +19,6 @@ import mox from cinder.brick.remotefs import remotefs from cinder.openstack.common import log as logging -from cinder.openstack.common import processutils as putils from cinder import test LOG = logging.getLogger(__name__) diff --git a/cinder/tests/compute/test_nova.py b/cinder/tests/compute/test_nova.py index 45ee334f4..9f8239a75 100644 --- a/cinder/tests/compute/test_nova.py +++ b/cinder/tests/compute/test_nova.py @@ -14,7 +14,6 @@ from cinder.compute import nova from cinder import context -from cinder import exception from cinder import test diff --git a/cinder/tests/db/test_finish_migration.py b/cinder/tests/db/test_finish_migration.py index 0cb03ac4c..f0b04ac58 100644 --- a/cinder/tests/db/test_finish_migration.py +++ b/cinder/tests/db/test_finish_migration.py @@ -17,7 +17,6 @@ from cinder import context from cinder import db -from cinder import exception from cinder import test from cinder.tests import utils as testutils diff --git a/cinder/tests/fake_utils.py b/cinder/tests/fake_utils.py index fd44d6771..af586b882 100644 --- a/cinder/tests/fake_utils.py +++ b/cinder/tests/fake_utils.py @@ -20,7 +20,6 @@ import re from eventlet import greenthread -from cinder import exception from cinder.openstack.common import log as logging from cinder.openstack.common import processutils from cinder import utils diff --git a/cinder/tests/integrated/test_volumes.py b/cinder/tests/integrated/test_volumes.py index 3de238ec0..92c02196b 100644 --- a/cinder/tests/integrated/test_volumes.py +++ b/cinder/tests/integrated/test_volumes.py @@ -23,7 +23,6 @@ from cinder import service from cinder.tests import fake_driver from cinder.tests.integrated.api import client from cinder.tests.integrated import integrated_helpers -from cinder.volume import driver LOG = logging.getLogger(__name__) diff --git a/cinder/tests/scheduler/fakes.py b/cinder/tests/scheduler/fakes.py index ae1da874d..4abc6f269 100644 --- a/cinder/tests/scheduler/fakes.py +++ b/cinder/tests/scheduler/fakes.py @@ -16,9 +16,6 @@ Fakes For Scheduler tests. """ -import mock - -from cinder import db from cinder.openstack.common import timeutils from cinder.scheduler import filter_scheduler from cinder.scheduler import host_manager diff --git a/cinder/tests/scheduler/test_chance_weigher.py b/cinder/tests/scheduler/test_chance_weigher.py index a115bcf7b..5f7f2a93d 100644 --- a/cinder/tests/scheduler/test_chance_weigher.py +++ b/cinder/tests/scheduler/test_chance_weigher.py @@ -16,7 +16,6 @@ Tests For Chance Weigher. """ import mock -import random from cinder.scheduler import host_manager from cinder.scheduler.weights.chance import ChanceWeigher diff --git a/cinder/tests/scheduler/test_scheduler.py b/cinder/tests/scheduler/test_scheduler.py index fb216295c..0b3ade1fb 100644 --- a/cinder/tests/scheduler/test_scheduler.py +++ b/cinder/tests/scheduler/test_scheduler.py @@ -22,13 +22,10 @@ Tests For Scheduler import mock from cinder import context -from cinder import db from cinder import exception -from cinder.openstack.common import timeutils from cinder.scheduler import driver from cinder.scheduler import manager from cinder import test -from cinder import utils class SchedulerManagerTestCase(test.TestCase): diff --git a/cinder/tests/test_conf.py b/cinder/tests/test_conf.py index cf1906df9..bacef2a8d 100644 --- a/cinder/tests/test_conf.py +++ b/cinder/tests/test_conf.py @@ -48,7 +48,7 @@ class ConfigTestCase(test.TestCase): def test_runtime_and_unknown_conf(self): self.assertNotIn('runtime_answer', CONF) - import cinder.tests.runtime_conf + import cinder.tests.runtime_conf # noqa self.assertIn('runtime_answer', CONF) self.assertEqual(CONF.runtime_answer, 54) diff --git a/cinder/tests/test_create_volume_flow.py b/cinder/tests/test_create_volume_flow.py index c2344a592..50cf7224c 100644 --- a/cinder/tests/test_create_volume_flow.py +++ b/cinder/tests/test_create_volume_flow.py @@ -16,8 +16,6 @@ import time -import mock - from cinder import context from cinder import test from cinder.volume.flows import create_volume diff --git a/cinder/tests/test_exception.py b/cinder/tests/test_exception.py index b5617d5d3..2a22a7a83 100644 --- a/cinder/tests/test_exception.py +++ b/cinder/tests/test_exception.py @@ -18,7 +18,6 @@ from cinder import exception from cinder import test -from cinder import utils class FakeNotifier(object): diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/test_glusterfs.py index e082a8220..565d3363d 100644 --- a/cinder/tests/test_glusterfs.py +++ b/cinder/tests/test_glusterfs.py @@ -17,7 +17,6 @@ """Unit tests for the GlusterFS driver module.""" import errno -import json import os import tempfile @@ -26,7 +25,6 @@ from mox import IgnoreArg from mox import IsA from mox import stubout -from cinder import compute from cinder import context from cinder import db from cinder import exception @@ -34,7 +32,6 @@ from cinder.image import image_utils from cinder.openstack.common import imageutils from cinder.openstack.common import processutils as putils from cinder import test -from cinder.tests.compute import test_nova from cinder import units from cinder import utils from cinder.volume import configuration as conf diff --git a/cinder/tests/test_iscsi.py b/cinder/tests/test_iscsi.py index f190bd525..6d42ac037 100644 --- a/cinder/tests/test_iscsi.py +++ b/cinder/tests/test_iscsi.py @@ -22,7 +22,6 @@ import tempfile from cinder.brick.iscsi import iscsi from cinder import test from cinder.volume import driver -from cinder.volume import utils as volume_utils class TargetAdminTestCase(object): diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index 37040b90d..6534325f0 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -36,7 +36,6 @@ from cinder.volume.drivers.netapp.options import netapp_connection_opts from cinder.volume.drivers.netapp.options import netapp_provisioning_opts from cinder.volume.drivers.netapp.options import netapp_transport_opts from cinder.volume.drivers.netapp import ssc_utils -from cinder.volume.drivers.netapp import utils LOG = logging.getLogger("cinder.volume.driver") diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/test_netapp_nfs.py index a7f3b6841..7105a8fa9 100644 --- a/cinder/tests/test_netapp_nfs.py +++ b/cinder/tests/test_netapp_nfs.py @@ -31,7 +31,6 @@ from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.netapp import api from cinder.volume.drivers.netapp import nfs as netapp_nfs -from cinder.volume.drivers.netapp import ssc_utils from oslo.config import cfg diff --git a/cinder/tests/test_netapp_ssc.py b/cinder/tests/test_netapp_ssc.py index 9d5f0b853..b7de142f9 100644 --- a/cinder/tests/test_netapp_ssc.py +++ b/cinder/tests/test_netapp_ssc.py @@ -20,16 +20,11 @@ import BaseHTTPServer import copy import httplib from lxml import etree -import mox from mox import IgnoreArg -from mox import IsA -from mox import MockObject import StringIO -from cinder import context from cinder import exception from cinder import test -from cinder.volume import configuration as conf from cinder.volume.drivers.netapp import api from cinder.volume.drivers.netapp import ssc_utils diff --git a/cinder/tests/test_nfs.py b/cinder/tests/test_nfs.py index e4c84d7de..353d6d09b 100644 --- a/cinder/tests/test_nfs.py +++ b/cinder/tests/test_nfs.py @@ -16,7 +16,6 @@ # under the License. """Unit tests for the NFS driver module.""" -import __builtin__ import errno import os @@ -29,7 +28,6 @@ from oslo.config import cfg from cinder import context from cinder import exception from cinder.image import image_utils -from cinder.openstack.common import processutils as putils from cinder import test from cinder import units from cinder.volume import configuration as conf diff --git a/cinder/tests/test_sheepdog.py b/cinder/tests/test_sheepdog.py index 793579884..052b7fe95 100644 --- a/cinder/tests/test_sheepdog.py +++ b/cinder/tests/test_sheepdog.py @@ -20,7 +20,6 @@ import contextlib import os import tempfile -from cinder import exception from cinder.image import image_utils from cinder.openstack.common import processutils from cinder import test diff --git a/cinder/tests/test_storwize_svc.py b/cinder/tests/test_storwize_svc.py index 5ed244d86..07d6b5768 100644 --- a/cinder/tests/test_storwize_svc.py +++ b/cinder/tests/test_storwize_svc.py @@ -25,7 +25,6 @@ Tests for the IBM Storwize family and SVC volume driver. import random import re -import socket from cinder import context from cinder import exception diff --git a/cinder/tests/test_wsgi.py b/cinder/tests/test_wsgi.py index ba7f15d16..8b7545c54 100644 --- a/cinder/tests/test_wsgi.py +++ b/cinder/tests/test_wsgi.py @@ -20,7 +20,6 @@ import mock import os.path -import ssl import tempfile import urllib2 @@ -32,7 +31,6 @@ import webob.dec from cinder import exception from cinder.openstack.common import gettextutils from cinder import test -from cinder import utils import cinder.wsgi CONF = cfg.CONF diff --git a/cinder/tests/test_zadara.py b/cinder/tests/test_zadara.py index f604d5c29..379342a70 100644 --- a/cinder/tests/test_zadara.py +++ b/cinder/tests/test_zadara.py @@ -21,7 +21,6 @@ Tests for Zadara VPSA volume driver import copy import httplib -import mox from cinder import exception from cinder.openstack.common import log as logging diff --git a/cinder/tests/utils.py b/cinder/tests/utils.py index 7a2dcf4c0..b6fdf69f0 100644 --- a/cinder/tests/utils.py +++ b/cinder/tests/utils.py @@ -16,8 +16,6 @@ # -import os - from cinder import context from cinder import db diff --git a/cinder/utils.py b/cinder/utils.py index 265235843..c9ee4d427 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -33,7 +33,6 @@ import shutil import stat import sys import tempfile -import time from eventlet import event from eventlet import greenthread @@ -48,8 +47,6 @@ from xml.sax import saxutils from cinder.brick.initiator import connector from cinder import exception -from cinder.openstack.common import excutils -from cinder.openstack.common import gettextutils from cinder.openstack.common import importutils from cinder.openstack.common import lockutils from cinder.openstack.common import log as logging diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 65aab9666..b430aac06 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -20,7 +20,6 @@ Drivers for volumes. """ -import os import time from oslo.config import cfg diff --git a/cinder/volume/drivers/gpfs.py b/cinder/volume/drivers/gpfs.py index 97cdafd91..0ec6df0a5 100644 --- a/cinder/volume/drivers/gpfs.py +++ b/cinder/volume/drivers/gpfs.py @@ -27,7 +27,6 @@ from oslo.config import cfg from cinder import exception from cinder.image import image_utils -from cinder.openstack.common import fileutils from cinder.openstack.common import log as logging from cinder.openstack.common import processutils from cinder import units diff --git a/cinder/volume/drivers/huawei/__init__.py b/cinder/volume/drivers/huawei/__init__.py index f4d1b8a98..2d923ceba 100644 --- a/cinder/volume/drivers/huawei/__init__.py +++ b/cinder/volume/drivers/huawei/__init__.py @@ -25,8 +25,6 @@ from oslo.config import cfg from cinder import exception from cinder.openstack.common import log as logging -from cinder.volume.configuration import Configuration -from cinder.volume import driver from cinder.volume.drivers.huawei import huawei_dorado from cinder.volume.drivers.huawei import huawei_hvs from cinder.volume.drivers.huawei import huawei_t diff --git a/cinder/volume/drivers/huawei/huawei_utils.py b/cinder/volume/drivers/huawei/huawei_utils.py index 38a338384..97c3aa82d 100644 --- a/cinder/volume/drivers/huawei/huawei_utils.py +++ b/cinder/volume/drivers/huawei/huawei_utils.py @@ -18,7 +18,6 @@ from xml.etree import ElementTree as ET -from cinder import exception from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/san/__init__.py b/cinder/volume/drivers/san/__init__.py index cc1ac69f7..bfc9cda66 100644 --- a/cinder/volume/drivers/san/__init__.py +++ b/cinder/volume/drivers/san/__init__.py @@ -22,6 +22,6 @@ """ # Adding imports for backwards compatibility in loading volume_driver. -from hp_lefthand import HpSanISCSIDriver -from san import SanISCSIDriver -from solaris import SolarisISCSIDriver +from hp_lefthand import HpSanISCSIDriver # noqa +from san import SanISCSIDriver # noqa +from solaris import SolarisISCSIDriver # noqa diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index fa7444f04..8da5e5269 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -44,7 +44,6 @@ import json import pprint from random import randint import re -import time import uuid from eventlet import greenthread @@ -52,7 +51,6 @@ import hp3parclient from hp3parclient import client from hp3parclient import exceptions as hpexceptions from oslo.config import cfg -import paramiko from cinder import context from cinder import exception diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 4e11be05d..e404f998d 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -32,9 +32,7 @@ volume_driver=cinder.volume.drivers.san.hp.hp_3par_fc.HP3PARFCDriver """ from hp3parclient import exceptions as hpexceptions -from oslo.config import cfg -from cinder import exception from cinder.openstack.common import log as logging from cinder import utils import cinder.volume.driver diff --git a/cinder/volume/utils.py b/cinder/volume/utils.py index 0014d4009..1e06a5853 100644 --- a/cinder/volume/utils.py +++ b/cinder/volume/utils.py @@ -18,13 +18,10 @@ import math -import os -import stat from oslo.config import cfg from cinder.brick.local_dev import lvm as brick_lvm -from cinder import exception from cinder.openstack.common import log as logging from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common import processutils diff --git a/tox.ini b/tox.ini index d69583058..8124779c9 100644 --- a/tox.ini +++ b/tox.ini @@ -43,6 +43,6 @@ commands = commands = {posargs} [flake8] -ignore = E711,E712,F401,F403,F841,H302,H303,H304,H803 +ignore = E711,E712,F403,F841,H302,H303,H304,H803 builtins = _ -exclude = .git,.venv,.tox,dist,doc,common,*egg,build +exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build