#3118 handle dictionary parameter in get_tag()
Closed 5 months ago by tkopecek. Opened 6 months ago by mikem.
mikem/koji get_tag_by_dict  into  master

file modified
+5
@@ -3438,6 +3438,11 @@ 

                'tag_config.maven_support': 'maven_support',

                'tag_config.maven_include_all': 'maven_include_all',

                }

+     if isinstance(tagInfo, dict):

+         if 'id' in tagInfo:

+             tagInfo = tagInfo['id']

+         elif 'name' in tagInfo:

+             tagInfo = tagInfo['name']

      data = {'tagInfo': tagInfo}

  

      clauses = []

Sometimes client code can be sloppy and pass a taginfo dict for a tag option. This is less likely with the direct getTag call, but can happen easily with other calls that call get_tag themselves. In the case that prompted me, the call was assertPolicy.

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

PR #3123 accomplishes this much more systematically.

Pull-Request has been closed by tkopecek

5 months ago
Metadata