Switch to neutron-lib for model_base

Change-Id: If5b2b4cc0346515ddef3da1255ab49327c8e5732
This commit is contained in:
Henry Gessau 2016-08-20 18:30:32 -04:00 committed by Henry Gessau
parent 8074699baa
commit 61cc14fd67
47 changed files with 67 additions and 169 deletions

View File

@ -18,6 +18,7 @@ import datetime
from eventlet import greenthread
from neutron_lib.api import converters
from neutron_lib import constants
from neutron_lib.db import model_base
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
@ -39,7 +40,6 @@ from neutron.callbacks import resources
from neutron.common import constants as n_const
from neutron import context
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.extensions import agent as ext_agent
from neutron.extensions import availability_zone as az_ext
from neutron import manager

View File

@ -33,7 +33,6 @@ from neutron.common import utils
from neutron import context as ncontext
from neutron.db import agents_db
from neutron.db.availability_zone import network as network_az
from neutron.db import model_base # noqa
from neutron.db.network_dhcp_agent_binding import models as ndab_model
from neutron.extensions import agent as ext_agent
from neutron.extensions import dhcpagentscheduler

View File

@ -14,6 +14,7 @@
# under the License.
from neutron_lib.api import validators
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_config import cfg
from oslo_log import log as logging
@ -24,7 +25,6 @@ from neutron._i18n import _, _LE
from neutron.common import utils
from neutron.db import db_base_plugin_v2
from neutron.db import l3_db
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import dns
from neutron.extensions import l3

View File

@ -14,6 +14,7 @@
# under the License.
from neutron_lib import constants
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_config import cfg
from oslo_db import exception as db_exc
@ -29,7 +30,6 @@ from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import dvr as ext_dvr
from neutron.extensions import portbindings

View File

@ -15,6 +15,7 @@
from neutron_lib.api import validators
from neutron_lib import constants as lib_constants
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
import sqlalchemy as sa
from sqlalchemy import orm
@ -30,7 +31,6 @@ from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import db_base_plugin_v2
from neutron.db import l3_db
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import rbac_db_models as rbac_db
from neutron.extensions import external_net

View File

@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import model_base
from neutron.db import models_v2

View File

@ -14,6 +14,7 @@
# under the License.
import netaddr
from neutron_lib.db import model_base
from oslo_config import cfg
from oslo_log import log as logging
import sqlalchemy as sa
@ -23,7 +24,6 @@ from neutron._i18n import _
from neutron.common import utils
from neutron.db import db_base_plugin_v2
from neutron.db import l3_db
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import extraroute
from neutron.extensions import l3

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
from oslo_log import log as logging
from oslo_utils import uuidutils
import sqlalchemy as sa
@ -20,7 +21,6 @@ from sqlalchemy.orm import exc as sa_exc
from neutron.api.v2 import attributes as attr
from neutron.db import common_db_mixin
from neutron.db import model_base
from neutron.db import servicetype_db as sdb
from neutron.extensions import flavors as ext_flavors

View File

@ -15,6 +15,7 @@
import debtcollector
from neutron_lib import constants
from neutron_lib.db import model_base
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
@ -32,7 +33,6 @@ from neutron.common import utils as n_utils
from neutron.db import agents_db
from neutron.db import agentschedulers_db
from neutron.db import l3_attrs_db
from neutron.db import model_base
from neutron.extensions import l3agentscheduler
from neutron.extensions import router_availability_zone as router_az
from neutron import manager

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import db_base_plugin_v2
from neutron.db import model_base
from neutron.extensions import l3

View File

@ -19,6 +19,7 @@ from debtcollector import removals
import netaddr
from neutron_lib.api import validators
from neutron_lib import constants as lib_constants
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_log import log as logging
from oslo_utils import excutils
@ -42,7 +43,6 @@ from neutron.common import utils
from neutron.db import api as db_api
from neutron.db import common_db_mixin
from neutron.db import l3_agentschedulers_db as l3_agt
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import standard_attr
from neutron.db import standardattrdescription_db as st_attr

