diff --git a/library/packaging/apt b/library/packaging/apt index 87f14a942bc..527c5f6debf 100755 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -436,7 +436,7 @@ def main(): global apt, apt_pkg import apt import apt_pkg - except: + except ImportError: module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.") global APTITUDE_CMD