Merge "Populates retry info when unshelve offloaded instance"

This commit is contained in:
Jenkins 2015-03-20 07:49:23 +00:00 committed by Gerrit Code Review
commit 37a6c601f3
2 changed files with 16 additions and 4 deletions

View File

@ -758,6 +758,8 @@ class ComputeTaskManager(base.Base):
with compute_utils.EventReporter(context, 'schedule_instances',
instance.uuid):
filter_properties = {}
scheduler_utils.populate_retry(filter_properties,
instance.uuid)
hosts = self._schedule_instances(context, image,
filter_properties,
instance)

View File

@ -1514,7 +1514,8 @@ class _BaseTaskTestCase(object):
instance = self._create_fake_instance_obj()
instance.vm_state = vm_states.SHELVED_OFFLOADED
instance.save()
filter_properties = {}
filter_properties = {'retry': {'num_attempts': 1,
'hosts': []}}
system_metadata = instance.system_metadata
self.mox.StubOutWithMock(self.conductor_manager.image_api, 'get')
@ -1531,7 +1532,11 @@ class _BaseTaskTestCase(object):
'limits': {}}])
self.conductor_manager.compute_rpcapi.unshelve_instance(self.context,
instance, 'fake_host', image='fake_image',
filter_properties={'limits': {}}, node='fake_node')
filter_properties={'limits': {},
'retry': {'num_attempts': 1,
'hosts': [['fake_host',
'fake_node']]}},
node='fake_node')
self.mox.ReplayAll()
system_metadata['shelved_at'] = timeutils.utcnow()
@ -1592,7 +1597,8 @@ class _BaseTaskTestCase(object):
instance = self._create_fake_instance_obj()
instance.vm_state = vm_states.SHELVED_OFFLOADED
instance.save()
filter_properties = {}
filter_properties = {'retry': {'num_attempts': 1,
'hosts': []}}
system_metadata = instance.system_metadata
self.mox.StubOutWithMock(self.conductor_manager.image_api, 'get')
@ -1609,7 +1615,11 @@ class _BaseTaskTestCase(object):
'limits': {}}])
self.conductor_manager.compute_rpcapi.unshelve_instance(self.context,
instance, 'fake_host', image=None,
filter_properties={'limits': {}}, node='fake_node')
filter_properties={'limits': {},
'retry': {'num_attempts': 1,
'hosts': [['fake_host',
'fake_node']]}},
node='fake_node')
self.mox.ReplayAll()
system_metadata['shelved_at'] = timeutils.utcnow()