summaryrefslogtreecommitdiff
path: root/nova/tests/unit/conductor
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-11-29 11:05:19 +0000
committerStephen Finucane <sfinucan@redhat.com>2020-01-15 14:57:49 +0000
commitfadeedcdeaa949ae85938e78e2f34e75b9383721 (patch)
tree1b31e747edcfdf382a8e5a37c0fb469e513a21cd /nova/tests/unit/conductor
parentbf7ea80c4d50e61dca349ccf7ca8d72cf5fa071e (diff)
downloadnova-fadeedcdeaa949ae85938e78e2f34e75b9383721.tar.gz
nova-net: Remove layer of indirection in 'nova.network'
At some point in the past, there was only nova-network and its code could be found in 'nova.network'. Neutron was added and eventually found itself (mostly!) in the 'nova.network.neutronv2' submodule. With nova-network now gone, we can remove one layer of indirection and move the code from 'nova.network.neutronv2' back up to 'nova.network', mirroring what we did with the old nova-volume code way back in 2012 [1]. To ensure people don't get nova-network and 'nova.network' confused, 'neutron' is retained in filenames. [1] https://review.opendev.org/#/c/14731/ Change-Id: I329f0fd589a4b2e0426485f09f6782f94275cc07 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'nova/tests/unit/conductor')
-rw-r--r--nova/tests/unit/conductor/tasks/test_live_migrate.py8
-rw-r--r--nova/tests/unit/conductor/test_conductor.py9
2 files changed, 8 insertions, 9 deletions
diff --git a/nova/tests/unit/conductor/tasks/test_live_migrate.py b/nova/tests/unit/conductor/tasks/test_live_migrate.py
index 9eed38b159..7539e47f47 100644
--- a/nova/tests/unit/conductor/tasks/test_live_migrate.py
+++ b/nova/tests/unit/conductor/tasks/test_live_migrate.py
@@ -77,7 +77,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
self.addCleanup(_p.stop)
_p = mock.patch(
- 'nova.network.neutronv2.api.API.'
+ 'nova.network.neutron.API.'
'get_requested_resource_for_instance',
return_value=[])
self.mock_get_res_req = _p.start()
@@ -662,7 +662,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
_test()
- @mock.patch('nova.network.neutronv2.api.API.bind_ports_to_host')
+ @mock.patch('nova.network.neutron.API.bind_ports_to_host')
def test_bind_ports_on_destination_merges_profiles(self, mock_bind_ports):
"""Assert that if both the migration_data and the provider mapping
contains binding profile related information then such information is
@@ -686,7 +686,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
port_profiles={uuids.port1: {'allocation': uuids.dest_bw_rp,
'some-key': 'value'}})
- @mock.patch('nova.network.neutronv2.api.API.bind_ports_to_host')
+ @mock.patch('nova.network.neutron.API.bind_ports_to_host')
def test_bind_ports_on_destination_migration_data(self, mock_bind_ports):
"""Assert that if only the migration_data contains binding profile
related information then that is sent to neutron.
@@ -708,7 +708,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
vnic_types=None,
port_profiles={uuids.port1: {'some-key': 'value'}})
- @mock.patch('nova.network.neutronv2.api.API.bind_ports_to_host')
+ @mock.patch('nova.network.neutron.API.bind_ports_to_host')
def test_bind_ports_on_destination_provider_mapping(self, mock_bind_ports):
"""Assert that if only the provider mapping contains binding
profile related information then that is sent to neutron.
diff --git a/nova/tests/unit/conductor/test_conductor.py b/nova/tests/unit/conductor/test_conductor.py
index 3443c34e2c..1ca21ff4df 100644
--- a/nova/tests/unit/conductor/test_conductor.py
+++ b/nova/tests/unit/conductor/test_conductor.py
@@ -1517,7 +1517,7 @@ class _BaseTaskTestCase(object):
'select_destinations'),
mock.patch('nova.scheduler.utils.fill_provider_mapping',
new_callable=mock.NonCallableMock),
- mock.patch('nova.network.neutronv2.api.API.'
+ mock.patch('nova.network.neutron.API.'
'get_requested_resource_for_instance',
new_callable=mock.NonCallableMock)
) as (rebuild_mock, select_dest_mock, fill_provider_mock,
@@ -1736,10 +1736,9 @@ class _BaseTaskTestCase(object):
return_value=[[fake_selection]]),
mock.patch.object(fake_spec, 'reset_forced_destinations'),
mock.patch('nova.scheduler.utils.fill_provider_mapping'),
- mock.patch(
- 'nova.network.neutronv2.api.API.'
- 'get_requested_resource_for_instance',
- return_value=[])
+ mock.patch('nova.network.neutron.API.'
+ 'get_requested_resource_for_instance',
+ return_value=[])
) as (rebuild_mock, sig_mock, select_dest_mock, reset_fd,
fill_rp_mapping_mock, get_req_res_mock):
self.conductor_manager.rebuild_instance(context=self.context,