Skip to content
Snippets Groups Projects
Commit 3bcd84d0 authored by Adam Williamson's avatar Adam Williamson Committed by Neal Gompa (ニール・ゴンパ)
Browse files

Handle removal of dnf.repo._md_expire_cache() in DNF 3.4


DNF 3.4 removed _md_expire_cache(), which we were still using.
Let's follow how upstream replaced it, by using the expire()
method of the underlying librepo repo object...unfortunately
this is still using private interfaces, but I don't see a way
to do it using public ones.

Signed-off-by: default avatarAdam Williamson <awilliam@redhat.com>
parent d0d01630
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,13 @@ class DnfBase(dnf.Base): ...@@ -61,7 +61,13 @@ class DnfBase(dnf.Base):
def expire_cache(self): def expire_cache(self):
"""Make the current cache expire""" """Make the current cache expire"""
for repo in self.repos.iter_enabled(): for repo in self.repos.iter_enabled():
# see https://bugzilla.redhat.com/show_bug.cgi?id=1629378
try:
# works up to dnf 3.4 (3.4 took it away)
repo._md_expire_cache() repo._md_expire_cache()
except AttributeError:
# works from libdnf 0.18.0 (I think)
repo._repo.expire()
def setup_base(self): def setup_base(self):
"""Setup dnf Sack and init packages helper""" """Setup dnf Sack and init packages helper"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment