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:
Martin Krizek
2018-05-09 10:05:00 +02:00
committed by GitHub
parent 3c389aee73
commit bf702e6d88
2 changed files with 21 additions and 2 deletions

View File

@@ -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