Fix module's import order

Made corrections in import order for built-in, third party and
project specific modules as per OpenStack import standards [1].

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I899deefd6ee4732d6c0afd17a5afbe42b0fa37ba
This commit is contained in:
Bhagyashri Shewale 2016-01-20 02:48:22 -08:00 committed by bhagyashris
parent 47499d291c
commit 88e899f7a0
76 changed files with 84 additions and 92 deletions

View File

@ -16,13 +16,13 @@
import collections
import itertools
import operator
import uuid
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import retrying
import six
import uuid
from neutron._i18n import _, _LE, _LI, _LW
from neutron.agent.common import utils

View File

@ -17,7 +17,6 @@ import collections
import os
import eventlet
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging

View File

@ -14,13 +14,14 @@
import os
from oslo_log import log as logging
from neutron.agent.l3 import fip_rule_priority_allocator as frpa
from neutron.agent.l3 import link_local_allocator as lla
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.common import utils as common_utils
from oslo_log import log as logging
LOG = logging.getLogger(__name__)

View File

@ -14,8 +14,8 @@
import binascii
import collections
import netaddr
import netaddr
from oslo_log import log as logging
from oslo_utils import excutils
import six

View File

@ -13,7 +13,6 @@
# under the License.
import netaddr
from oslo_log import log as logging
from neutron._i18n import _LE, _LW

View File

@ -14,9 +14,9 @@
#
import datetime
from six.moves import queue as Queue
from oslo_utils import timeutils
from six.moves import queue as Queue
# Lower value is higher priority
PRIORITY_RPC = 0

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import netaddr
import os
import six
import netaddr
from oslo_log import log as logging
import six
from neutron.agent.common import utils as common_utils
from neutron.agent.linux import ip_lib

View File

@ -17,6 +17,7 @@
# under the License.
import os
from oslo_log import log as logging
from neutron.agent.linux import ip_lib

View File

@ -15,13 +15,13 @@
import abc
import collections
import os.path
import six
import eventlet
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import fileutils
import six
from neutron._i18n import _, _LW, _LE
from neutron.agent.common import config as agent_cfg

View File

@ -13,14 +13,15 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import re
import debtcollector
import eventlet
import netaddr
import os
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import re
import six
from neutron._i18n import _, _LE

View File

@ -13,15 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
import functools
import signal
import six
from stevedore import driver
import eventlet
from oslo_config import cfg
from oslo_log import log as logging
import six
from stevedore import driver
from neutron._i18n import _
from neutron.agent.linux import utils as linux_utils

View File

@ -14,9 +14,9 @@
# under the License.
import abc
import six
from oslo_config import cfg
import six
from neutron._i18n import _

View File

@ -14,6 +14,7 @@
# under the License.
from itertools import chain as iter_chain
import jinja2
import netaddr
from oslo_config import cfg

View File

@ -12,13 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves import queue as Queue
import time
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from ovs.db import idl
from six.moves import queue as Queue
from neutron._i18n import _
from neutron.agent.ovsdb import api

View File

@ -13,13 +13,13 @@
# under the License.
import os
from six.moves import queue as Queue
import threading
import traceback
from ovs.db import idl
from ovs import poller
import retrying
from six.moves import queue as Queue
from neutron.agent.ovsdb.native import helpers
from neutron.agent.ovsdb.native import idlutils

View File

@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import oslo_messaging
from oslo_log import log as logging
import oslo_messaging
from neutron._i18n import _LW
from neutron.common import constants

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import functools
import re
import functools
import netaddr
from oslo_log import log as logging
from oslo_utils import uuidutils

View File

@ -25,7 +25,6 @@ import errno
import functools
import hashlib
import multiprocessing
import netaddr
import os
import random
import signal
@ -36,6 +35,7 @@ import uuid
import debtcollector
from eventlet.green import subprocess
import netaddr
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging

View File

@ -13,16 +13,16 @@
# under the License.
import itertools
import netaddr
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import uuidutils
import six
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
from oslo_utils import excutils
import six
from neutron._i18n import _, _LI
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.v2 import attributes

View File

@ -14,13 +14,14 @@
import abc
import six
from neutron._i18n import _
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
from neutron.api.v2 import base
from neutron.common import exceptions as nexception
from neutron import manager
import six
ADDRESS_SCOPE = 'address_scope'
ADDRESS_SCOPES = '%ss' % ADDRESS_SCOPE

View File

