OVO obj_make_compatible does not handle if parent object reduced a lenght of a list field
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.versionedobjects |
New
|
Undecided
|
Unassigned |
Bug Description
In Nova we have the following relationship (reduced the size of the objects for clarity):
class Architecture(
X86_64 = arch.X86_64
RISCV32 = arch.RISCV32
class ArchitectureFie
AUTO_TYPE = Architecture()
class HVSpec(
# bumped to 1.3 when RISCV32 introduced
VERSION = '1.3'
fields = {
'arch': fields.
}
class ComputeNode(
# bumped to 1.20 when RISCV32 introduced
VERSION = '1.20'
fields = {
}
Now assume having a ComputeNode object with version 1.20 using RISCV32 in one of the HVSpecs in the supported_hv_specs list and you want to backport that object to ComputeNode 1.19 (HVSpec 1.2).
The HVSpec object cannot backport itself as there is no valid old version of the object. So only the parent object, ComputeNode, can do a meaningful backport. It can remove the supported_hv_specs list those HVSpec objects that has too new arch value.
So the impl for that is something like:
def obj_make_
if target_version < (1, 20) and 'supported_
if hvspec[
]
# [removed the older backports]
However this fail on the OVO side when doing the HVSpec backport at [1]:
File "/home/
primitive = compute.
File "/home/
return captured_
File "/home/
result = self._original_
File "/home/
self.
File "/home/
return self.obj_
File "/home/
super(
File "/home/
self.
File "/home/
_get_
File "/home/
backport_
File "/home/
lambda ver: _do_subobject_
File "/home/
element.
IndexError: list index out of range
What happens is that in [1] the primitive is the reduced list but the supported_hv_specs field on the parent obj still having all the original HVSpec OVOs. Basically the implementation assumes that a list in primitives has the same lenght as a list field value.
description: | updated |