From 7a82f2c86d24acc44da48ce6e9c2de47e0a53b2b Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Sun, 31 Jan 2016 01:32:09 -0800 Subject: [PATCH] Show error if python-apt is absent in check mode. Previously this would fail with an exception which did not clearly explain the reason for the failure. --- packaging/os/apt_repository.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/os/apt_repository.py b/packaging/os/apt_repository.py index 52208f25987..6cf5014c2fa 100644 --- a/packaging/os/apt_repository.py +++ b/packaging/os/apt_repository.py @@ -129,6 +129,8 @@ def install_python_apt(module): HAVE_PYTHON_APT = True else: module.fail_json(msg="Failed to auto-install python-apt. Error was: '%s'" % se.strip()) + else: + module.fail_json(msg="python-apt must be installed to use check mode") class InvalidSource(Exception): pass