View File

@ -18,6 +18,7 @@ import functools
import netaddr
from neutron_lib.api import validators
from neutron_lib import constants
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_config import cfg
from oslo_db import exception as db_exc
@ -39,7 +40,6 @@ from neutron.db import common_db_mixin
from neutron.db import l3_db
from neutron.db import l3_dvr_db
from neutron.db.l3_dvr_db import is_distributed_router
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import l3
from neutron.extensions import l3_ext_ha_mode as l3_ha

View File

@ -13,6 +13,7 @@
# under the License.
import netaddr
from neutron_lib.db import model_base
from oslo_utils import uuidutils
import sqlalchemy as sa
from sqlalchemy import orm
@ -23,7 +24,6 @@ from neutron.api.v2 import attributes as attr
from neutron.common import constants
from neutron.db import common_db_mixin as base_db
from neutron.db import l3_db
from neutron.db import model_base
from neutron.extensions import metering

View File

@ -13,6 +13,7 @@
# under the License.
from alembic import context
from neutron_lib.db import model_base
from oslo_config import cfg
import sqlalchemy as sa
from sqlalchemy import event
@ -21,7 +22,6 @@ from neutron.db.migration.alembic_migrations import external
from neutron.db.migration import autogen
from neutron.db.migration.connection import DBConnection
from neutron.db.migration.models import head # noqa
from neutron.db import model_base
try:
# NOTE(mriedem): This is to register the DB2 alembic code which

View File

@ -23,6 +23,8 @@ Based on this comparison database can be healed with healing migration.
import os.path
from neutron_lib.db import model_base
from neutron.common import utils
from neutron.db import agents_db # noqa
from neutron.db import agentschedulers_db # noqa
@ -39,7 +41,6 @@ from neutron.db import l3_dvrscheduler_db # noqa
from neutron.db import l3_gwmode_db # noqa
from neutron.db import l3_hamode_db # noqa
from neutron.db.metering import metering_db # noqa
from neutron.db import model_base
from neutron.db import models
from neutron.db import models_v2 # noqa
from neutron.db.port_security import models as ps_models # noqa

View File

