dnf5: fix tb when plugins API is not available (#83969) (#83991)

Follow up on https://github.com/ansible/ansible/pull/83105

(cherry picked from commit 0a100c7f06)
pull/84024/head
Martin Krizek 2 months ago committed by GitHub
parent 9812e55823
commit a627b2411a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- "dnf5 - fix traceback when ``enable_plugins``/``disable_plugins`` is used on ``python3-libdnf5`` versions that do not support this functionality"

@ -451,7 +451,15 @@ class Dnf5Module(YumDnf):
def fail_on_non_existing_plugins(self, base):
# https://github.com/rpm-software-management/dnf5/issues/1460
try:
plugin_names = [p.get_name() for p in base.get_plugins_info()]
except AttributeError:
# plugins functionality requires python3-libdnf5 5.2.0.0+
# silently ignore here, the module will fail later when
# base.enable_disable_plugins is attempted to be used if
# user specifies enable_plugin/disable_plugin
return
msg = []
if enable_unmatched := set(self.enable_plugin).difference(plugin_names):
msg.append(

Loading…
Cancel
Save