Skip to content

Commit d3ca735

Browse files
committed
Remove stale nested backport from InstancePCIRequests
Sometime in 2015, we removed the hard-coded obj_relationships mapping from parent objects which facilitated semi-automated child version backports. This was replaced by a manifest-of-versions mechanism where the client reports all the supported objects and versions during a backport request to conductor. The InstancePCIRequests object isn't technically an ObjectListBase, despite acting like one, and thus wasn't using the obj_relationships. Because of this, it was doing its own backporting of its child object, which was not removed in the culling of the static mechanism. Because we now no longer need to worry about sub-object backport chaining, when version 1.2 was added, no backport rule was added, and since the object does not call the base class' generic routine, proper backporting of the child object was not happening. All we need to do is remove the override to allow the base infrastructure to do the work. Change-Id: Id610a24c066707de5ddc0507e7ef26c421ba366c Closes-Bug: #1868033
1 parent 58aaffa commit d3ca735

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

nova/objects/instance_pci_requests.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ class InstancePCIRequests(base.NovaObject,
8282
'requests': fields.ListOfObjectsField('InstancePCIRequest'),
8383
}
8484

85-
def obj_make_compatible(self, primitive, target_version):
86-
target_version = versionutils.convert_version_to_tuple(target_version)
87-
if target_version < (1, 1) and 'requests' in primitive:
88-
for index, request in enumerate(self.requests):
89-
request.obj_make_compatible(
90-
primitive['requests'][index]['nova_object.data'], '1.0')
91-
primitive['requests'][index]['nova_object.version'] = '1.0'
92-
9385
@classmethod
9486
def obj_from_db(cls, context, instance_uuid, db_requests):
9587
self = cls(context=context, requests=[],

nova/tests/unit/objects/test_instance_pci_requests.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,6 @@ def test_get_by_instance_legacy(self):
9999
self.assertEqual('alias_2', requests.requests[1].alias_name)
100100
self.assertTrue(requests.requests[1].is_new)
101101

102-
def test_backport_1_0(self):
103-
requests = objects.InstancePCIRequests(
104-
requests=[objects.InstancePCIRequest(count=1,
105-
request_id=FAKE_UUID),
106-
objects.InstancePCIRequest(count=2,
107-
request_id=FAKE_UUID)])
108-
primitive = requests.obj_to_primitive(target_version='1.0')
109-
backported = objects.InstancePCIRequests.obj_from_primitive(
110-
primitive)
111-
self.assertEqual('1.0', backported.VERSION)
112-
self.assertEqual(2, len(backported.requests))
113-
self.assertFalse(backported.requests[0].obj_attr_is_set('request_id'))
114-
self.assertFalse(backported.requests[1].obj_attr_is_set('request_id'))
115-
116102
def test_obj_from_db(self):
117103
req = objects.InstancePCIRequests.obj_from_db(None, FAKE_UUID, None)
118104
self.assertEqual(FAKE_UUID, req.instance_uuid)

0 commit comments

Comments
 (0)