Merge "Remove references to model_base through models_v2"
This commit is contained in:
commit
19fa34afd1
@ -19,11 +19,10 @@ from sqlalchemy.orm import exc
|
||||
from neutron._i18n import _
|
||||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
from neutron.extensions import address_scope as ext_address_scope
|
||||
|
||||
|
||||
class AddressScope(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
|
||||
class AddressScope(model_base.BASEV2, model_base.HasId, model_base.HasTenant):
|
||||
"""Represents a neutron address scope."""
|
||||
|
||||
__tablename__ = "address_scopes"
|
||||
|
@ -32,7 +32,6 @@ from neutron.api.v2 import attributes
|
||||
from neutron.common import constants
|
||||
from neutron import context
|
||||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
from neutron.extensions import agent as ext_agent
|
||||
from neutron.extensions import availability_zone as az_ext
|
||||
from neutron import manager
|
||||
@ -70,7 +69,7 @@ AGENT_OPTS = [
|
||||
cfg.CONF.register_opts(AGENT_OPTS)
|
||||
|
||||
|
||||
class Agent(model_base.BASEV2, models_v2.HasId):
|
||||
class Agent(model_base.BASEV2, model_base.HasId):
|
||||
"""Represents agents running in neutron deployments."""
|
||||
|
||||
__table_args__ = (
|
||||
|
@ -23,7 +23,7 @@ from neutron.db import models_v2
|
||||
from neutron.extensions import extra_dhcp_opt as edo_ext
|
||||
|
||||
|
||||
class ExtraDhcpOpt(model_base.BASEV2, models_v2.HasId):
|
||||
class ExtraDhcpOpt(model_base.BASEV2, model_base.HasId):
|
||||
"""Represent a generic concept of extra options associated to a port.
|
||||
|
||||
Each port may have none to many dhcp opts associated to it that can
|
||||
|
@ -21,14 +21,13 @@ 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 models_v2
|
||||
from neutron.db import servicetype_db as sdb
|
||||
from neutron.extensions import flavors as ext_flavors
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Flavor(model_base.BASEV2, models_v2.HasId):
|
||||
class Flavor(model_base.BASEV2, model_base.HasId):
|
||||
name = sa.Column(sa.String(attr.NAME_MAX_LEN))
|
||||
description = sa.Column(sa.String(attr.LONG_DESCRIPTION_MAX_LEN))
|
||||
enabled = sa.Column(sa.Boolean, nullable=False, default=True,
|
||||
@ -39,7 +38,7 @@ class Flavor(model_base.BASEV2, models_v2.HasId):
|
||||
cascade="all, delete-orphan")
|
||||
|
||||
|
||||
class ServiceProfile(model_base.BASEV2, models_v2.HasId):
|
||||
class ServiceProfile(model_base.BASEV2, model_base.HasId):
|
||||
description = sa.Column(sa.String(attr.LONG_DESCRIPTION_MAX_LEN))
|
||||
driver = sa.Column(sa.String(1024), nullable=False)
|
||||
enabled = sa.Column(sa.Boolean, nullable=False, default=True,
|
||||
|
@ -80,7 +80,7 @@ class RouterPort(model_base.BASEV2):
|
||||
|
||||
|
||||
class Router(model_base.HasStandardAttributes, model_base.BASEV2,
|
||||
models_v2.HasId, models_v2.HasTenant):
|
||||
model_base.HasId, model_base.HasTenant):
|
||||
"""Represents a v2 neutron router."""
|
||||
|
||||
name = sa.Column(sa.String(attributes.NAME_MAX_LEN))
|
||||
@ -97,7 +97,7 @@ class Router(model_base.HasStandardAttributes, model_base.BASEV2,
|
||||
|
||||
|
||||
class FloatingIP(model_base.HasStandardAttributes, model_base.BASEV2,
|
||||
models_v2.HasId, models_v2.HasTenant):
|
||||
model_base.HasId, model_base.HasTenant):
|
||||
"""Represents a floating IP address.
|
||||
|
||||
This IP address may or may not be allocated to a tenant, and may or
|
||||
|
@ -24,11 +24,10 @@ 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.db import models_v2
|
||||
from neutron.extensions import metering
|
||||
|
||||
|
||||
class MeteringLabelRule(model_base.BASEV2, models_v2.HasId):
|
||||
class MeteringLabelRule(model_base.BASEV2, model_base.HasId):
|
||||
direction = sa.Column(sa.Enum('ingress', 'egress',
|
||||
name='meteringlabels_direction'))
|
||||
remote_ip_prefix = sa.Column(sa.String(64))
|
||||
@ -39,7 +38,7 @@ class MeteringLabelRule(model_base.BASEV2, models_v2.HasId):
|
||||
excluded = sa.Column(sa.Boolean, default=False, server_default=sql.false())
|
||||
|
||||
|
||||
class MeteringLabel(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
|
||||
class MeteringLabel(model_base.BASEV2, model_base.HasId, model_base.HasTenant):
|
||||
name = sa.Column(sa.String(attr.NAME_MAX_LEN))
|
||||
description = sa.Column(sa.String(attr.LONG_DESCRIPTION_MAX_LEN))
|
||||
rules = orm.relationship(MeteringLabelRule, backref="label",
|
||||
|
@ -20,7 +20,7 @@ from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
|
||||
|
||||
class QosPolicy(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
|
||||
class QosPolicy(model_base.BASEV2, model_base.HasId, model_base.HasTenant):
|
||||
__tablename__ = 'qos_policies'
|
||||
name = sa.Column(sa.String(attrs.NAME_MAX_LEN))
|
||||
description = sa.Column(sa.String(attrs.DESCRIPTION_MAX_LEN))
|
||||
@ -65,7 +65,7 @@ class QosPortPolicyBinding(model_base.BASEV2):
|
||||
cascade='delete', lazy='joined'))
|
||||
|
||||
|
||||
class QosBandwidthLimitRule(models_v2.HasId, model_base.BASEV2):
|
||||
class QosBandwidthLimitRule(model_base.HasId, model_base.BASEV2):
|
||||
__tablename__ = 'qos_bandwidth_limit_rules'
|
||||
qos_policy_id = sa.Column(sa.String(36),
|
||||
sa.ForeignKey('qos_policies.id',
|
||||
|
@ -18,7 +18,6 @@ from sqlalchemy import sql
|
||||
|
||||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
|
||||
|
||||
class ResourceDelta(model_base.BASEV2):
|
||||
@ -32,7 +31,7 @@ class ResourceDelta(model_base.BASEV2):
|
||||
amount = sa.Column(sa.Integer)
|
||||
|
||||
|
||||
class Reservation(model_base.BASEV2, models_v2.HasId):
|
||||
class Reservation(model_base.BASEV2, model_base.HasId):
|
||||
tenant_id = sa.Column(sa.String(attr.TENANT_ID_MAX_LEN))
|
||||
expiration = sa.Column(sa.DateTime())
|
||||
resource_deltas = orm.relationship(ResourceDelta,
|
||||
@ -41,7 +40,7 @@ class Reservation(model_base.BASEV2, models_v2.HasId):
|
||||
cascade='all, delete-orphan')
|
||||
|
||||
|
||||
class Quota(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
|
||||
class Quota(model_base.BASEV2, model_base.HasId, model_base.HasTenant):
|
||||
"""Represent a single quota override for a tenant.
|
||||
|
||||
If there is no row for a given tenant id and resource, then the
|
||||
|
@ -45,7 +45,7 @@ IP_PROTOCOL_MAP = {constants.PROTO_NAME_TCP: constants.PROTO_NUM_TCP,
|
||||
|
||||
|
||||
class SecurityGroup(model_base.HasStandardAttributes, model_base.BASEV2,
|
||||
models_v2.HasId, models_v2.HasTenant):
|
||||
model_base.HasId, model_base.HasTenant):
|
||||
"""Represents a v2 neutron security group."""
|
||||
|
||||
name = sa.Column(sa.String(attributes.NAME_MAX_LEN))
|
||||
@ -88,7 +88,7 @@ class SecurityGroupPortBinding(model_base.BASEV2):
|
||||
|
||||
|
||||
class SecurityGroupRule(model_base.HasStandardAttributes, model_base.BASEV2,
|
||||
models_v2.HasId, models_v2.HasTenant):
|
||||
model_base.HasId, model_base.HasTenant):
|
||||
"""Represents a v2 neutron security group rule."""
|
||||
|
||||
security_group_id = sa.Column(sa.String(36),
|
||||
|
@ -18,7 +18,6 @@ import sqlalchemy as sa
|
||||
from sqlalchemy import orm as sa_orm
|
||||
|
||||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
|
||||
# Database models used by the neutron DB IPAM driver
|
||||
|
||||
@ -65,7 +64,7 @@ class IpamAvailabilityRange(model_base.BASEV2):
|
||||
# models_v2.IPAllocationPool is the representation of IP allocation pools in
|
||||
# the management layer and therefore its evolution is subject to APIs backward
|
||||
# compatibility policies
|
||||
class IpamAllocationPool(model_base.BASEV2, models_v2.HasId):
|
||||
class IpamAllocationPool(model_base.BASEV2, model_base.HasId):
|
||||
"""Representation of an allocation pool in a Neutron subnet."""
|
||||
|
||||
ipam_subnet_id = sa.Column(sa.String(36),
|
||||
@ -83,7 +82,7 @@ class IpamAllocationPool(model_base.BASEV2, models_v2.HasId):
|
||||
return "%s - %s" % (self.first_ip, self.last_ip)
|
||||
|
||||
|
||||
class IpamSubnet(model_base.BASEV2, models_v2.HasId):
|
||||
class IpamSubnet(model_base.BASEV2, model_base.HasId):
|
||||
"""Association between IPAM entities and neutron subnets.
|
||||
|
||||
For subnet data persistency - such as cidr and gateway IP, the IPAM
|
||||
|
@ -23,7 +23,7 @@ from neutron.extensions import portbindings
|
||||
BINDING_PROFILE_LEN = 4095
|
||||
|
||||
|
||||
class NetworkSegment(model_base.BASEV2, models_v2.HasId):
|
||||
class NetworkSegment(model_base.BASEV2, model_base.HasId):
|
||||
"""Represent persistent state of a network segment.
|
||||
|
||||
A network segment is a portion of a neutron network with a
|
||||
|
@ -15,14 +15,13 @@
|
||||
import sqlalchemy as sa
|
||||
|
||||
from neutron.db import model_base
|
||||
from neutron.db import models_v2
|
||||
|
||||
# Model classes for test resources
|
||||
|
||||
|
||||
class MehModel(model_base.BASEV2, models_v2.HasTenant):
|
||||
class MehModel(model_base.BASEV2, model_base.HasTenant):
|
||||
meh = sa.Column(sa.String(8), primary_key=True)
|
||||
|
||||
|
||||
class OtherMehModel(model_base.BASEV2, models_v2.HasTenant):
|
||||
class OtherMehModel(model_base.BASEV2, model_base.HasTenant):
|
||||
othermeh = sa.Column(sa.String(8), primary_key=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user