From a17ca862fb2d3de4efc30367d35480a80cb1d16e Mon Sep 17 00:00:00 2001 From: serenecloud Date: Sun, 30 Jun 2013 15:36:13 +1200 Subject: [PATCH] Return a friendly error message if aptitude isn't installed --- library/packaging/apt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/packaging/apt b/library/packaging/apt index a352cabf66..5f8c97aa39 100644 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -286,6 +286,9 @@ def main(): global APT_GET_CMD APT_GET_CMD = module.get_bin_path("apt-get") + if not APTITUDE_CMD: + module.fail_json(msg="Could not find aptitude. Please ensure it is installed.") + p = module.params install_recommends = p['install_recommends']