@ -13,117 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import debtcollector
from oslo_db.sqlalchemy import models
from oslo_utils import uuidutils
from neutron_lib.db import model_base as lib_mb
import sqlalchemy as sa
from sqlalchemy.ext import declarative
from sqlalchemy import orm
from neutron.api.v2 import attributes as attr
from neutron.common import _deprecate
class HasProject(object):
"""Project mixin, add to subclasses that have a user."""
# NOTE(jkoelker) project_id is just a free form string ;(
project_id = sa.Column(sa.String(attr.TENANT_ID_MAX_LEN), index=True)
def get_tenant_id(self):
return self.project_id
def set_tenant_id(self, value):
self.project_id = value
@declarative.declared_attr
def tenant_id(cls):
return orm.synonym(
'project_id',
descriptor=property(cls.get_tenant_id, cls.set_tenant_id))
HasTenant = debtcollector.moves.moved_class(HasProject, "HasTenant", __name__)
class HasProjectNoIndex(HasProject):
"""Project mixin, add to subclasses that have a user."""
# NOTE(jkoelker) project_id is just a free form string ;(
project_id = sa.Column(sa.String(attr.TENANT_ID_MAX_LEN))
class HasProjectPrimaryKeyIndex(HasProject):
"""Project mixin, add to subclasses that have a user."""
# NOTE(jkoelker) project_id is just a free form string ;(
project_id = sa.Column(sa.String(attr.TENANT_ID_MAX_LEN), nullable=False,
primary_key=True, index=True)
class HasProjectPrimaryKey(HasProject):
"""Project mixin, add to subclasses that have a user."""
# NOTE(jkoelker) project_id is just a free form string ;(
project_id = sa.Column(sa.String(attr.TENANT_ID_MAX_LEN), nullable=False,
primary_key=True)
class HasId(object):
"""id mixin, add to subclasses that have an id."""
def __init__(self, *args, **kwargs):
# NOTE(dasm): debtcollector requires init in class
super(HasId, self).__init__(*args, **kwargs)
id = sa.Column(sa.String(36),
primary_key=True,
default=uuidutils.generate_uuid)
class HasStatusDescription(object):
"""Status with description mixin."""
def __init__(self, *args, **kwargs):
# NOTE(dasm): debtcollector requires init in class
super(HasStatusDescription, self).__init__(*args, **kwargs)
status = sa.Column(sa.String(16), nullable=False)
status_description = sa.Column(sa.String(attr.DESCRIPTION_MAX_LEN))
class NeutronBase(models.ModelBase):
"""Base class for Neutron Models."""
__table_args__ = {'mysql_engine': 'InnoDB'}
def __iter__(self):
self._i = iter(orm.object_mapper(self).columns)
return self
def next(self):
n = next(self._i).name
return n, getattr(self, n)
__next__ = next
def __repr__(self):
"""sqlalchemy based automatic __repr__ method."""
items = ['%s=%r' % (col.name, getattr(self, col.name))
for col in self.__table__.columns]
return "<%s.%s[object at %x] {%s}>" % (self.__class__.__module__,
self.__class__.__name__,
id(self), ', '.join(items))
class NeutronBaseV2(NeutronBase):
@declarative.declared_attr
def __tablename__(cls):
# NOTE(jkoelker) use the pluralized name of the class as the table
return cls.__name__.lower() + 's'
BASEV2 = declarative.declarative_base(cls=NeutronBaseV2)
_deprecate._moved_global('HasTenant', new_module=lib_mb, new_name='HasProject')
def get_unique_keys(model):
@ -134,3 +30,6 @@ def get_unique_keys(model):
return [[c.name for c in constraint.columns]
for constraint in constraints
if isinstance(constraint, sa.UniqueConstraint)]
# This shim is used to deprecate the old contents.
_deprecate._MovedGlobals(lib_mb)

View File

@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from neutron.api.v2 import attributes as attr
from neutron.db import model_base
class AddressScope(model_base.BASEV2, model_base.HasId, model_base.HasProject):

View File

@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import model_base
from neutron.db import models_v2

View File

