Merge pull request #1660 from ingvagabund/fix-dnf-state-latest

dnf module: package not installed with state=latest
This commit is contained in:
Toshio Kuratomi 2016-02-13 02:04:35 -08:00
commit fc1d2b4d6f

View file

@ -274,11 +274,10 @@ def ensure(module, base, state, names):
# If not already installed, try to install.
base.group_install(group, const.GROUP_PACKAGE_TYPES)
for pkg_spec in pkg_specs:
try:
base.upgrade(pkg_spec)
except dnf.exceptions.MarkingError:
# If not already installed, try to install.
_mark_package_install(module, base, pkg_spec)
# best effort causes to install the latest package
# even if not previously installed
base.conf.best = True
base.install(pkg_spec)
else:
# state == absent