mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
dnf: handle error when latest pkg not found (#39720)
* dnf: handle error when latest pkg not found * Add integration test
This commit is contained in:
@@ -393,7 +393,10 @@ def ensure(module, base, state, names, autoremove):
|
||||
# best effort causes to install the latest package
|
||||
# even if not previously installed
|
||||
base.conf.best = True
|
||||
base.install(pkg_spec)
|
||||
try:
|
||||
base.install(pkg_spec)
|
||||
except dnf.exceptions.MarkingError as e:
|
||||
failures.append((pkg_spec, to_native(e)))
|
||||
|
||||
else:
|
||||
# state == absent
|
||||
|
||||
Reference in New Issue
Block a user