diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-01-30 11:18:58 -0800 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-01-31 15:38:17 -0800 |
| commit | dd5f2c82d7d23a3bac3aabaa8cc58a10d4b70fcf (patch) | |
| tree | bdceb1e5e78a47a699a9e7c2665ffdde1817dd42 /nova/tests | |
| parent | 45e92d47038514fc05ae17a8a38dae1b337c15fe (diff) | |
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
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/network/test_manager.py | 11 |
1 files changed, 6 insertions, 5 deletions
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, |
