Skip to content
Snippets Groups Projects
Verified Commit 3762c340 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

cli/task: Ensure cli output is always in the same order

parent ed818702
No related branches found
Tags v0.16.0
1 merge request!245cli/task: Ensure cli output is always in the same order
......@@ -501,6 +501,8 @@ def list_tasks(
):
"""List tasks.
"""
from operator import itemgetter
scheduler = ctx.obj["scheduler"]
if not scheduler:
raise ValueError("Scheduler class (local/remote) must be instantiated")
......@@ -538,11 +540,11 @@ def list_tasks(
runs = {}
output.append("Found %d tasks\n" % (len(tasks)))
for task in tasks:
for task in sorted(tasks, key=itemgetter("id")):
output.append(pretty_print_task(task, full=True))
if runs.get(task["id"]):
output.append(click.style(" Executions:", bold=True))
for run in runs[task["id"]]:
for run in sorted(runs[task["id"]], key=itemgetter("id")):
output.append(pretty_print_run(run, indent=4))
click.echo("\n".join(output))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment