This patch ensures that models_v2 and the router db module
import the agent binding modules so their models are defined
in the sqlalchemy metadata. Otherwise, using an agentless
core/L3 plugin may result in a failure to initialize if nothing
imported the agent module.
Change-Id: I77240462b618d6e95c7c5862441d6d179e371f4f
Closes-Bug: #
1529022
from sqlalchemy import orm
from neutron.db import db_base_plugin_v2
-from neutron.db import l3_db
from neutron.db import model_base
from neutron.extensions import l3
availability_zone_hints = sa.Column(sa.String(255))
router = orm.relationship(
- l3_db.Router,
+ 'Router',
backref=orm.backref("extra_attributes", lazy='joined',
uselist=False, cascade='delete'))
from neutron.common import ipv6_utils
from neutron.common import rpc as n_rpc
from neutron.common import utils
+from neutron.db import l3_agentschedulers_db as l3_agt
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import external_net
RouterPort,
backref='router',
lazy='dynamic')
- l3_agents = orm.relationship('Agent', lazy='joined', viewonly=True,
- secondary='routerl3agentbindings')
+ l3_agents = orm.relationship(
+ 'Agent', lazy='joined', viewonly=True,
+ secondary=l3_agt.RouterL3AgentBinding.__table__)
class FloatingIP(model_base.HasStandardAttributes, model_base.BASEV2,
from neutron.api.v2 import attributes as attr
from neutron.common import constants
+from neutron.db import agentschedulers_db as agt
from neutron.db import model_base
from neutron.db import rbac_db_models
backref='network', lazy='joined',
cascade='all, delete, delete-orphan')
availability_zone_hints = sa.Column(sa.String(255))
- dhcp_agents = orm.relationship('Agent', lazy='joined', viewonly=True,
- secondary='networkdhcpagentbindings')
+ dhcp_agents = orm.relationship(
+ 'Agent', lazy='joined', viewonly=True,
+ secondary=agt.NetworkDhcpAgentBinding.__table__)