@ -12,13 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
import webob.exc
from neutron._i18n import _
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
from neutron.common import exceptions as nexception
from oslo_config import cfg
allowed_address_pair_opts = [
#TODO(limao): use quota framework when it support quota for attributes

View File

@ -14,9 +14,9 @@
# under the License.
import re
import six
from oslo_config import cfg
import six
from neutron._i18n import _
from neutron.api import extensions

View File

@ -14,8 +14,8 @@
# under the License.
import abc
import netaddr
import netaddr
from oslo_config import cfg
from oslo_utils import uuidutils
import six

View File

@ -11,8 +11,8 @@
# under the License.
import abc
import netaddr
import netaddr
from oslo_config import cfg
from oslo_utils import uuidutils
import six

View File

@ -21,6 +21,7 @@ methods that needs to be implemented by a v2 Neutron Plug-in.
"""
import abc
import six

View File

@ -14,8 +14,8 @@
import collections
from oslo_utils import timeutils
from oslo_concurrency import lockutils
from oslo_utils import timeutils
from neutron.openstack.common.cache import backends

View File

@ -14,6 +14,7 @@
# under the License.
import abc
import six
# The following keys are used in the segment dictionaries passed via

View File

@ -14,9 +14,9 @@
# under the License.
import abc
import six
from oslo_log import log
import six
from neutron._i18n import _LW
from neutron.extensions import portbindings

View File

@ -14,12 +14,12 @@
# under the License.
import collections
import functools
import signal
import sys
import time
import uuid
import functools
import netaddr
from oslo_config import cfg
from oslo_log import log as logging

View File

@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from neutron._i18n import _LI
from neutron.api.v2 import attributes as attrs
from neutron.common import utils
@ -20,7 +22,6 @@ from neutron.db import common_db_mixin
from neutron.db import portsecurity_db_common as ps_db_common
from neutron.extensions import portsecurity as psec
from neutron.plugins.ml2 import driver_api as api
from oslo_log import log as logging
LOG = logging.getLogger(__name__)

View File

@ -12,7 +12,6 @@
# under the License.
import eventlet
from oslo_log import log
from neutron._i18n import _LI

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest_lib import exceptions as lib_exc
from neutron.tests.api import base
from neutron.tests.api import base_security_groups as base_security
from neutron.tests.tempest import test
from tempest_lib import exceptions as lib_exc
class PortSecurityAdminTests(base_security.BaseSecGroupTest,

View File

@ -12,10 +12,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import testtools
from neutron.tests.api import base
from neutron.tests.api import clients

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import netaddr
import random
import netaddr
import six
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc

View File

@ -14,10 +14,9 @@
# under the License.
import netaddr
import testtools
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
import testtools
from neutron.tests.api import base_routers as base
from neutron.tests.tempest import config

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import netaddr
import uuid
import netaddr
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import sys
import mock
from oslo_config import cfg
from neutron._i18n import _

View File

@ -13,6 +13,7 @@
# under the License.
import copy
import netaddr
from oslo_utils import uuidutils
from six import moves

View File

@ -12,9 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import testscenarios
from oslo_utils import uuidutils
import testscenarios
from neutron.tests.fullstack import base
from neutron.tests.fullstack.resources import environment

View File

@ -17,11 +17,10 @@ import functools
import mock
import netaddr
import testtools
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import uuidutils
import testtools
from neutron.agent.common import config as agent_config
from neutron.agent.common import ovs_lib

View File

@ -13,7 +13,6 @@
# under the License.
import mock
from oslo_config import cfg
from neutron.agent.common import config

View File

@ -16,11 +16,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import copy
import testscenarios
import netaddr
from oslo_config import cfg
import testscenarios
from neutron.agent import firewall
from neutron.agent.linux import iptables_firewall

View File

@ -17,6 +17,7 @@
import time
from eventlet.timeout import Timeout
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.tests.common import net_helpers
from neutron.tests.functional.agent.l2 import base

View File

@ -16,7 +16,6 @@
import eventlet
import fixtures
import mock
from oslo_config import cfg
from oslo_utils import importutils

View File

@ -14,9 +14,10 @@
# under the License.
import collections
import mock
import uuid
import mock
from neutron.agent.common import ovs_lib
from neutron.agent.linux import ip_lib
from neutron.tests import base as tests_base

View File

@ -15,12 +15,10 @@
import os.path
from neutron import context
from neutron import policy
from neutron.api import extensions
from neutron.api.v2 import attributes
from neutron import context
from neutron import policy
from neutron.tests import base
from neutron.tests import tools

View File

@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from alembic import script as alembic_script
from contextlib import contextmanager
import mock
@ -21,6 +19,7 @@ from oslo_config import cfg
from oslo_config import fixture as config_fixture
from oslo_db.sqlalchemy import test_base
from oslo_db.sqlalchemy import test_migrations
import six
import sqlalchemy
from sqlalchemy import event
import sqlalchemy.types as types

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from collections import namedtuple
import os
from collections import namedtuple
import mock
from oslo_config import cfg
from oslo_policy import policy as oslo_policy

View File

@ -14,6 +14,8 @@
# under the License.
import collections
from operator import attrgetter
import six
import testscenarios
@ -24,7 +26,6 @@ from neutron.db import common_db_mixin
from neutron.scheduler import dhcp_agent_scheduler
from neutron.tests.unit.scheduler import (test_dhcp_agent_scheduler as
test_dhcp_sch)
from operator import attrgetter
# Required to generate tests from scenarios. Not compatible with nose.
load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,6 +15,7 @@
import collections
import random
import testscenarios
from neutron import context

View File

@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import httplib2
import mock
import os
import signal
import socket
import time
import traceback
import httplib2
import mock
from oslo_config import cfg
import psutil

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import platform
import random
import string
import warnings
import fixtures
import mock
import six
from neutron.api.v2 import attributes

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from six.moves import http_client as httplib
from oslo_config import cfg
from six.moves import http_client as httplib
from webob import exc
from neutron import context

View File

@ -13,6 +13,7 @@
# under the License.
import collections
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils

View File

@ -14,10 +14,10 @@
# under the License.
import copy
import eventlet
from itertools import chain as iter_chain
from itertools import combinations as iter_combinations
import eventlet
import mock
import netaddr
from oslo_log import log

View File

@ -14,7 +14,6 @@
import mock
import netaddr
from oslo_log import log
from oslo_utils import uuidutils

View File

@ -14,13 +14,12 @@
# under the License.
import string
import testtools
import mock
import netaddr
import webob.exc
from oslo_utils import uuidutils
import testtools
import webob.exc
from neutron._i18n import _
from neutron.api.v2 import attributes

View File

@ -18,6 +18,7 @@ import re
import eventlet
import mock
import netaddr
from oslo_log import log as logging
import six
import testtools
@ -29,8 +30,6 @@ from neutron.plugins.common import utils as plugin_utils
from neutron.tests import base
from neutron.tests.common import helpers
from oslo_log import log as logging
class TestParseMappings(base.BaseTestCase):
def parse(self, mapping_list, unique_values=True):

View File

@ -15,10 +15,9 @@
import mock
import netaddr
import webob.exc
from oslo_config import cfg
from oslo_utils import uuidutils
import webob.exc
from neutron.common import constants
from neutron.common import exceptions as n_exc

View File

@ -13,8 +13,8 @@
# under the License.
import contextlib
import netaddr
import netaddr
import webob.exc
from neutron.api.v2 import attributes as attr

View File

@ -13,8 +13,8 @@
# under the License.
import math
import netaddr
import netaddr
from oslo_config import cfg
from neutron.common import constants

View File

@ -15,7 +15,6 @@
import mock
import netaddr
from oslo_db import exception as db_exc
from neutron.api.v2 import attributes
@ -26,7 +25,6 @@ from neutron.ipam.drivers.neutrondb_ipam import driver
from neutron.ipam import exceptions as ipam_exc
from neutron.ipam import requests as ipam_req
from neutron import manager
from neutron.tests.unit.db import test_db_base_plugin_v2 as test_db_plugin
from neutron.tests.unit import testlib_api

View File

@ -16,11 +16,10 @@
import mock
from novaclient import exceptions as nova_exceptions
from oslo_config import cfg
from oslo_utils import uuidutils
from sqlalchemy.orm import attributes as sql_attr
from oslo_config import cfg
from neutron.common import constants as n_const
from neutron.db import models_v2
from neutron.notifiers import nova

View File

@ -13,6 +13,7 @@
# under the License.
import hashlib
import mock
from neutron.common import constants

View File

@ -16,11 +16,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import oslo_db.sqlalchemy.session
import sqlalchemy as sa
from sqlalchemy import orm
import oslo_db.sqlalchemy.session
from neutron.api import extensions
from neutron.api.v2 import attributes
from neutron.db import model_base

View File

@ -15,6 +15,7 @@
# under the License.
import collections
import mock
from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
import mock
import testtools
from neutron.common import constants
from neutron.common import topics

View File

@ -15,7 +15,6 @@
# under the License.
import mock
from oslo_utils import importutils
from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \

View File

@ -17,7 +17,6 @@
import mock
from neutron.common import constants
from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
import ovs_test_base

View File

@ -10,9 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import uuid
import mock
from neutron import context
from neutron import manager
from neutron.plugins.ml2 import config

View File

@ -14,12 +14,12 @@
# under the License.
import functools
import uuid
import fixtures
import mock
import six
import testtools
import uuid
import webob
from oslo_db import exception as db_exc

View File

@ -15,6 +15,7 @@
# under the License.
import math
import mock
from neutron.common import constants as const

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import uuid
import mock
from oslo_config import cfg
from neutron import context

View File

@ -13,7 +13,6 @@
# under the License.
import mock
from oslo_config import cfg
from neutron import context

View File

@ -19,13 +19,12 @@ import datetime
import uuid
import mock
import testscenarios
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_utils import importutils
from oslo_utils import timeutils
from sqlalchemy.orm import query
import testscenarios
from neutron.common import constants
from neutron import context as n_context

View File

@ -13,7 +13,6 @@
# under the License.
import mock
from oslo_config import cfg
from neutron.common import exceptions as n_exc