mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 12:19:53 +01:00
dnf5: fix tb when plugins API is not available (#83969)
Follow up on https://github.com/ansible/ansible/pull/83105
This commit is contained in:
parent
c0fb71a642
commit
0a100c7f06
2
changelogs/fragments/dnf5-plugins-compat.yml
Normal file
2
changelogs/fragments/dnf5-plugins-compat.yml
Normal file
|
|
@ -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):
|
def fail_on_non_existing_plugins(self, base):
|
||||||
# https://github.com/rpm-software-management/dnf5/issues/1460
|
# https://github.com/rpm-software-management/dnf5/issues/1460
|
||||||
plugin_names = [p.get_name() for p in base.get_plugins_info()]
|
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 = []
|
msg = []
|
||||||
if enable_unmatched := set(self.enable_plugin).difference(plugin_names):
|
if enable_unmatched := set(self.enable_plugin).difference(plugin_names):
|
||||||
msg.append(
|
msg.append(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user