Require List objects to be able to backlevel their contents
Right now, a client declares its supported version of a given object automatically in the remoted calls it makes to conductor. However, in the case of things like InstanceList.get_by_foo(), they are reporting the version of their InstanceList object, not their Instance object. Conductor fills a version-matching InstanceList object with brand new Instance objects, which the client, of course, barfs on. There may be a better way to handle this going forward, but for now, stop the bleeding by requiring a version bump to the corresponding List object whenever the object type it contains takes a version bump. This adds a test to validate that all the objects registered have a suitable mapping for the current version in the tree. Since this actually caused a breakage in the Instance object recently, this also bumps the InstanceList version so that conductors running this commit (or later) will properly send version 1.9 Instance objects to Havana clients and version 1.10+ to newer ones. Change-Id: I2668dead4784fbd0411d1b6372a9a8006eeb2e84 Related-Bug: #1258256 Closes-Bug: #1254902
This commit is contained in:
@@ -147,11 +147,17 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject):
|
||||
class AggregateList(base.ObjectListBase, base.NovaObject):
|
||||
# Version 1.0: Initial version
|
||||
# Version 1.1: Added key argument to get_by_host()
|
||||
# Aggregate <= version 1.1
|
||||
VERSION = '1.1'
|
||||
|
||||
fields = {
|
||||
'objects': fields.ListOfObjectsField('Aggregate'),
|
||||
}
|
||||
child_versions = {
|
||||
'1.0': '1.1',
|
||||
'1.1': '1.1',
|
||||
# NOTE(danms): Aggregate was at 1.1 before we added this
|
||||
}
|
||||
|
||||
@base.remotable_classmethod
|
||||
def get_all(cls, context):
|
||||
|
Reference in New Issue
Block a user