diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-06 16:30:11 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-06 16:30:11 +0000 |
commit | 36091a7ed7ad553d5cbb5dcfde0090e1e762bc34 (patch) | |
tree | b485f75d70d3f64669fa19479525428a8f27778b /nova | |
parent | 58be0ca8b8204bce6cbb6747d46ca595c5843a30 (diff) | |
parent | 11bcf2676c326451772a7280b45180882d5dc9a7 (diff) | |
download | nova-36091a7ed7ad553d5cbb5dcfde0090e1e762bc34.tar.gz |
Merge "Follow up for the PCI in placement series"
Diffstat (limited to 'nova')
-rw-r--r-- | nova/compute/pci_placement_translator.py | 10 | ||||
-rw-r--r-- | nova/objects/instance.py | 4 | ||||
-rw-r--r-- | nova/scheduler/client/report.py | 4 | ||||
-rw-r--r-- | nova/tests/unit/compute/test_resource_tracker.py | 2 |
4 files changed, 5 insertions, 15 deletions
diff --git a/nova/compute/pci_placement_translator.py b/nova/compute/pci_placement_translator.py index 5a1a060d76..d6d7fdd6f1 100644 --- a/nova/compute/pci_placement_translator.py +++ b/nova/compute/pci_placement_translator.py @@ -401,16 +401,6 @@ class PlacementView: } raise exception.PlacementPciException(error=msg) - if 'instance_uuid' in dev and dev.instance_uuid: - # The device is allocated to an instance, so we need to make sure - # the device will be allocated to the instance in placement too - # FIXME(gibi): During migration the source host allocation should - # be tight to the migration_uuid as consumer in placement. But - # the PciDevice.instance_uuid is still pointing to the - # instance_uuid both on the source and the dest. So we need to - # check for running migrations. - pass - def _remove_child(self, dev: pci_device.PciDevice) -> None: rp_name = self._get_rp_name_for_child(dev) self._ensure_rp(rp_name).remove_child(dev) diff --git a/nova/objects/instance.py b/nova/objects/instance.py index 0bdf4af31e..fed1a7c58b 100644 --- a/nova/objects/instance.py +++ b/nova/objects/instance.py @@ -1245,8 +1245,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject, # return early to avoid an extra lazy load on self.pci_requests # if there are no devices allocated to be filtered return [] - else: - devs = self.pci_devices.objects + + devs = self.pci_devices.objects if request_id is not None: devs = [dev for dev in devs if dev.request_id == request_id] diff --git a/nova/scheduler/client/report.py b/nova/scheduler/client/report.py index 2896a07f13..1242752be1 100644 --- a/nova/scheduler/client/report.py +++ b/nova/scheduler/client/report.py @@ -1391,8 +1391,8 @@ class SchedulerReportClient(object): # the conflict exception. This signals the resource tracker to # redrive the update right away rather than waiting until the # next periodic. - with excutils.save_and_reraise_exception(): - self._clear_provider_cache_for_tree(rp_uuid) + self._clear_provider_cache_for_tree(rp_uuid) + raise except helper_exceptions: # Invalidate the relevant part of the cache. It gets rebuilt on # the next pass. diff --git a/nova/tests/unit/compute/test_resource_tracker.py b/nova/tests/unit/compute/test_resource_tracker.py index a3b005b80f..b81d7365d2 100644 --- a/nova/tests/unit/compute/test_resource_tracker.py +++ b/nova/tests/unit/compute/test_resource_tracker.py @@ -1973,7 +1973,7 @@ class TestUpdateComputeNode(BaseTestCase): """Assert that if the pci placement reporting code tries to remove inventory with allocation from placement due to invalid hypervisor or [pci]device_spec reconfiguration then the InventoryInUse error from - placement is propagated and makes the compute startup to fail. + placement is propagated and makes the compute startup fail. """ compute_obj = _COMPUTE_NODE_FIXTURES[0].obj_clone() self._setup_rt() |