Refactor NetworkDhcpAgentBinding

This patch set is for breaking the circular dependency between
Agent/NetworkDhcpAgentBinding. The goal of this is to implement
Agent OVO

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I3f2a8bcc6f8644e94e377dc916fba6743cb230bc
This commit is contained in:
tonytan4ever
2016-06-10 14:32:35 -04:00
parent 77e03443ff
commit 63fc967a8f
7 changed files with 69 additions and 44 deletions

View File

@@ -21,6 +21,7 @@ import six
import testscenarios
from neutron import context
from neutron.db.network_dhcp_agent_binding import models as ndab_model
from neutron.db import agents_db
from neutron.db import agentschedulers_db
from neutron.db import common_db_mixin
@@ -374,9 +375,9 @@ class TestAutoSchedule(test_dhcp_sch.TestDhcpSchedulerBaseTestCase,
def _get_hosted_networks_on_dhcp_agent(self, agent_id):
query = self.ctx.session.query(
agentschedulers_db.NetworkDhcpAgentBinding.network_id)
ndab_model.NetworkDhcpAgentBinding.network_id)
query = query.filter(
agentschedulers_db.NetworkDhcpAgentBinding.dhcp_agent_id ==
ndab_model.NetworkDhcpAgentBinding.dhcp_agent_id ==
agent_id)
return [item[0] for item in query]