test_dhcp_agent_scheduler: Network model to OVO

Change-Id: If7a9b06d29af1f0f5516bfb31ab7901dd55b403e
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
This commit is contained in:
Ihar Hrachyshka 2017-12-06 13:10:48 -08:00
parent 1ca38a1e1e
commit 2f7ab5402b
1 changed files with 1 additions and 3 deletions

View File

@ -26,7 +26,6 @@ import testscenarios
from neutron.db import agentschedulers_db as sched_db
from neutron.db import common_db_mixin
from neutron.db import models_v2
from neutron.extensions import dhcpagentscheduler
from neutron.objects import agent
from neutron.objects import network as network_obj
@ -69,8 +68,7 @@ class TestDhcpSchedulerBaseTestCase(testlib_api.SqlTestCase):
def _save_networks(self, networks):
for network_id in networks:
with self.ctx.session.begin(subtransactions=True):
self.ctx.session.add(models_v2.Network(id=network_id))
network_obj.Network(self.ctx, id=network_id).create()
def _test_schedule_bind_network(self, agents, network_id):
scheduler = dhcp_agent_scheduler.ChanceScheduler()