objects: Rename 'nova.objects.instance_numa_topology'

Drop the '_topology' suffix. It's not done for the host NUMA topology
objects (those are found in 'nova.objects.numa') and like that file,
this file holds many 'InstanceNUMA*' objects and not just
'InstanceNUMATopology'. This has annoyed me for years so just go fix the
thing.

Change-Id: I283538771a868747f05721a9207db5717b8b68d3
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2019-07-04 15:45:46 +01:00 committed by Eric Fried
parent c619c3b584
commit 56f193468a
8 changed files with 18 additions and 23 deletions

View File

@ -48,7 +48,7 @@ def register_all():
__import__('nova.objects.instance_group')
__import__('nova.objects.instance_info_cache')
__import__('nova.objects.instance_mapping')
__import__('nova.objects.instance_numa_topology')
__import__('nova.objects.instance_numa')
__import__('nova.objects.instance_pci_requests')
__import__('nova.objects.keypair')
__import__('nova.objects.migrate_data')

View File

@ -81,7 +81,7 @@ from nova.tests.unit.image import fake as fake_image
from nova.tests.unit import matchers
from nova.tests.unit.objects import test_diagnostics
from nova.tests.unit.objects import test_flavor
from nova.tests.unit.objects import test_instance_numa_topology
from nova.tests.unit.objects import test_instance_numa
from nova.tests.unit.objects import test_migration
from nova.tests.unit import utils as test_utils
from nova import utils
@ -5642,9 +5642,8 @@ class ComputeTestCase(BaseTestCase,
self._test_confirm_resize(power_on=False)
def test_confirm_resize_with_migration_context(self):
numa_topology = (
test_instance_numa_topology.get_fake_obj_numa_topology(
self.context))
numa_topology = test_instance_numa.get_fake_obj_numa_topology(
self.context)
self._test_confirm_resize(power_on=True, numa_topology=numa_topology)
@mock.patch('nova.scheduler.client.report.SchedulerReportClient.'
@ -5965,9 +5964,8 @@ class ComputeTestCase(BaseTestCase,
remove_old_vm_state=True)
def test_finish_revert_resize_migration_context(self):
numa_topology = (
test_instance_numa_topology.get_fake_obj_numa_topology(
self.context))
numa_topology = test_instance_numa.get_fake_obj_numa_topology(
self.context)
self._test_finish_revert_resize(power_on=True,
numa_topology=numa_topology)
@ -13066,9 +13064,8 @@ class EvacuateHostTestCase(BaseTestCase):
migration.save.assert_called_once_with()
def test_rebuild_numa_migration_context_honoured(self):
numa_topology = (
test_instance_numa_topology.get_fake_obj_numa_topology(
self.context))
numa_topology = test_instance_numa.get_fake_obj_numa_topology(
self.context)
# NOTE(ndipanov): Make sure that we pass the topology from the context
def fake_spawn(context, instance, image_meta, injected_files,

View File

@ -30,7 +30,7 @@ from nova.tests.unit import fake_block_device
from nova.tests.unit import fake_instance
from nova.tests.unit.objects import test_compute_node
from nova.tests.unit.objects import test_instance_device_metadata
from nova.tests.unit.objects import test_instance_numa_topology
from nova.tests.unit.objects import test_instance_numa
from nova.tests.unit.objects import test_instance_pci_requests
from nova.tests.unit.objects import test_keypair
from nova.tests.unit.objects import test_migration
@ -107,7 +107,7 @@ class TargetDBSetupTaskTestCase(
objects.InstancePCIRequest(
**test_instance_pci_requests.fake_pci_requests[0])])
inst.numa_topology = objects.InstanceNUMATopology(
cells=test_instance_numa_topology.fake_obj_numa_topology.cells)
cells=test_instance_numa.fake_obj_numa_topology.cells)
inst.trusted_certs = objects.TrustedCerts(ids=[uuids.cert])
inst.vcpu_model = test_vcpu_model.fake_vcpumodel
inst.keypairs = objects.KeyPairList(objects=[

View File

@ -40,7 +40,7 @@ from nova.tests.unit import fake_instance
from nova.tests.unit.objects import test_instance_device_metadata
from nova.tests.unit.objects import test_instance_fault
from nova.tests.unit.objects import test_instance_info_cache
from nova.tests.unit.objects import test_instance_numa_topology
from nova.tests.unit.objects import test_instance_numa
from nova.tests.unit.objects import test_instance_pci_requests
from nova.tests.unit.objects import test_migration_context as test_mig_ctxt
from nova.tests.unit.objects import test_objects
@ -151,8 +151,7 @@ class _TestInstanceObject(object):
'extra.migration_context', 'extra.keypairs',
'extra.device_metadata', 'extra.trusted_certs'])
fake_topology = (test_instance_numa_topology.
fake_db_topology['numa_topology'])
fake_topology = test_instance_numa.fake_db_topology['numa_topology']
fake_requests = jsonutils.dumps(test_instance_pci_requests.
fake_pci_requests)
fake_devices_metadata = \
@ -1046,7 +1045,7 @@ class _TestInstanceObject(object):
def test_create_with_extras(self):
inst = objects.Instance(context=self.context,
uuid=self.fake_instance['uuid'],
numa_topology=test_instance_numa_topology.fake_obj_numa_topology,
numa_topology=test_instance_numa.fake_obj_numa_topology,
pci_requests=objects.InstancePCIRequests(
requests=[
objects.InstancePCIRequest(count=123,
@ -1373,7 +1372,7 @@ class _TestInstanceObject(object):
{"migration_context": None})
def test_mutated_migration_context(self):
numa_topology = (test_instance_numa_topology.
numa_topology = (test_instance_numa.
fake_obj_numa_topology.obj_clone())
numa_topology.cells[0].memory = 1024
numa_topology.cells[1].memory = 1024
@ -1416,8 +1415,7 @@ class _TestInstanceObject(object):
self.assertNotIn(attr, inst)
def test_clear_numa_topology(self):
numa_topology = (test_instance_numa_topology.
fake_obj_numa_topology.obj_clone())
numa_topology = test_instance_numa.fake_obj_numa_topology.obj_clone()
numa_topology.cells[0].id = 42
numa_topology.cells[1].id = 43

View File

@ -16,7 +16,7 @@ from oslo_utils.fixture import uuidsentinel as uuids
from nova import exception
from nova import objects
from nova.tests.unit.objects import test_instance_numa_topology
from nova.tests.unit.objects import test_instance_numa
from nova.tests.unit.objects import test_objects
@ -26,7 +26,7 @@ fake_migration_context_obj = objects.MigrationContext()
fake_migration_context_obj.instance_uuid = fake_instance_uuid
fake_migration_context_obj.migration_id = 42
fake_migration_context_obj.new_numa_topology = (
test_instance_numa_topology.fake_obj_numa_topology.obj_clone())
test_instance_numa.fake_obj_numa_topology.obj_clone())
fake_migration_context_obj.old_numa_topology = None
fake_migration_context_obj.new_pci_devices = objects.PciDeviceList()
fake_migration_context_obj.old_pci_devices = None

View File

@ -128,7 +128,7 @@ class TestNUMATopologyFilter(test.NoDBTestCase):
self.assertEqual(limits.cpu_allocation_ratio, 21)
self.assertEqual(limits.ram_allocation_ratio, 1.3)
@mock.patch('nova.objects.instance_numa_topology.InstanceNUMACell'
@mock.patch('nova.objects.instance_numa.InstanceNUMACell'
'.cpu_pinning_requested',
return_value=True)
def _do_test_numa_topology_filter_cpu_policy(