@ -10,10 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from neutron.db import model_base
class FlatAllocation(model_base.BASEV2):
"""Represent persistent allocation state of a physical network.

View File

@ -13,11 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import sql
from neutron.db import model_base
class GreAllocation(model_base.BASEV2):

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.api.v2 import attributes
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import standard_attr

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.api.v2 import attributes
from neutron.db import model_base
from neutron.db import models_v2

View File

@ -14,12 +14,13 @@
# under the License.
from neutron_lib import constants
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy import sql
from neutron.api.v2 import attributes as attr
from neutron.db import model_base
from neutron.common import _deprecate
from neutron.db.network_dhcp_agent_binding import models as ndab_model
from neutron.db import rbac_db_models
from neutron.db import standard_attr
@ -27,9 +28,10 @@ from neutron.db import standard_attr
# NOTE(kevinbenton): these are here for external projects that expect them
# to be found in this module.
HasTenant = model_base.HasTenant
HasId = model_base.HasId
HasStatusDescription = model_base.HasStatusDescription
_deprecate._moved_global('HasTenant', new_name='HasProject',
new_module=model_base)
_deprecate._moved_global('HasId', new_module=model_base)
_deprecate._moved_global('HasStatusDescription', new_module=model_base)
class IPAvailabilityRange(model_base.BASEV2):
@ -66,7 +68,7 @@ class IPAvailabilityRange(model_base.BASEV2):
return "%s - %s" % (self.first_ip, self.last_ip)
class IPAllocationPool(model_base.BASEV2, HasId):
class IPAllocationPool(model_base.BASEV2, model_base.HasId):
"""Representation of an allocation pool in a Neutron subnet."""
subnet_id = sa.Column(sa.String(36), sa.ForeignKey('subnets.id',
@ -116,7 +118,7 @@ class SubnetRoute(model_base.BASEV2, Route):
class Port(standard_attr.HasStandardAttributes, model_base.BASEV2,
HasId, HasTenant):
model_base.HasId, model_base.HasProject):
"""Represents a port on a Neutron v2 network."""
name = sa.Column(sa.String(attr.NAME_MAX_LEN))
@ -175,7 +177,7 @@ class DNSNameServer(model_base.BASEV2):
class Subnet(standard_attr.HasStandardAttributes, model_base.BASEV2,
HasId, HasTenant):
model_base.HasId, model_base.HasProject):
"""Represents a neutron subnet.
When a subnet is created the first and last entries will be created. These
@ -244,7 +246,7 @@ class SubnetPoolPrefix(model_base.BASEV2):
class SubnetPool(standard_attr.HasStandardAttributes, model_base.BASEV2,
HasId, HasTenant):
model_base.HasId, model_base.HasProject):
"""Represents a neutron subnet pool.
"""
@ -266,7 +268,7 @@ class SubnetPool(standard_attr.HasStandardAttributes, model_base.BASEV2,
class Network(standard_attr.HasStandardAttributes, model_base.BASEV2,
HasId, HasTenant):
model_base.HasId, model_base.HasProject):
"""Represents a v2 neutron network."""
name = sa.Column(sa.String(attr.NAME_MAX_LEN))
@ -284,3 +286,6 @@ class Network(standard_attr.HasStandardAttributes, model_base.BASEV2,
dhcp_agents = orm.relationship(
'Agent', lazy='joined', viewonly=True,
secondary=ndab_model.NetworkDhcpAgentBinding.__table__)
_deprecate._MovedGlobals()

View File

@ -10,11 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import agents_db
from neutron.db import model_base
class NetworkDhcpAgentBinding(model_base.BASEV2):

View File

@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import model_base
from neutron.db import models_v2

View File

@ -14,12 +14,12 @@
# under the License.
from neutron_lib.api import validators
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.api.v2 import attributes
from neutron.db import db_base_plugin_v2
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import portbindings_base
from neutron.extensions import portbindings

View File

@ -13,6 +13,7 @@
# under the License.
#
from neutron_lib.db import model_base
from oslo_db import exception as db_exc
from oslo_log import log as logging
import sqlalchemy as sa
@ -21,7 +22,6 @@ from neutron._i18n import _LE
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import standard_attr

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from neutron.api.v2 import attributes as attrs
from neutron.common import constants
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import rbac_db_models
@ -80,7 +80,7 @@ class QosBandwidthLimitRule(model_base.HasId, model_base.BASEV2):
max_burst_kbps = sa.Column(sa.Integer)
class QosDscpMarkingRule(models_v2.HasId, model_base.BASEV2):
class QosDscpMarkingRule(model_base.HasId, model_base.BASEV2):
__tablename__ = 'qos_dscp_marking_rules'
qos_policy_id = sa.Column(sa.String(36),
sa.ForeignKey('qos_policies.id',

View File

@ -12,12 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy import sql
from neutron.db import model_base
class ResourceDelta(model_base.BASEV2):
resource = sa.Column(sa.String(255), primary_key=True)

View File

@ -15,6 +15,7 @@
import abc
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
import sqlalchemy as sa
from sqlalchemy.ext import declarative
@ -22,7 +23,6 @@ from sqlalchemy.orm import validates
from neutron._i18n import _
from neutron.api.v2 import attributes as attr
from neutron.db import model_base
from neutron import manager

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
from oslo_log import log as logging
from oslo_utils import uuidutils
import sqlalchemy as sa
@ -19,7 +20,6 @@ from neutron._i18n import _LI
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import model_base
LOG = logging.getLogger(__name__)

View File

@ -15,11 +15,11 @@
from itertools import chain
from neutron_lib.db import model_base
from oslo_log import log as logging
import sqlalchemy as sa
from neutron.api.v2 import attributes as attr
from neutron.db import model_base
from neutron.services import provider_configuration as pconf
LOG = logging.getLogger(__name__)

View File

@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from neutron_lib.db import model_base
from oslo_db.sqlalchemy import models
import sqlalchemy as sa
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext import declarative
from neutron.api.v2 import attributes as attr
from neutron.db import model_base
class StandardAttribute(model_base.BASEV2, models.TimestampMixin):

View File

@ -12,11 +12,11 @@
# under the License.
#
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import aliased
from neutron.db import model_base
from neutron.db import standard_attr

View File

@ -14,11 +14,10 @@
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm as sa_orm
from neutron.db import model_base
# Database models used by the neutron DB IPAM driver

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_config import cfg
from oslo_log import log
@ -20,7 +21,6 @@ import sqlalchemy as sa
from sqlalchemy import sql
from neutron._i18n import _, _LE
from neutron.db import model_base
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers import type_tunnel

View File

@ -15,6 +15,7 @@
import sys
from neutron_lib.db import model_base
from neutron_lib import exceptions as exc
from oslo_config import cfg
from oslo_log import log
@ -23,7 +24,6 @@ import sqlalchemy as sa
from neutron._i18n import _, _LE, _LI, _LW
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.plugins.common import constants as p_const
from neutron.plugins.common import utils as plugin_utils
from neutron.plugins.ml2 import driver_api as api

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_config import cfg
from oslo_log import log
@ -20,7 +21,6 @@ import sqlalchemy as sa
from sqlalchemy import sql
from neutron._i18n import _, _LE
from neutron.db import model_base
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers import type_tunnel

View File

@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import portbindings

View File

@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from neutron.db import model_base
class AutoAllocatedTopology(model_base.BASEV2,
model_base.HasProjectPrimaryKey):

View File

@ -18,6 +18,7 @@
import functools
from neutron_lib import constants
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_db import exception as db_exc
from oslo_log import helpers as log_helpers
@ -31,7 +32,6 @@ from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api
from neutron.db import common_db_mixin
from neutron.db import model_base
from neutron.db import segments_db as db
from neutron.extensions import segment as extension
from neutron import manager

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from sqlalchemy import sql
from neutron.api.v2 import attributes
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import standard_attr
from neutron.services.trunk import constants

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
from oslo_versionedobjects import base as obj_base
from oslo_versionedobjects import fields as obj_fields
import sqlalchemy as sa
from neutron.db import model_base
from neutron.db import standard_attr
from neutron.objects import base as objects_base
from neutron.tests.unit.objects import test_base

View File

@ -12,6 +12,7 @@
import mock
from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc
from oslo_versionedobjects import base as obj_base
from oslo_versionedobjects import fields as obj_fields
@ -19,7 +20,6 @@ from six import add_metaclass
import sqlalchemy as sa
from neutron.callbacks import events
from neutron.db import model_base
from neutron.db import rbac_db_models
from neutron.extensions import rbac as ext_rbac
from neutron.objects import base

View File

@ -17,12 +17,12 @@
# under the License.
from neutron_lib.api import validators
from neutron_lib.db import model_base
import oslo_db.sqlalchemy.session
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.api import extensions
from neutron.db import model_base
from neutron.db import models_v2
from neutron.plugins.ml2 import driver_api
from neutron.tests.unit.plugins.ml2 import extensions as test_extensions

View File

@ -12,10 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.db import model_base
import sqlalchemy as sa
from neutron.db import model_base
# Model classes for test resources

View File

@ -19,16 +19,16 @@ import testresources
import testscenarios
import testtools
from neutron_lib.db import model_base
from oslo_db import exception as oslodb_exception
from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import provision
from oslo_db.sqlalchemy import session
from neutron.db import api as db_api
# Import all data models
from neutron.db.migration import cli as migration
# Import all data models
from neutron.db.migration.models import head # noqa
from neutron.db import model_base
from neutron.tests import base
from neutron import wsgi