#3055 be tolerant of stops/jumps kwargs with falsy values and clear error in list-tag-inheritance
Merged 2 years ago by tkopecek. Opened 2 years ago by julian8628.
julian8628/koji issue/3054  into  master

@@ -4403,6 +4403,9 @@ 

      (options, args) = parser.parse_args(args)

      if len(args) != 1:

          parser.error(_("This command takes exactly one argument: a tag name or ID"))

+     for deprecated in ('stop', 'jump'):

+         if getattr(options, deprecated):

+             parser.error(_("--%s option has been removed in 1.26") % deprecated)

      ensure_connection(session, goptions)

      event = koji.util.eventFromOpts(session, options)

      if event:

file modified
+12 -1
@@ -11863,15 +11863,26 @@ 

          context.session.assertPerm('tag')

          return writeInheritanceData(tag, data, clear=clear)

  

-     def getFullInheritance(self, tag, event=None, reverse=False):

+     def getFullInheritance(self, tag, event=None, reverse=False, **kwargs):

          """

          :param int|str tag: tag ID | name

          :param int event: event ID

          :param bool reverse: return reversed tree (descendants instead of

                               parents)

+         :param dict stops: SHOULD NOT BE USED, BACKWARDS COMPATIBLE ONLY

+         :param dict jumps: SHOULD NOT BE USED, BACKWARDS COMPATIBLE ONLY

  

          :returns: list of node dicts

          """

+         # Backwards-compatible with the removed options

+         for k, v in kwargs.items():

+             if k in ('stops', 'jumps'):

+                 if v:

+                     raise koji.ParameterError("%s option has been removed since 1.26" % k)

+             else:

+                 raise koji.ParameterError(

+                     "getFullInheritance() got an unexpected keyword argument '%s'" % k)

+ 

          if not isinstance(tag, int):

              # lookup tag id

              tag = get_tag_id(tag, strict=True)

1 new commit added

  • update docstring
2 years ago

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

2 years ago

Commit 3066278 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago

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

2 years ago