Merge "request_spec['instance_uuids'] as list in resize"
This commit is contained in:
+1
-1
@@ -1499,7 +1499,7 @@ class API(base.Base):
|
||||
|
||||
request_spec = {
|
||||
'instance_type': new_instance_type,
|
||||
'instance_uuids': instance['uuid'],
|
||||
'instance_uuids': [instance['uuid']],
|
||||
'instance_properties': instance}
|
||||
|
||||
filter_properties = {'ignore_hosts': []}
|
||||
|
||||
@@ -3331,6 +3331,12 @@ class ComputeAPITestCase(BaseTestCase):
|
||||
request_spec = msg['args']['request_spec']
|
||||
filter_properties = msg['args']['filter_properties']
|
||||
instance_properties = request_spec['instance_properties']
|
||||
# resize with flavor_id = None will still send instance_type
|
||||
self.assertEqual(request_spec['instance_type'],
|
||||
orig_instance_type)
|
||||
self.assertEqual(request_spec['instance_uuids'],
|
||||
[instance['uuid']])
|
||||
self.assertEqual(instance_properties['uuid'], instance['uuid'])
|
||||
self.assertEqual(instance_properties['host'], 'host2')
|
||||
# Ensure the instance passed to us has been updated with
|
||||
# progress set to 0 and task_state set to RESIZE_PREP.
|
||||
@@ -3345,6 +3351,7 @@ class ComputeAPITestCase(BaseTestCase):
|
||||
instance = self._create_fake_instance(dict(host='host2'))
|
||||
instance = db.instance_get_by_uuid(context, instance['uuid'])
|
||||
instance = jsonutils.to_primitive(instance)
|
||||
orig_instance_type = instance['instance_type']
|
||||
self.compute.run_instance(self.context, instance=instance)
|
||||
# We need to set the host to something 'known'. Unfortunately,
|
||||
# the compute manager is using a cached copy of FLAGS.host,
|
||||
|
||||
@@ -241,8 +241,9 @@ class SchedulerManagerTestCase(test.TestCase):
|
||||
|
||||
self.mox.StubOutWithMock(db, 'instance_update_and_get_original')
|
||||
|
||||
request_spec = {'instance_properties':
|
||||
{'uuid': fake_instance_uuid}}
|
||||
request_spec = {'instance_type': 'fake_type',
|
||||
'instance_uuids': [fake_instance_uuid],
|
||||
'instance_properties': {'uuid': fake_instance_uuid}}
|
||||
kwargs = {
|
||||
'context': self.context,
|
||||
'image': 'fake_image',
|
||||
|
||||
Reference in New Issue
Block a user