From d7ea705e31e65a0098fd98dcbb627ebdd1ee2d21 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Nov 2023 21:34:29 -0500 Subject: [PATCH] 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. --- client-cli/pvc/cli/cli.py | 2 ++ client-cli/pvc/cli/waiters.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client-cli/pvc/cli/cli.py b/client-cli/pvc/cli/cli.py index d0f8348d..dd7a4d5e 100644 --- a/client-cli/pvc/cli/cli.py +++ b/client-cli/pvc/cli/cli.py @@ -247,6 +247,8 @@ def confirm_opt(message): print("Aborted.") exit(0) + click.echo() + del kwargs["confirm_flag"] return function(*args, **kwargs) diff --git a/client-cli/pvc/cli/waiters.py b/client-cli/pvc/cli/waiters.py index 05b38ab4..6f2b4e02 100644 --- a/client-cli/pvc/cli/waiters.py +++ b/client-cli/pvc/cli/waiters.py @@ -91,9 +91,18 @@ def wait_for_celery_task(CLI_CONFIG, task_detail): # Start following the task state, updating progress as we go total_task = task_status.get("total") + echo( + CLI_CONFIG, + task_status.get("status") + ":", + ) with progressbar(length=total_task, show_eta=False) as bar: last_task = 0 - maxlen = 0 + maxlen = 21 + echo( + CLI_CONFIG, + " " + "Gathering information", + newline=False, + ) while True: sleep(0.25) if task_status.get("state") != "RUNNING":