From 5838fa39ffbefc3114f6901344370b902997b5b2 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Fri, 7 Feb 2020 06:26:11 -0500 Subject: [PATCH] lpapicache: remove SPPH _have_all_binaries flag The 'all' arch makes it possible to not actually have all the BPPH records for all archs, depending on how we've been called previously (i.e. with which archs and/or no archs). It's safer to just maintain our cache and recheck it each time if needed. --- ubuntutools/lp/lpapicache.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ubuntutools/lp/lpapicache.py b/ubuntutools/lp/lpapicache.py index dd35bec..aa28bf7 100644 --- a/ubuntutools/lp/lpapicache.py +++ b/ubuntutools/lp/lpapicache.py @@ -699,7 +699,6 @@ class SourcePackagePublishingHistory(BaseWrapper): self._archive = None self._changelog = None self._binaries = {} - self._have_all_binaries = False self._distro_series = None # Don't share _builds between different # SourcePackagePublishingHistory objects @@ -813,10 +812,7 @@ class SourcePackagePublishingHistory(BaseWrapper): if fallback_arch == 'all': fallback_arch = host_architecture() - if self._have_all_binaries: - # Great! - pass - elif self.status in ["Pending", "Published"]: + if self.status in ["Pending", "Published"]: # Published, great! Directly query the list of binaries binaries = map(BinaryPackagePublishingHistory, self._lpobject.getPublishedBinaries()) @@ -827,7 +823,6 @@ class SourcePackagePublishingHistory(BaseWrapper): if a not in self._binaries: self._binaries[a] = {} self._binaries[a][b.binary_package_name] = b - self._have_all_binaries = True else: # we have to go the long way :( Logger.info("Please wait, this may take some time...") @@ -868,9 +863,6 @@ class SourcePackagePublishingHistory(BaseWrapper): if a not in self._binaries: self._binaries[a] = {} self._binaries[a][n] = bpph - if not name and not ext and arch == 'all': - # We must have got them all - self._have_all_binaries = True bpphs = [] if arch == 'all':