Merge "Use instance project/user when creating RequestSpec during resize reschedule" into stable/ocata

This commit is contained in:
Zuul 2018-07-04 16:55:07 +00:00 committed by Gerrit Code Review
commit 77ece76a70
2 changed files with 13 additions and 4 deletions

View File

@ -266,7 +266,8 @@ class ComputeTaskManager(base.Base):
request_spec = objects.RequestSpec.from_components(
context, instance.uuid, image,
flavor, instance.numa_topology, instance.pci_requests,
filter_properties, None, instance.availability_zone)
filter_properties, None, instance.availability_zone,
project_id=instance.project_id)
else:
# NOTE(sbauza): Resizes means new flavor, so we need to update the
# original RequestSpec object for make sure the scheduler verifies

View File

@ -1952,7 +1952,8 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
flavor=flavor,
availability_zone=None,
pci_requests=None,
numa_topology=None)
numa_topology=None,
project_id=self.context.project_id)
resvs = 'fake-resvs'
image = 'fake-image'
fake_spec = objects.RequestSpec(image=objects.ImageMeta())
@ -2005,7 +2006,8 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
flavor=flavor,
numa_topology=None,
pci_requests=None,
availability_zone=None)
availability_zone=None,
project_id=self.context.project_id)
image = 'fake-image'
resvs = 'fake-resvs'
@ -2085,6 +2087,7 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
instance_type_id=flavor['id'],
system_metadata={},
uuid=uuids.instance,
project_id=fakes.FAKE_PROJECT_ID,
user_id=fakes.FAKE_USER_ID,
flavor=flavor,
numa_topology=None,
@ -2108,6 +2111,10 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
set_vm_mock.assert_called_once_with(self.context, inst_obj.uuid,
'migrate_server', updates,
exception, legacy_request_spec)
spec_fc_mock.assert_called_once_with(
self.context, inst_obj.uuid, image, flavor, inst_obj.numa_topology,
inst_obj.pci_requests, {}, None, inst_obj.availability_zone,
project_id=inst_obj.project_id)
@mock.patch.object(scheduler_utils, 'setup_instance_group')
@mock.patch.object(objects.RequestSpec, 'from_components')
@ -2133,7 +2140,8 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
flavor=flavor,
availability_zone=None,
pci_requests=None,
numa_topology=None)
numa_topology=None,
project_id=self.context.project_id)
image = 'fake-image'
resvs = 'fake-resvs'
fake_spec = objects.RequestSpec(image=objects.ImageMeta())