Improve waiter output

Add an extra newline, show the name of the task (from start()), and show
the first step as a "Gathering information" message on the progressbar.
This commit is contained in:
Joshua Boniface 2023-11-09 21:34:29 -05:00
parent 08411708f6
commit d7ea705e31
2 changed files with 12 additions and 1 deletions

View File

@ -247,6 +247,8 @@ def confirm_opt(message):
print("Aborted.") print("Aborted.")
exit(0) exit(0)
click.echo()
del kwargs["confirm_flag"] del kwargs["confirm_flag"]
return function(*args, **kwargs) return function(*args, **kwargs)

View File

@ -91,9 +91,18 @@ def wait_for_celery_task(CLI_CONFIG, task_detail):
# Start following the task state, updating progress as we go # Start following the task state, updating progress as we go
total_task = task_status.get("total") total_task = task_status.get("total")
echo(
CLI_CONFIG,
task_status.get("status") + ":",
)
with progressbar(length=total_task, show_eta=False) as bar: with progressbar(length=total_task, show_eta=False) as bar:
last_task = 0 last_task = 0
maxlen = 0 maxlen = 21
echo(
CLI_CONFIG,
" " + "Gathering information",
newline=False,
)
while True: while True:
sleep(0.25) sleep(0.25)
if task_status.get("state") != "RUNNING": if task_status.get("state") != "RUNNING":