|
|
@@ -42,18 +42,10 @@ def _sort_tasks(tasks):
|
|
|
constants.TASK_STATUS_ON_ERROR_ONLY and
|
|
|
t not in non_error_only_tasks]
|
|
|
|
|
|
- sorted_tasks = []
|
|
|
- try:
|
|
|
- sorted_tasks = utils.topological_graph_sorting(
|
|
|
- non_error_only_tasks, sort_key="task_type")
|
|
|
- sorted_tasks += utils.topological_graph_sorting(
|
|
|
- error_only_tasks, sort_key="task_type")
|
|
|
- except ValueError:
|
|
|
- LOG.warn(
|
|
|
- "Failed to sort tasks. Returning them in random order. "
|
|
|
- "Exception was: %s" % utils.get_exception_details())
|
|
|
- sorted_tasks = non_error_only_tasks
|
|
|
- sorted_tasks += error_only_tasks
|
|
|
+ sorted_tasks = sorted(
|
|
|
+ non_error_only_tasks, key=lambda t: t.get('index', 0))
|
|
|
+ sorted_tasks.extend(sorted(
|
|
|
+ error_only_tasks, key=lambda t: t.get('index', 0)))
|
|
|
|
|
|
return sorted_tasks
|
|
|
|