#2458 cli: add --task and --source options to list-builds command
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue2356  into  master

file modified
+11 -1
@@ -3010,8 +3010,11 @@ 

      parser.add_option("--after",

                        help=_("List builds built after this time (same format as for --before"))

      parser.add_option("--state", help=_("List builds in this state"))

+     parser.add_option("--task", help=_("List builds for this task"))

      parser.add_option("--type", help=_("List builds of this type."))

-     parser.add_option("--prefix", help=_("Only list packages starting with this prefix"))

+     parser.add_option("--prefix", help=_("Only builds starting with this prefix"))

+     parser.add_option("--source", help=_("Only builds where the source field matches "

+                                          "(glob pattern)"))

      parser.add_option("--owner", help=_("List builds built by this owner"))

      parser.add_option("--volume", help=_("List builds by volume ID"))

      parser.add_option("-k", "--sort-key", action="append", metavar='FIELD',
@@ -3088,6 +3091,13 @@ 

          opts['completeBefore'] = getattr(options, 'before')

      if options.after:

          opts['completeAfter'] = getattr(options, 'after')

+     if options.task:

+         try:

+             opts['taskID'] = int(options.task)

+         except ValueError:

+             parser.error(_("Task id must be an integer"))

+     if options.source:

+         opts['source'] = options.source

      if options.buildid:

          try:

              buildid = int(options.buildid)

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

The api already accepted these parameters. This just provides access to use them
via the command line.

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

3 years ago

:thumbsup: (for Mike's commit)

Commit c5c1c86 fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago

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

3 years ago