cli: --wait for download-task
If task is not finished yet, wait for it and download output then. Fixes: https://pagure.io/koji/issue/2052
This commit is contained in:
parent
074d61ff05
commit
1cbc9340db
2 changed files with 10 additions and 0 deletions
|
|
@ -6982,6 +6982,8 @@ def anon_handle_download_task(options, session, args):
|
|||
help=_("URL under which Koji files are accessible"))
|
||||
parser.add_option("--noprogress", action="store_true",
|
||||
help=_("Do not display progress meter"))
|
||||
parser.add_option("--wait", action="store_true",
|
||||
help=_("Wait for running tasks to finish"))
|
||||
parser.add_option("-q", "--quiet", action="store_true",
|
||||
help=_("Suppress output"), default=options.quiet)
|
||||
|
||||
|
|
@ -7003,6 +7005,13 @@ def anon_handle_download_task(options, session, args):
|
|||
if not base_task:
|
||||
error(_('No such task: #%i') % base_task_id)
|
||||
|
||||
if suboptions.wait and base_task['state'] not in (
|
||||
koji.TASK_STATES['CLOSED'],
|
||||
koji.TASK_STATES['CANCELED'],
|
||||
koji.TASK_STATES['FAILED']):
|
||||
watch_tasks(session, [base_task_id], quiet=suboptions.quiet,
|
||||
poll_interval=options.poll_interval)
|
||||
|
||||
def check_downloadable(task):
|
||||
return task["method"] == "buildArch"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue