Add status messages during task query
This commit is contained in:
parent
8f3120baf3
commit
4dc4c975f1
|
@ -687,7 +687,10 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
||||||
|
|
||||||
if wait_flag:
|
if wait_flag:
|
||||||
# First validate that this is actually a valid task that is running
|
# First validate that this is actually a valid task that is running
|
||||||
|
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
||||||
|
echo(CLI_CONFIG, " done.")
|
||||||
|
echo(CLI_CONFIG, "")
|
||||||
if task_id in [i["id"] for i in retdata]:
|
if task_id in [i["id"] for i in retdata]:
|
||||||
task = [i for i in retdata if i["id"] == task_id][0]
|
task = [i for i in retdata if i["id"] == task_id][0]
|
||||||
retmsg = wait_for_celery_task(
|
retmsg = wait_for_celery_task(
|
||||||
|
@ -699,7 +702,10 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
||||||
retmsg = f"No task with ID {task_id} found."
|
retmsg = f"No task with ID {task_id} found."
|
||||||
finish(retcode, retmsg)
|
finish(retcode, retmsg)
|
||||||
else:
|
else:
|
||||||
|
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
||||||
|
echo(CLI_CONFIG, " done.")
|
||||||
|
echo(CLI_CONFIG, "")
|
||||||
finish(retcode, retdata, format_function)
|
finish(retcode, retdata, format_function)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue