Merge "Remove legacy regeneration of RequestSpec in MigrationTask"
This commit is contained in:
commit
aa95d71c83
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user