From dd5f2c82d7d23a3bac3aabaa8cc58a10d4b70fcf Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 30 Jan 2013 11:18:58 -0800 Subject: Split floating ip functionality into new file. This is to prepare for moving this code into network.api. There was one minor change made to associate_floating_ip. It no longer checks access to the fixed ip's network before associating the floating ip to the fixed ip. The calling side was already verifying access to the instance so this is unnecessary. A note was added to the method call to ensure future usage of associate_floating keeps this in mind. Part of blueprint optimize-nova-network Change-Id: I4fcda82eebee46d167e028bb68c8fedf2c3e03a1 --- nova/tests/network/test_manager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py index 2cc19bbb8..48183010f 100644 --- a/nova/tests/network/test_manager.py +++ b/nova/tests/network/test_manager.py @@ -24,6 +24,7 @@ from nova import db from nova.db.sqlalchemy import models from nova import exception from nova import ipv6 +from nova.network import floating_ips from nova.network import linux_net from nova.network import manager as network_manager from nova.network import model as net_model @@ -1577,7 +1578,7 @@ class BackdoorPortTestCase(test.TestCase): self.assertEqual(port, self.manager.backdoor_port) -class TestFloatingIPManager(network_manager.FloatingIP, +class TestFloatingIPManager(floating_ips.FloatingIP, network_manager.NetworkManager): """Dummy manager that implements FloatingIP.""" @@ -1667,8 +1668,8 @@ class FloatingIPTestCase(test.TestCase): 'fixed_ip_get', lambda _x, _y: fixed_ip) - self.stubs.Set(self.network, - '_get_network_by_id', + self.stubs.Set(self.network.db, + 'network_get', lambda _x, _y: network) self.stubs.Set(self.network.db, @@ -1725,8 +1726,8 @@ class FloatingIPTestCase(test.TestCase): 'fixed_ip_get_by_address', lambda _x, _y: fixed_ip) - self.stubs.Set(self.network, - '_get_network_by_id', + self.stubs.Set(self.network.db, + 'network_get', lambda _x, _y: network) self.stubs.Set(self.network.db, -- cgit