fix leaking product info when building cache

When building the product cache, the information of which products a
package/component is part of could be leaked from one item to the next
because it's only every reset once per call.

This was introduced when we moved the functionality of the ProductCache
class into BugzillaProxy.build_product_cache().

Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2019-11-25 13:18:42 +01:00
parent a287c60ce5
commit 34c580db0d

View file

@ -156,7 +156,6 @@ class BugzillaProxy:
""" Cache the bugzilla info about each package in each product.
"""
products = {}
if self.config['bugzilla']['compat_api'] == 'getcomponentsdetails':
# Old API -- in python-bugzilla. But with current server, this
# gives ProxyError
@ -165,7 +164,6 @@ class BugzillaProxy:
elif self.config['bugzilla']['compat_api'] == 'component.get':
# Way that's undocumented in the partner-bugzilla api but works
# currently
products = {}
for collection, product in self.config["products"].items():
# restrict the list of info returned to only the packages of
@ -175,6 +173,7 @@ class BugzillaProxy:
for project in pagure_projects
if product in project["products"]
]
products = {}
for pkg_segment in segment(pkglist, self.config['bugzilla']['req_segment']):
# Format that bugzilla will understand. Strip None's that
# segment() pads out the final data segment() with