Skip to content

Commit

Permalink
minidnf: Use base.unload_plugins if available
Browse files Browse the repository at this point in the history
Was added for https://bugzilla.redhat.com/2047251

Change-Id: Ia3739730c33583faa9754df33dc6948ad43cb337
Bug-Url: https://bugzilla.redhat.com/1542492
Signed-off-by: Yedidyah Bar David <[email protected]>
  • Loading branch information
didib committed Aug 24, 2022
1 parent bd9fefd commit 95e81b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/otopi/minidnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,15 @@ def _createBase(self, offline=False):

def _destroyBase(self, base):
if base is not None:
self._sink.verbose(_('Calling _plugins._unload'))
base._plugins._unload()
if hasattr(base, 'unload_plugins'):
# Added in https://bugzilla.redhat.com/2047251
self._sink.verbose(_('Calling base.unload_plugins'))
base.unload_plugins()
else:
# TODO: Consider removing this part once we do not want
# to support older dnf versions.
self._sink.verbose(_('Calling _plugins._unload'))
base._plugins._unload()
base.close()

def _queuePackages(
Expand Down

0 comments on commit 95e81b5

Please sign in to comment.