Skip to content

Commit

Permalink
Fix error on EOL release
Browse files Browse the repository at this point in the history
  • Loading branch information
martin68 committed Sep 20, 2019
1 parent 5fc5cf8 commit 87fe293
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apt_smart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def available_mirrors(self):
"""A list of :class:`CandidateMirror` objects (ordered from best to worst)"""
mirrors = set()
if self.release_is_eol:
logger.debug("Skipping mirror discovery because %s is EOL.", self.release)
logger.warning("Skipping mirror discovery because %s is EOL.", self.release)
else:
logger.info("Adding BASE_URL mirror:")
if self.distributor_id == 'debian': # For Debian, base_url typically is not in MIRRORS_URL,
Expand Down Expand Up @@ -360,7 +360,11 @@ def ranked_mirrors(self):

logger.info("Start retrieving :attr:`base_last_updated` using is_available")
self.base_last_updated = 0
if mapping[self.base_url].is_available:
if self.release_is_eol:
self.base_last_updated = int(time.time())
logger.warning("%s is EOL, so using time.time() as :attr:`base_last_updated`: %i",
self.release, self.base_last_updated)
elif mapping[self.base_url].is_available:
logger.debug(":attr:`base_last_updated`: %i", self.base_last_updated)
# base_url 's contents are up-to-date naturally,so set its last_updated 0
mapping[self.base_url].last_updated = 0
Expand Down

0 comments on commit 87fe293

Please sign in to comment.