From db592705d996ddc0e353c13d0e1e0e62262f8df9 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Wed, 7 Nov 2012 15:56:33 +0800 Subject: [PATCH] Import order cleanup per HACKING Change-Id: I5540a5d24f45aa51e0ef58b43427fbaf7726da89 --- cinder/api/auth.py | 2 +- cinder/api/openstack/__init__.py | 2 +- cinder/api/openstack/common.py | 2 +- cinder/api/openstack/extensions.py | 2 +- cinder/api/openstack/urlmap.py | 2 +- cinder/api/openstack/volume/__init__.py | 2 +- .../api/openstack/volume/contrib/__init__.py | 2 +- .../openstack/volume/contrib/admin_actions.py | 2 +- .../contrib/extended_snapshot_attributes.py | 2 +- .../volume/contrib/volume_actions.py | 2 +- cinder/api/openstack/volume/snapshots.py | 4 ++-- cinder/api/openstack/volume/types.py | 2 +- cinder/api/openstack/volume/volumes.py | 2 +- cinder/api/openstack/wsgi.py | 4 ++-- cinder/context.py | 2 +- cinder/db/sqlalchemy/api.py | 22 ++++++++++--------- cinder/db/sqlalchemy/models.py | 4 ++-- cinder/db/sqlalchemy/session.py | 2 +- cinder/openstack/common/rpc/impl_kombu.py | 2 +- cinder/scheduler/driver.py | 2 +- cinder/service.py | 2 +- cinder/test.py | 4 ++-- cinder/testing/runner.py | 2 +- cinder/tests/api/openstack/fakes.py | 4 ++-- cinder/tests/api/openstack/test_common.py | 2 +- cinder/tests/api/openstack/test_faults.py | 2 +- cinder/tests/api/openstack/test_wsgi.py | 2 +- cinder/tests/api/openstack/test_xmlutil.py | 2 +- .../volume/contrib/test_admin_actions.py | 4 ++-- .../volume/contrib/test_types_manage.py | 2 +- .../volume/contrib/test_volume_actions.py | 8 +++---- .../contrib/test_volume_host_attribute.py | 4 ++-- .../contrib/test_volume_tenant_attribute.py | 4 ++-- .../api/openstack/volume/test_snapshots.py | 2 +- .../tests/api/openstack/volume/test_types.py | 4 ++-- .../api/openstack/volume/test_volumes.py | 2 +- cinder/tests/integrated/api/client.py | 2 +- cinder/tests/integrated/test_volumes.py | 6 ++--- cinder/tests/integrated/test_xml.py | 2 +- cinder/tests/test_exception.py | 2 +- cinder/tests/test_migrations.py | 4 ++-- cinder/tests/test_netapp_nfs.py | 6 ++--- cinder/tests/test_nexenta.py | 2 +- cinder/tests/test_nfs.py | 8 +++---- cinder/tests/test_service.py | 4 ++-- cinder/tests/test_volume.py | 8 +++---- cinder/tests/test_volume_types.py | 6 ++--- cinder/tests/test_volume_utils.py | 6 ++--- cinder/tests/test_windows.py | 2 +- cinder/tests/test_wsgi.py | 2 +- cinder/tests/test_zadara.py | 2 +- cinder/tests/windows/basetestcase.py | 2 +- cinder/utils.py | 4 ++-- cinder/volume/api.py | 4 ++-- cinder/volume/driver.py | 2 +- cinder/volume/drivers/rbd.py | 2 +- cinder/volume/manager.py | 2 +- cinder/volume/netapp.py | 2 +- cinder/volume/netapp_nfs.py | 4 ++-- cinder/volume/nexenta/jsonrpc.py | 2 +- cinder/volume/nexenta/volume.py | 2 +- cinder/volume/nfs.py | 4 ++-- cinder/volume/san/__init__.py | 2 +- cinder/volume/san/san.py | 2 +- cinder/volume/utils.py | 4 ++-- cinder/volume/zadara.py | 2 +- 66 files changed, 110 insertions(+), 108 deletions(-) mode change 100644 => 100755 cinder/testing/runner.py mode change 100644 => 100755 cinder/tests/integrated/test_volumes.py diff --git a/cinder/api/auth.py b/cinder/api/auth.py index 9930b7352..cea6c60c5 100644 --- a/cinder/api/auth.py +++ b/cinder/api/auth.py @@ -23,8 +23,8 @@ import webob.exc from cinder import context from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder import wsgi diff --git a/cinder/api/openstack/__init__.py b/cinder/api/openstack/__init__.py index 117babd98..9f6079dd3 100644 --- a/cinder/api/openstack/__init__.py +++ b/cinder/api/openstack/__init__.py @@ -24,9 +24,9 @@ import routes import webob.dec import webob.exc -from cinder import utils 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/api/openstack/common.py b/cinder/api/openstack/common.py index 255a0a743..465269cd5 100644 --- a/cinder/api/openstack/common.py +++ b/cinder/api/openstack/common.py @@ -21,9 +21,9 @@ import urlparse import webob -from cinder import flags from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil +from cinder import flags from cinder.openstack.common import log as logging diff --git a/cinder/api/openstack/extensions.py b/cinder/api/openstack/extensions.py index a615f2a08..718607b94 100644 --- a/cinder/api/openstack/extensions.py +++ b/cinder/api/openstack/extensions.py @@ -26,9 +26,9 @@ from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import exception as common_exception from cinder.openstack.common import importutils +from cinder.openstack.common import log as logging import cinder.policy diff --git a/cinder/api/openstack/urlmap.py b/cinder/api/openstack/urlmap.py index 52b729860..894d36cb8 100644 --- a/cinder/api/openstack/urlmap.py +++ b/cinder/api/openstack/urlmap.py @@ -19,8 +19,8 @@ import paste.urlmap import re import urllib2 -from cinder.openstack.common import log as logging from cinder.api.openstack import wsgi +from cinder.openstack.common import log as logging _quoted_string_re = r'"[^"\\]*(?:\\.[^"\\]*)*"' diff --git a/cinder/api/openstack/volume/__init__.py b/cinder/api/openstack/volume/__init__.py index 9a9945100..8f5095597 100644 --- a/cinder/api/openstack/volume/__init__.py +++ b/cinder/api/openstack/volume/__init__.py @@ -25,8 +25,8 @@ from cinder.api.openstack.volume import extensions from cinder.api.openstack.volume import limits from cinder.api.openstack.volume import snapshots from cinder.api.openstack.volume import types -from cinder.api.openstack.volume import volumes from cinder.api.openstack.volume import versions +from cinder.api.openstack.volume import volumes from cinder.openstack.common import log as logging diff --git a/cinder/api/openstack/volume/contrib/__init__.py b/cinder/api/openstack/volume/contrib/__init__.py index 33b312f97..7672a74a8 100644 --- a/cinder/api/openstack/volume/contrib/__init__.py +++ b/cinder/api/openstack/volume/contrib/__init__.py @@ -21,9 +21,9 @@ It can't be called 'extensions' because that causes namespacing problems. """ +from cinder.api.openstack import extensions from cinder import flags from cinder.openstack.common import log as logging -from cinder.api.openstack import extensions FLAGS = flags.FLAGS diff --git a/cinder/api/openstack/volume/contrib/admin_actions.py b/cinder/api/openstack/volume/contrib/admin_actions.py index c427f3e45..2794b11a1 100644 --- a/cinder/api/openstack/volume/contrib/admin_actions.py +++ b/cinder/api/openstack/volume/contrib/admin_actions.py @@ -19,8 +19,8 @@ from cinder.api.openstack import extensions from cinder.api.openstack import wsgi from cinder import db from cinder import exception -from cinder import volume from cinder.openstack.common import log as logging +from cinder import volume LOG = logging.getLogger(__name__) diff --git a/cinder/api/openstack/volume/contrib/extended_snapshot_attributes.py b/cinder/api/openstack/volume/contrib/extended_snapshot_attributes.py index 348ca510a..3b9f8cd2b 100644 --- a/cinder/api/openstack/volume/contrib/extended_snapshot_attributes.py +++ b/cinder/api/openstack/volume/contrib/extended_snapshot_attributes.py @@ -19,10 +19,10 @@ from webob import exc from cinder.api.openstack import extensions from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil -from cinder import volume from cinder import exception from cinder import flags from cinder.openstack.common import log as logging +from cinder import volume FLAGS = flags.FLAGS diff --git a/cinder/api/openstack/volume/contrib/volume_actions.py b/cinder/api/openstack/volume/contrib/volume_actions.py index 5c6276646..e0882e9b2 100644 --- a/cinder/api/openstack/volume/contrib/volume_actions.py +++ b/cinder/api/openstack/volume/contrib/volume_actions.py @@ -18,11 +18,11 @@ from xml.dom import minidom from cinder.api.openstack import extensions from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil -from cinder import volume from cinder import exception from cinder import flags from cinder.openstack.common import log as logging from cinder.openstack.common.rpc import common as rpc_common +from cinder import volume FLAGS = flags.FLAGS diff --git a/cinder/api/openstack/volume/snapshots.py b/cinder/api/openstack/volume/snapshots.py index 59d26a6e0..bf12d30a3 100644 --- a/cinder/api/openstack/volume/snapshots.py +++ b/cinder/api/openstack/volume/snapshots.py @@ -15,13 +15,13 @@ """The volumes snapshots api.""" -from webob import exc import webob +from webob import exc from cinder.api.openstack import common +from cinder.api.openstack.volume import volumes from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil -from cinder.api.openstack.volume import volumes from cinder import exception from cinder import flags from cinder.openstack.common import log as logging diff --git a/cinder/api/openstack/volume/types.py b/cinder/api/openstack/volume/types.py index 2a9bd364a..467c22c87 100644 --- a/cinder/api/openstack/volume/types.py +++ b/cinder/api/openstack/volume/types.py @@ -19,9 +19,9 @@ from webob import exc +from cinder.api.openstack.volume.views import types as views_types from cinder.api.openstack import wsgi from cinder.api.openstack import xmlutil -from cinder.api.openstack.volume.views import types as views_types from cinder import exception from cinder.volume import volume_types diff --git a/cinder/api/openstack/volume/volumes.py b/cinder/api/openstack/volume/volumes.py index f283fd8fa..20208a16e 100644 --- a/cinder/api/openstack/volume/volumes.py +++ b/cinder/api/openstack/volume/volumes.py @@ -15,8 +15,8 @@ """The volumes api.""" -from webob import exc import webob +from webob import exc from xml.dom import minidom from cinder.api.openstack import common diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index 9bfc8b061..e38a85cd4 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -21,9 +21,9 @@ import time import webob from cinder import exception -from cinder import wsgi -from cinder.openstack.common import log as logging from cinder.openstack.common import jsonutils +from cinder.openstack.common import log as logging +from cinder import wsgi from lxml import etree from xml.dom import minidom diff --git a/cinder/context.py b/cinder/context.py index a257f0a70..fc80f53ed 100644 --- a/cinder/context.py +++ b/cinder/context.py @@ -21,8 +21,8 @@ import copy -from cinder.openstack.common import log as logging from cinder.openstack.common import local +from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils from cinder import policy from cinder import utils diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index f490978f5..8dd3abc28 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -23,15 +23,6 @@ import datetime import functools import warnings -from cinder import db -from cinder import exception -from cinder import flags -from cinder import utils -from cinder.openstack.common import log as logging -from cinder.db.sqlalchemy import models -from cinder.db.sqlalchemy.session import get_session -from cinder.openstack.common import timeutils -from cinder.openstack.common import uuidutils from sqlalchemy.exc import IntegrityError from sqlalchemy import or_ from sqlalchemy.orm import joinedload @@ -39,8 +30,19 @@ from sqlalchemy.orm import joinedload_all from sqlalchemy.sql.expression import asc from sqlalchemy.sql.expression import desc from sqlalchemy.sql.expression import literal_column -from sqlalchemy.sql import func from sqlalchemy.sql.expression import literal_column +from sqlalchemy.sql import func + +from cinder import db +from cinder.db.sqlalchemy import models +from cinder.db.sqlalchemy.session import get_session +from cinder import exception +from cinder import flags +from cinder.openstack.common import log as logging +from cinder.openstack.common import timeutils +from cinder.openstack.common import uuidutils +from cinder import utils + FLAGS = flags.FLAGS diff --git a/cinder/db/sqlalchemy/models.py b/cinder/db/sqlalchemy/models.py index ae2a6f51f..b053e284d 100644 --- a/cinder/db/sqlalchemy/models.py +++ b/cinder/db/sqlalchemy/models.py @@ -21,11 +21,11 @@ SQLAlchemy models for cinder data. """ -from sqlalchemy.orm import relationship, backref, object_mapper from sqlalchemy import Column, Integer, String, schema -from sqlalchemy import ForeignKey, DateTime, Boolean from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy import ForeignKey, DateTime, Boolean +from sqlalchemy.orm import relationship, backref, object_mapper from cinder.db.sqlalchemy.session import get_session diff --git a/cinder/db/sqlalchemy/session.py b/cinder/db/sqlalchemy/session.py index ef94c4b2b..26b02299d 100644 --- a/cinder/db/sqlalchemy/session.py +++ b/cinder/db/sqlalchemy/session.py @@ -20,9 +20,9 @@ import time +from sqlalchemy.exc import DisconnectionError, OperationalError import sqlalchemy.interfaces import sqlalchemy.orm -from sqlalchemy.exc import DisconnectionError, OperationalError from sqlalchemy.pool import NullPool, StaticPool import cinder.exception diff --git a/cinder/openstack/common/rpc/impl_kombu.py b/cinder/openstack/common/rpc/impl_kombu.py index 01f67defd..f3759cb21 100644 --- a/cinder/openstack/common/rpc/impl_kombu.py +++ b/cinder/openstack/common/rpc/impl_kombu.py @@ -31,9 +31,9 @@ import kombu.messaging from cinder.openstack.common import cfg from cinder.openstack.common.gettextutils import _ +from cinder.openstack.common import network_utils from cinder.openstack.common.rpc import amqp as rpc_amqp from cinder.openstack.common.rpc import common as rpc_common -from cinder.openstack.common import network_utils kombu_opts = [ cfg.StrOpt('kombu_ssl_version', diff --git a/cinder/scheduler/driver.py b/cinder/scheduler/driver.py index a4e545c3f..9f5646dd9 100644 --- a/cinder/scheduler/driver.py +++ b/cinder/scheduler/driver.py @@ -23,9 +23,9 @@ Scheduler base class that all Schedulers should inherit from from cinder import db from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg from cinder.openstack.common import importutils +from cinder.openstack.common import log as logging from cinder.openstack.common import rpc from cinder.openstack.common import timeutils from cinder import utils diff --git a/cinder/service.py b/cinder/service.py index ecbea86e5..6f0ac4b82 100644 --- a/cinder/service.py +++ b/cinder/service.py @@ -31,9 +31,9 @@ from cinder import context from cinder import db from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg from cinder.openstack.common import importutils +from cinder.openstack.common import log as logging from cinder.openstack.common import rpc from cinder import utils from cinder import version diff --git a/cinder/test.py b/cinder/test.py index dd111e9d9..e6a81bbe5 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -24,16 +24,16 @@ inline callbacks. """ import functools -import uuid import unittest +import uuid import mox import nose.plugins.skip import stubout from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils from cinder import service from cinder import tests diff --git a/cinder/testing/runner.py b/cinder/testing/runner.py old mode 100644 new mode 100755 index d92179f25..23661ec2d --- a/cinder/testing/runner.py +++ b/cinder/testing/runner.py @@ -59,9 +59,9 @@ To run a single test: import gettext import heapq import os -import unittest import sys import time +import unittest import eventlet from nose import config diff --git a/cinder/tests/api/openstack/fakes.py b/cinder/tests/api/openstack/fakes.py index b85553397..81d6148a4 100644 --- a/cinder/tests/api/openstack/fakes.py +++ b/cinder/tests/api/openstack/fakes.py @@ -25,16 +25,16 @@ import webob.request from cinder.api import auth as api_auth from cinder.api import openstack as openstack_api from cinder.api.openstack import auth -from cinder.api.openstack.volume import limits from cinder.api.openstack import urlmap from cinder.api.openstack import volume +from cinder.api.openstack.volume import limits from cinder.api.openstack.volume import versions from cinder.api.openstack import wsgi as os_wsgi from cinder import context from cinder import exception as exc +from cinder.openstack.common import timeutils from cinder import utils from cinder import wsgi -from cinder.openstack.common import timeutils FAKE_UUID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' diff --git a/cinder/tests/api/openstack/test_common.py b/cinder/tests/api/openstack/test_common.py index 374937db3..b9b1c1015 100644 --- a/cinder/tests/api/openstack/test_common.py +++ b/cinder/tests/api/openstack/test_common.py @@ -22,8 +22,8 @@ Test suites for 'common' code used throughout the OpenStack HTTP API. import webob import webob.exc -from cinder import test from cinder.api.openstack import common +from cinder import test NS = "{http://docs.openstack.org/compute/api/v1.1}" diff --git a/cinder/tests/api/openstack/test_faults.py b/cinder/tests/api/openstack/test_faults.py index 33f830005..9c874c8f0 100644 --- a/cinder/tests/api/openstack/test_faults.py +++ b/cinder/tests/api/openstack/test_faults.py @@ -21,10 +21,10 @@ import webob import webob.dec import webob.exc -from cinder import test from cinder.api.openstack import common from cinder.api.openstack import wsgi from cinder.openstack.common import jsonutils +from cinder import test class TestFaults(test.TestCase): diff --git a/cinder/tests/api/openstack/test_wsgi.py b/cinder/tests/api/openstack/test_wsgi.py index 8792984f9..83248de94 100644 --- a/cinder/tests/api/openstack/test_wsgi.py +++ b/cinder/tests/api/openstack/test_wsgi.py @@ -3,9 +3,9 @@ import inspect import webob +from cinder.api.openstack import wsgi from cinder import exception from cinder import test -from cinder.api.openstack import wsgi from cinder.tests.api.openstack import fakes diff --git a/cinder/tests/api/openstack/test_xmlutil.py b/cinder/tests/api/openstack/test_xmlutil.py index 7f2a26044..2c1ab0fb4 100644 --- a/cinder/tests/api/openstack/test_xmlutil.py +++ b/cinder/tests/api/openstack/test_xmlutil.py @@ -17,8 +17,8 @@ from lxml import etree -from cinder import test from cinder.api.openstack import xmlutil +from cinder import test class SelectorTest(test.TestCase): diff --git a/cinder/tests/api/openstack/volume/contrib/test_admin_actions.py b/cinder/tests/api/openstack/volume/contrib/test_admin_actions.py index e8fcc688d..3494e62cf 100644 --- a/cinder/tests/api/openstack/volume/contrib/test_admin_actions.py +++ b/cinder/tests/api/openstack/volume/contrib/test_admin_actions.py @@ -3,10 +3,10 @@ import webob from cinder import context from cinder import db from cinder import exception -from cinder import test -from cinder.volume import api as volume_api from cinder.openstack.common import jsonutils +from cinder import test from cinder.tests.api.openstack import fakes +from cinder.volume import api as volume_api def app(): diff --git a/cinder/tests/api/openstack/volume/contrib/test_types_manage.py b/cinder/tests/api/openstack/volume/contrib/test_types_manage.py index c2ee34989..ddba008d7 100644 --- a/cinder/tests/api/openstack/volume/contrib/test_types_manage.py +++ b/cinder/tests/api/openstack/volume/contrib/test_types_manage.py @@ -18,8 +18,8 @@ import webob from cinder.api.openstack.volume.contrib import types_manage from cinder import exception from cinder import test -from cinder.volume import volume_types from cinder.tests.api.openstack import fakes +from cinder.volume import volume_types def stub_volume_type(id): diff --git a/cinder/tests/api/openstack/volume/contrib/test_volume_actions.py b/cinder/tests/api/openstack/volume/contrib/test_volume_actions.py index 2448c9f37..227680dab 100644 --- a/cinder/tests/api/openstack/volume/contrib/test_volume_actions.py +++ b/cinder/tests/api/openstack/volume/contrib/test_volume_actions.py @@ -15,15 +15,15 @@ import datetime import webob +from cinder.api.openstack.volume.contrib import volume_actions from cinder import exception from cinder import flags -from cinder import test -from cinder import utils -from cinder import volume -from cinder.api.openstack.volume.contrib import volume_actions from cinder.openstack.common import jsonutils from cinder.openstack.common.rpc import common as rpc_common +from cinder import test from cinder.tests.api.openstack import fakes +from cinder import utils +from cinder import volume from cinder.volume import api as volume_api diff --git a/cinder/tests/api/openstack/volume/contrib/test_volume_host_attribute.py b/cinder/tests/api/openstack/volume/contrib/test_volume_host_attribute.py index 2acec1033..2ce957b44 100644 --- a/cinder/tests/api/openstack/volume/contrib/test_volume_host_attribute.py +++ b/cinder/tests/api/openstack/volume/contrib/test_volume_host_attribute.py @@ -12,17 +12,17 @@ # License for the specific language governing permissions and limitations # under the License. -import json import datetime +import json from lxml import etree import webob from cinder import context from cinder import test +from cinder.tests.api.openstack import fakes from cinder import utils from cinder import volume -from cinder.tests.api.openstack import fakes def fake_volume_get(*args, **kwargs): diff --git a/cinder/tests/api/openstack/volume/contrib/test_volume_tenant_attribute.py b/cinder/tests/api/openstack/volume/contrib/test_volume_tenant_attribute.py index 5949b21d8..f34288880 100644 --- a/cinder/tests/api/openstack/volume/contrib/test_volume_tenant_attribute.py +++ b/cinder/tests/api/openstack/volume/contrib/test_volume_tenant_attribute.py @@ -12,17 +12,17 @@ # License for the specific language governing permissions and limitations # under the License. -import json import datetime +import json from lxml import etree import webob from cinder import context from cinder import test +from cinder.tests.api.openstack import fakes from cinder import utils from cinder import volume -from cinder.tests.api.openstack import fakes PROJECT_ID = '88fd1da4-f464-4a87-9ce5-26f2f40743b9' diff --git a/cinder/tests/api/openstack/volume/test_snapshots.py b/cinder/tests/api/openstack/volume/test_snapshots.py index 6e32ea14e..6d115d8ea 100644 --- a/cinder/tests/api/openstack/volume/test_snapshots.py +++ b/cinder/tests/api/openstack/volume/test_snapshots.py @@ -24,8 +24,8 @@ from cinder import exception from cinder import flags from cinder.openstack.common import log as logging from cinder import test -from cinder import volume from cinder.tests.api.openstack import fakes +from cinder import volume FLAGS = flags.FLAGS diff --git a/cinder/tests/api/openstack/volume/test_types.py b/cinder/tests/api/openstack/volume/test_types.py index 2ad26de2e..52380928e 100644 --- a/cinder/tests/api/openstack/volume/test_types.py +++ b/cinder/tests/api/openstack/volume/test_types.py @@ -16,13 +16,13 @@ from lxml import etree import webob -from cinder.api.openstack.volume.views import types as views_types from cinder.api.openstack.volume import types +from cinder.api.openstack.volume.views import types as views_types from cinder import exception from cinder.openstack.common import timeutils from cinder import test -from cinder.volume import volume_types from cinder.tests.api.openstack import fakes +from cinder.volume import volume_types def stub_volume_type(id): diff --git a/cinder/tests/api/openstack/volume/test_volumes.py b/cinder/tests/api/openstack/volume/test_volumes.py index 8764bf070..851e599bd 100644 --- a/cinder/tests/api/openstack/volume/test_volumes.py +++ b/cinder/tests/api/openstack/volume/test_volumes.py @@ -18,10 +18,10 @@ import datetime from lxml import etree import webob +from cinder.api.openstack.volume import extensions from cinder.api.openstack.volume import volumes from cinder import context from cinder import db -from cinder.api.openstack.volume import extensions from cinder import exception from cinder import flags from cinder import test diff --git a/cinder/tests/integrated/api/client.py b/cinder/tests/integrated/api/client.py index 7a7e5a931..793101fd9 100644 --- a/cinder/tests/integrated/api/client.py +++ b/cinder/tests/integrated/api/client.py @@ -17,8 +17,8 @@ import httplib import urlparse -from cinder.openstack.common import log as logging from cinder.openstack.common import jsonutils +from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/integrated/test_volumes.py b/cinder/tests/integrated/test_volumes.py old mode 100644 new mode 100755 index e08b9adad..88828208c --- a/cinder/tests/integrated/test_volumes.py +++ b/cinder/tests/integrated/test_volumes.py @@ -18,11 +18,11 @@ import time import unittest -from cinder import service from cinder.openstack.common import log as logging -from cinder.tests.integrated import integrated_helpers -from cinder.tests.integrated.api import client +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 diff --git a/cinder/tests/integrated/test_xml.py b/cinder/tests/integrated/test_xml.py index 52da4c96c..fb579d3f1 100644 --- a/cinder/tests/integrated/test_xml.py +++ b/cinder/tests/integrated/test_xml.py @@ -17,9 +17,9 @@ from lxml import etree +from cinder.api.openstack import common from cinder.openstack.common import log as logging from cinder.tests.integrated import integrated_helpers -from cinder.api.openstack import common LOG = logging.getLogger(__name__) diff --git a/cinder/tests/test_exception.py b/cinder/tests/test_exception.py index f87a71cef..2119297a4 100644 --- a/cinder/tests/test_exception.py +++ b/cinder/tests/test_exception.py @@ -16,8 +16,8 @@ # License for the specific language governing permissions and limitations # under the License. -from cinder import test from cinder import exception +from cinder import test from cinder import utils diff --git a/cinder/tests/test_migrations.py b/cinder/tests/test_migrations.py index 913baae59..5c160f799 100644 --- a/cinder/tests/test_migrations.py +++ b/cinder/tests/test_migrations.py @@ -24,16 +24,16 @@ properly both upgrading and downgrading, and that no data loss occurs if possible. """ -import ConfigParser import commands +import ConfigParser import os import urlparse from migrate.versioning import repository import sqlalchemy -import cinder.db.sqlalchemy.migrate_repo import cinder.db.migration as migration +import cinder.db.sqlalchemy.migrate_repo from cinder.db.sqlalchemy.migration import versioning_api as migration_api from cinder.openstack.common import log as logging from cinder import test diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/test_netapp_nfs.py index 1ebd842cf..939c7b720 100644 --- a/cinder/tests/test_netapp_nfs.py +++ b/cinder/tests/test_netapp_nfs.py @@ -17,14 +17,14 @@ """Unit tests for the NetApp-specific NFS driver module (netapp_nfs)""" from cinder import context -from cinder import test from cinder import exception +from cinder import test -from cinder.volume import netapp_nfs from cinder.volume import netapp +from cinder.volume import netapp_nfs from cinder.volume import nfs -from mox import IsA from mox import IgnoreArg +from mox import IsA from mox import MockObject import mox diff --git a/cinder/tests/test_nexenta.py b/cinder/tests/test_nexenta.py index 5a33318b1..1ed8e194a 100644 --- a/cinder/tests/test_nexenta.py +++ b/cinder/tests/test_nexenta.py @@ -25,8 +25,8 @@ import urllib2 import cinder.flags import cinder.test from cinder.volume import nexenta -from cinder.volume.nexenta import volume from cinder.volume.nexenta import jsonrpc +from cinder.volume.nexenta import volume FLAGS = cinder.flags.FLAGS diff --git a/cinder/tests/test_nfs.py b/cinder/tests/test_nfs.py index 402d84b06..f042b1a9f 100644 --- a/cinder/tests/test_nfs.py +++ b/cinder/tests/test_nfs.py @@ -16,19 +16,19 @@ # under the License. """Unit tests for the NFS driver module""" -import os -import errno import __builtin__ +import errno +import os import mox as mox_lib -from mox import IsA from mox import IgnoreArg +from mox import IsA from mox import stubout from cinder import context from cinder import exception -from cinder import test from cinder.exception import ProcessExecutionError +from cinder import test from cinder.volume import nfs diff --git a/cinder/tests/test_service.py b/cinder/tests/test_service.py index 38b0c3922..4bda2beee 100644 --- a/cinder/tests/test_service.py +++ b/cinder/tests/test_service.py @@ -26,10 +26,10 @@ from cinder import context from cinder import db from cinder import exception from cinder import flags +from cinder import manager from cinder.openstack.common import cfg -from cinder import test from cinder import service -from cinder import manager +from cinder import test from cinder import wsgi diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index bb848d8d4..2b1231330 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -20,18 +20,17 @@ Tests for Volume Code. """ -import os import datetime +import os import mox import shutil import tempfile from cinder import context -from cinder import exception from cinder import db +from cinder import exception from cinder import flags -from cinder.tests.image import fake as fake_image from cinder.openstack.common import importutils from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common.notifier import test_notifier @@ -39,8 +38,9 @@ from cinder.openstack.common import rpc import cinder.policy from cinder import quota from cinder import test -from cinder.volume import iscsi from cinder.tests import fake_flags +from cinder.tests.image import fake as fake_image +from cinder.volume import iscsi QUOTAS = quota.QUOTAS FLAGS = flags.FLAGS diff --git a/cinder/tests/test_volume_types.py b/cinder/tests/test_volume_types.py index 847ff8814..db61bf925 100644 --- a/cinder/tests/test_volume_types.py +++ b/cinder/tests/test_volume_types.py @@ -19,14 +19,14 @@ Unit Tests for volume types code import time from cinder import context +from cinder.db.sqlalchemy import models +from cinder.db.sqlalchemy import session as sql_session from cinder import exception from cinder import flags from cinder.openstack.common import log as logging from cinder import test -from cinder.volume import volume_types -from cinder.db.sqlalchemy import session as sql_session -from cinder.db.sqlalchemy import models from cinder.tests import fake_flags +from cinder.volume import volume_types FLAGS = flags.FLAGS LOG = logging.getLogger(__name__) diff --git a/cinder/tests/test_volume_utils.py b/cinder/tests/test_volume_utils.py index 3a644d34b..9691a5dcc 100644 --- a/cinder/tests/test_volume_utils.py +++ b/cinder/tests/test_volume_utils.py @@ -17,15 +17,15 @@ """Tests For miscellaneous util methods used with volume.""" +from cinder import context from cinder import db from cinder import flags -from cinder import context -from cinder import test -from cinder.volume import utils as volume_utils from cinder.openstack.common import importutils from cinder.openstack.common import log as logging from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common.notifier import test_notifier +from cinder import test +from cinder.volume import utils as volume_utils LOG = logging.getLogger(__name__) diff --git a/cinder/tests/test_windows.py b/cinder/tests/test_windows.py index 1b1bfcbb0..c125fdd15 100644 --- a/cinder/tests/test_windows.py +++ b/cinder/tests/test_windows.py @@ -21,10 +21,10 @@ Unit tests for Windows Server 2012 OpenStack Cinder volume driver import sys import cinder.flags -from cinder.volume import windows from cinder.tests.windows import basetestcase from cinder.tests.windows import db_fakes from cinder.tests.windows import windowsutils +from cinder.volume import windows FLAGS = cinder.flags.FLAGS diff --git a/cinder/tests/test_wsgi.py b/cinder/tests/test_wsgi.py index 87eb6a25f..222607f8a 100644 --- a/cinder/tests/test_wsgi.py +++ b/cinder/tests/test_wsgi.py @@ -26,8 +26,8 @@ import webob.dec from cinder.api import openstack as openstack_api from cinder import exception -from cinder.volume import xiv from cinder import test +from cinder.volume import xiv import cinder.wsgi diff --git a/cinder/tests/test_zadara.py b/cinder/tests/test_zadara.py index b999ade39..8dab4419c 100644 --- a/cinder/tests/test_zadara.py +++ b/cinder/tests/test_zadara.py @@ -23,8 +23,8 @@ import copy import httplib from cinder import exception -from cinder import test from cinder.openstack.common import log as logging +from cinder import test from cinder.volume import zadara from lxml import etree diff --git a/cinder/tests/windows/basetestcase.py b/cinder/tests/windows/basetestcase.py index 24fcb91c2..0ff394ddd 100644 --- a/cinder/tests/windows/basetestcase.py +++ b/cinder/tests/windows/basetestcase.py @@ -18,10 +18,10 @@ TestCase for MockProxy based tests and related classes. """ +import cinder.test import gzip import os import pickle -import cinder.test from cinder.tests.windows import mockproxy diff --git a/cinder/utils.py b/cinder/utils.py index 31c9e4c34..df2894d5e 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -46,16 +46,16 @@ import warnings from xml.sax import saxutils from eventlet import event +from eventlet.green import subprocess from eventlet import greenthread from eventlet import pools -from eventlet.green import subprocess from cinder.common import deprecated from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import excutils from cinder.openstack.common import importutils +from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils diff --git a/cinder/volume/api.py b/cinder/volume/api.py index c4bc66e67..f3135eb2d 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -25,17 +25,17 @@ import functools from cinder.db import base from cinder import exception from cinder import flags +from cinder.image import glance from cinder.openstack.common import cfg from cinder.openstack.common import excutils -from cinder.image import glance from cinder.openstack.common import log as logging from cinder.openstack.common import rpc from cinder.openstack.common import timeutils -from cinder.volume import volume_types import cinder.policy from cinder import quota from cinder.scheduler import rpcapi as scheduler_rpcapi from cinder.volume import volume_types +from cinder.volume import volume_types volume_host_opt = cfg.BoolOpt('snapshot_same_host', default=True, diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 98ef8f0e1..35af09935 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -26,8 +26,8 @@ import time from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import iscsi diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 60be2eba2..234e18390 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -21,8 +21,8 @@ import urllib from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder.volume import driver diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 7b4e2b8e2..56a8aa872 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -41,11 +41,11 @@ from cinder import context from cinder import exception from cinder import flags from cinder.image import glance -from cinder.openstack.common import log as logging from cinder import manager from cinder.openstack.common import cfg from cinder.openstack.common import excutils from cinder.openstack.common import importutils +from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils from cinder.openstack.common import uuidutils from cinder import quota diff --git a/cinder/volume/netapp.py b/cinder/volume/netapp.py index 9d1cc4751..d40b190a7 100644 --- a/cinder/volume/netapp.py +++ b/cinder/volume/netapp.py @@ -31,8 +31,8 @@ from suds.sax import text from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import volume_types diff --git a/cinder/volume/netapp_nfs.py b/cinder/volume/netapp_nfs.py index dd69c6dec..70605525e 100644 --- a/cinder/volume/netapp_nfs.py +++ b/cinder/volume/netapp_nfs.py @@ -19,16 +19,16 @@ Volume driver for NetApp NFS storage. """ import os -import time import suds from suds.sax import text +import time from cinder import exception from cinder import flags from cinder.openstack.common import cfg from cinder.openstack.common import log as logging -from cinder.volume import nfs from cinder.volume.netapp import netapp_opts +from cinder.volume import nfs LOG = logging.getLogger("cinder.volume.driver") diff --git a/cinder/volume/nexenta/jsonrpc.py b/cinder/volume/nexenta/jsonrpc.py index 2853303c4..487b34c23 100644 --- a/cinder/volume/nexenta/jsonrpc.py +++ b/cinder/volume/nexenta/jsonrpc.py @@ -25,8 +25,8 @@ import urllib2 from cinder.openstack.common import jsonutils -from cinder.volume import nexenta from cinder.openstack.common import log as logging +from cinder.volume import nexenta LOG = logging.getLogger("cinder.volume.nexenta.jsonrpc") diff --git a/cinder/volume/nexenta/volume.py b/cinder/volume/nexenta/volume.py index 9bac207ec..6925c3217 100644 --- a/cinder/volume/nexenta/volume.py +++ b/cinder/volume/nexenta/volume.py @@ -24,8 +24,8 @@ from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import nexenta from cinder.volume.nexenta import jsonrpc diff --git a/cinder/volume/nfs.py b/cinder/volume/nfs.py index deec01672..4ac5df418 100644 --- a/cinder/volume/nfs.py +++ b/cinder/volume/nfs.py @@ -15,15 +15,15 @@ # License for the specific language governing permissions and limitations # under the License. -import os import errno import hashlib +import os +from cinder import exception from cinder import flags from cinder.openstack.common import cfg from cinder.openstack.common import log as logging from cinder.volume import driver -from cinder import exception LOG = logging.getLogger("cinder.volume.driver") diff --git a/cinder/volume/san/__init__.py b/cinder/volume/san/__init__.py index 12984975e..f890b1e79 100644 --- a/cinder/volume/san/__init__.py +++ b/cinder/volume/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 diff --git a/cinder/volume/san/san.py b/cinder/volume/san/san.py index feda4fc12..c38a98cef 100644 --- a/cinder/volume/san/san.py +++ b/cinder/volume/san/san.py @@ -28,8 +28,8 @@ from eventlet import greenthread from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.driver import ISCSIDriver diff --git a/cinder/volume/utils.py b/cinder/volume/utils.py index a79a39a69..ee73a0f6b 100644 --- a/cinder/volume/utils.py +++ b/cinder/volume/utils.py @@ -17,10 +17,10 @@ """Volume-related Utilities and helpers.""" from cinder import flags -from cinder import utils -from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common import log as logging +from cinder.openstack.common.notifier import api as notifier_api from cinder.openstack.common import timeutils +from cinder import utils FLAGS = flags.FLAGS diff --git a/cinder/volume/zadara.py b/cinder/volume/zadara.py index 053b7b5e8..b83996ea9 100644 --- a/cinder/volume/zadara.py +++ b/cinder/volume/zadara.py @@ -25,8 +25,8 @@ import httplib from cinder import exception from cinder import flags -from cinder.openstack.common import log as logging from cinder.openstack.common import cfg +from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver from cinder.volume import iscsi -- 2.45.2