Merge "Simplify filter_scheduler.populate_retry()"

This commit is contained in:
Jenkins 2014-06-11 01:44:56 +00:00 committed by Gerrit Code Review
commit 34c02de775
1 changed files with 6 additions and 9 deletions

View File

@ -237,16 +237,13 @@ class FilterScheduler(driver.Scheduler):
# re-scheduling is disabled.
return
retry = filter_properties.pop('retry', {})
# retry is enabled, update attempt count:
if retry:
retry['num_attempts'] += 1
else:
retry = {
'num_attempts': 1,
# retry is enabled, update attempt count
retry = filter_properties.setdefault(
'retry', {
'num_attempts': 0,
'hosts': [] # list of compute hosts tried
}
filter_properties['retry'] = retry
})
retry['num_attempts'] += 1
instance_uuid = instance_properties.get('uuid')
self._log_compute_error(instance_uuid, retry)