Browse Source

Merge "Remove stale nested backport from InstancePCIRequests" into stable/ussuri

changes/08/735208/1
Zuul 4 weeks ago
committed by Gerrit Code Review
parent
commit
039b42d2b0
2 changed files with 0 additions and 22 deletions
  1. +0
    -8
      nova/objects/instance_pci_requests.py
  2. +0
    -14
      nova/tests/unit/objects/test_instance_pci_requests.py

+ 0
- 8
nova/objects/instance_pci_requests.py View File

@@ -82,14 +82,6 @@ class InstancePCIRequests(base.NovaObject,
'requests': fields.ListOfObjectsField('InstancePCIRequest'),
}

def obj_make_compatible(self, primitive, target_version):
target_version = versionutils.convert_version_to_tuple(target_version)
if target_version < (1, 1) and 'requests' in primitive:
for index, request in enumerate(self.requests):
request.obj_make_compatible(
primitive['requests'][index]['nova_object.data'], '1.0')
primitive['requests'][index]['nova_object.version'] = '1.0'

@classmethod
def obj_from_db(cls, context, instance_uuid, db_requests):
self = cls(context=context, requests=[],


+ 0
- 14
nova/tests/unit/objects/test_instance_pci_requests.py View File

@@ -99,20 +99,6 @@ class _TestInstancePCIRequests(object):
self.assertEqual('alias_2', requests.requests[1].alias_name)
self.assertTrue(requests.requests[1].is_new)

def test_backport_1_0(self):
requests = objects.InstancePCIRequests(
requests=[objects.InstancePCIRequest(count=1,
request_id=FAKE_UUID),
objects.InstancePCIRequest(count=2,
request_id=FAKE_UUID)])
primitive = requests.obj_to_primitive(target_version='1.0')
backported = objects.InstancePCIRequests.obj_from_primitive(
primitive)
self.assertEqual('1.0', backported.VERSION)
self.assertEqual(2, len(backported.requests))
self.assertFalse(backported.requests[0].obj_attr_is_set('request_id'))
self.assertFalse(backported.requests[1].obj_attr_is_set('request_id'))

def test_obj_from_db(self):
req = objects.InstancePCIRequests.obj_from_db(None, FAKE_UUID, None)
self.assertEqual(FAKE_UUID, req.instance_uuid)


Loading…
Cancel
Save