Skip to content

Commit 11bcf26

Browse files
committed
Follow up for the PCI in placement series
Fixed various small issues from the already merged (or being merged) patches. The logic behind the dropped FIXME and empty condition are handled in the update_allocations() calls of the translator already. The removal of excutils.save_and_reraise_exception from the report client is safe as self._clear_provider_cache_for_tree does not raise. blueprint: pci-device-tracking-in-placement Change-Id: If87dedc6a14f7b116c4238e7534b67574428c01c
1 parent ccab6fe commit 11bcf26

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

nova/compute/pci_placement_translator.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,16 +401,6 @@ def _add_dev(
401401
}
402402
raise exception.PlacementPciException(error=msg)
403403

404-
if 'instance_uuid' in dev and dev.instance_uuid:
405-
# The device is allocated to an instance, so we need to make sure
406-
# the device will be allocated to the instance in placement too
407-
# FIXME(gibi): During migration the source host allocation should
408-
# be tight to the migration_uuid as consumer in placement. But
409-
# the PciDevice.instance_uuid is still pointing to the
410-
# instance_uuid both on the source and the dest. So we need to
411-
# check for running migrations.
412-
pass
413-
414404
def _remove_child(self, dev: pci_device.PciDevice) -> None:
415405
rp_name = self._get_rp_name_for_child(dev)
416406
self._ensure_rp(rp_name).remove_child(dev)

nova/objects/instance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,8 @@ def get_pci_devices(
12451245
# return early to avoid an extra lazy load on self.pci_requests
12461246
# if there are no devices allocated to be filtered
12471247
return []
1248-
else:
1249-
devs = self.pci_devices.objects
1248+
1249+
devs = self.pci_devices.objects
12501250

12511251
if request_id is not None:
12521252
devs = [dev for dev in devs if dev.request_id == request_id]

nova/scheduler/client/report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,8 +1391,8 @@ def catch_all(rp_uuid):
13911391
# the conflict exception. This signals the resource tracker to
13921392
# redrive the update right away rather than waiting until the
13931393
# next periodic.
1394-
with excutils.save_and_reraise_exception():
1395-
self._clear_provider_cache_for_tree(rp_uuid)
1394+
self._clear_provider_cache_for_tree(rp_uuid)
1395+
raise
13961396
except helper_exceptions:
13971397
# Invalidate the relevant part of the cache. It gets rebuilt on
13981398
# the next pass.

nova/tests/unit/compute/test_resource_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ def test_update_pci_reporting_allocation_in_use_error_propagated(self):
19731973
"""Assert that if the pci placement reporting code tries to remove
19741974
inventory with allocation from placement due to invalid hypervisor
19751975
or [pci]device_spec reconfiguration then the InventoryInUse error from
1976-
placement is propagated and makes the compute startup to fail.
1976+
placement is propagated and makes the compute startup fail.
19771977
"""
19781978
compute_obj = _COMPUTE_NODE_FIXTURES[0].obj_clone()
19791979
self._setup_rt()

0 commit comments

Comments
 (0)