#2357 cli: add --task and --source options to list-builds command
Closed 3 years ago by tkopecek. Opened 3 years ago by mikem.

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

      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)"))

flake8 error

./cli/koji_cli/commands.py:3016:100: E501 line too long (102 > 99 characters)

      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 +3090,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.

flake8 error

./cli/koji_cli/commands.py:3016:100: E501 line too long (102 > 99 characters)

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

3 years ago

Pull-Request has been closed by tkopecek

3 years ago

Metadata Update from @jcupova:
- Pull-request untagged with: testing-ready

3 years ago