#2346 cli: --wait for download-task
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2052  into  master

@@ -6978,6 +6978,8 @@ 

                        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)

  
@@ -6999,6 +7001,13 @@ 

      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"

  

@@ -339,6 +339,7 @@ 

    --logs        Also download build logs

    --topurl=URL  URL under which Koji files are accessible

    --noprogress  Do not display progress meter

+   --wait        Wait for running tasks to finish

    -q, --quiet   Suppress output

  """ % progname

          self.assertMultiLineEqual(actual, expected)

If task is not finished yet, wait for it and download output then.

Fixes: https://pagure.io/koji/issue/2052

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago

Commit 9beaac9 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago