diff --git a/packaging/os/dnf.py b/packaging/os/dnf.py index bb6a2c9d495..c4522f9105a 100644 --- a/packaging/os/dnf.py +++ b/packaging/os/dnf.py @@ -230,7 +230,7 @@ def _mark_package_install(module, base, pkg_spec): try: base.install(pkg_spec) except exceptions.MarkingError: - module.fail(msg="No package {} available.".format(pkg_spec)) + module.fail_json(msg="No package {} available.".format(pkg_spec)) def ensure(module, base, state, names):