Remove deprecation warnings for l3_hamode_db

Commit f9b1f0906c relocated these
models

Change-Id: Ia0477d478583c5ace06858d4aa0492b18273f3f8
This commit is contained in:
Gary Kotton 2016-10-09 05:35:54 -07:00
parent 890f5ed0fd
commit 29016406f0
2 changed files with 9 additions and 9 deletions

View File

@ -17,8 +17,8 @@ from neutron_lib import constants as const
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from neutron.db import l3_hamode_db
from neutron.db.models import agent as agent_model
from neutron.db.models import l3ha as l3ha_model
from neutron.db import models_v2
from neutron.plugins.ml2 import models as ml2_models
@ -77,8 +77,8 @@ def _get_active_network_ports(session, network_id):
def _ha_router_interfaces_on_network_query(session, network_id):
query = session.query(models_v2.Port)
query = query.join(l3_hamode_db.L3HARouterAgentPortBinding,
l3_hamode_db.L3HARouterAgentPortBinding.router_id ==
query = query.join(l3ha_model.L3HARouterAgentPortBinding,
l3ha_model.L3HARouterAgentPortBinding.router_id ==
models_v2.Port.device_id)
return query.filter(
models_v2.Port.network_id == network_id,
@ -129,15 +129,15 @@ def get_ha_active_network_ports(session, network_id):
def get_ha_agents(session, network_id=None, router_id=None):
query = session.query(agent_model.Agent.host).distinct()
query = query.join(l3_hamode_db.L3HARouterAgentPortBinding,
l3_hamode_db.L3HARouterAgentPortBinding.l3_agent_id ==
query = query.join(l3ha_model.L3HARouterAgentPortBinding,
l3ha_model.L3HARouterAgentPortBinding.l3_agent_id ==
agent_model.Agent.id)
if router_id:
query = query.filter(
l3_hamode_db.L3HARouterAgentPortBinding.router_id == router_id)
l3ha_model.L3HARouterAgentPortBinding.router_id == router_id)
elif network_id:
query = query.join(models_v2.Port, models_v2.Port.device_id ==
l3_hamode_db.L3HARouterAgentPortBinding.router_id)
l3ha_model.L3HARouterAgentPortBinding.router_id)
query = query.filter(models_v2.Port.network_id == network_id,
models_v2.Port.status == const.PORT_STATUS_ACTIVE,
models_v2.Port.device_owner.in_(HA_ROUTER_PORTS))

View File

@ -18,9 +18,9 @@ from oslo_utils import uuidutils
from neutron.common import constants as n_const
from neutron.common import utils
from neutron import context
from neutron.db import l3_hamode_db
from neutron.db.models import l3 as l3_models
from neutron.db.models import l3_attrs
from neutron.db.models import l3ha as l3ha_model
from neutron.db import models_v2
from neutron.extensions import portbindings
from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db
@ -123,7 +123,7 @@ class TestL2PopulationDBTestCase(testlib_api.SqlTestCase):
if network_id == TEST_HA_NETWORK_ID:
agent = self.get_l3_agent_by_host(host)
haport_bindings_cls = l3_hamode_db.L3HARouterAgentPortBinding
haport_bindings_cls = l3ha_model.L3HARouterAgentPortBinding
habinding_kwarg = {'port_id': port_id,
'router_id': device_id,
'l3_agent_id': agent['id'],