Remove legacy regeneration of RequestSpec in MigrationTask

Previously we regenerated the RequestSpec from details in the Instance
before we had the full original object available to us. That is no
longer necessary and means we will not honor some of the original
request. Remove that now.

Change-Id: I195d389ac59574724a5e7202ba1a17d92c53a676
Closes-Bug: #1675607
This commit is contained in:
Dan Smith 2017-03-24 07:02:29 -07:00
parent 0191fedcd0
commit 8c3aa8df24
2 changed files with 0 additions and 16 deletions

View File

@ -33,7 +33,6 @@ class MigrationTask(base.TaskBase):
self.scheduler_client = scheduler_client
def _execute(self):
image = self.request_spec.image
self.quotas = objects.Quotas.from_reservations(self.context,
self.reservations,
instance=self.instance)
@ -46,13 +45,6 @@ class MigrationTask(base.TaskBase):
scheduler_utils.populate_retry(legacy_props,
self.instance.uuid)
# TODO(sbauza): Remove that RequestSpec rehydratation once
# scheduler.utils methods use directly the NovaObject.
self.request_spec = objects.RequestSpec.from_components(
self.context, self.instance.uuid, image,
self.flavor, self.instance.numa_topology,
self.instance.pci_requests, legacy_props, None,
self.instance.availability_zone)
# NOTE(sbauza): Force_hosts/nodes needs to be reset
# if we want to make sure that the next destination
# is not forced to be the original host

View File

@ -68,16 +68,8 @@ class MigrationTaskTestCase(test.NoDBTestCase):
task = self._generate_task()
request_spec_from_components.return_value = self.request_spec
legacy_request_spec = self.request_spec.to_legacy_request_spec_dict()
expected_props = {'retry': {'num_attempts': 1,
'hosts': [['host1', None]]},
'limits': {}}
task.execute()
request_spec_from_components.assert_called_once_with(
self.context, self.instance.uuid, self.request_spec.image,
task.flavor, self.instance.numa_topology,
self.instance.pci_requests, expected_props, None,
None)
quotas_mock.assert_called_once_with(self.context, self.reservations,
instance=self.instance)
sig_mock.assert_called_once_with(self.context, legacy_request_spec,