Merge "Pass the correct image to build_request_spec in conductor.rebuild_instance" into stable/ocata
This commit is contained in:
commit
b4ff5a8d8c
|
@ -712,8 +712,11 @@ class ComputeTaskManager(base.Base):
|
|||
# RequestSpec object - probably because the instance is old
|
||||
# We need to mock that the old way
|
||||
filter_properties = {'ignore_hosts': [instance.host]}
|
||||
# build_request_spec expects a primitive image dict
|
||||
image_meta = nova_object.obj_to_primitive(
|
||||
instance.image_meta)
|
||||
request_spec = scheduler_utils.build_request_spec(
|
||||
context, image_ref, [instance])
|
||||
context, image_meta, [instance])
|
||||
elif recreate:
|
||||
# NOTE(sbauza): Augment the RequestSpec object by excluding
|
||||
# the source host for avoiding the scheduler to pick it
|
||||
|
|
|
@ -1239,6 +1239,9 @@ class _BaseTaskTestCase(object):
|
|||
self.conductor_manager.rebuild_instance(context=self.context,
|
||||
instance=inst_obj,
|
||||
**rebuild_args)
|
||||
bs_mock.assert_called_once_with(
|
||||
self.context, obj_base.obj_to_primitive(inst_obj.image_meta),
|
||||
[inst_obj])
|
||||
fp_mock.assert_called_once_with(self.context, request_spec,
|
||||
filter_properties)
|
||||
select_dest_mock.assert_called_once_with(self.context, fake_spec)
|
||||
|
|
Loading…
Reference in New Issue