Version change in ObjectField does not work with back-levelling
Bug #1275675 reported by
Paul Murray
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
Wishlist
|
Unassigned | ||
oslo.versionedobjects |
Expired
|
Wishlist
|
Unassigned |
Bug Description
When a NovaObject primitive is deserialized the object version is checked and an IncompatibleObj
If a NovaObject A has an ObjectField b containing NovaObject B and it is B that has the incompatible version, the version number in the exception will be the the locally supported version for B. The desrialization will then attempt to backport the primitive of object A to the locally supported version number for object B.
description: | updated |
Changed in nova: | |
importance: | Undecided → Wishlist |
Changed in nova: | |
assignee: | nobody → Paul Murray (pmurray) |
Changed in nova: | |
status: | In Progress → Confirmed |
Changed in nova: | |
assignee: | Nikola Đipanov (ndipanov) → nobody |
status: | In Progress → Confirmed |
To post a comment you must log in.
The following test demonstrates the bug:
given these class versions:
class Container( base.NovaObject ): ObjectField( 'MyObj' ),
VERSION = '5.5'
fields = {
'nested': fields.
}
class MyObj(base. NovaPersistentO bject, base.NovaObject):
VERSION = '1.5'
<...rest of object code cut out...>
The following test passes:
def test_deserializ e_nested_ object( self): Serializer( )
ser._conductor = mock.Mock()
ser._conductor .object_ backport. return_ value = 'backported' primitive( ) _entity( self.context, primitive)
self.assertEqu al('backported' , result)
ser._conductor .object_ backport. assert_ called_ with(self. context,
primitive,
'1.5' )
ser = base.NovaObject
A = Container()
B = MyObj()
A.nested = B
B.VERSION = '1.25'
primitive = A.obj_to_
result = ser.deserialize
So _conductor. object_ backport is being called with the primitive of A and the version number of B.