From 52dd1dd4c559a074f1b45dc0405c7c1c96147029 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 15 Aug 2013 21:25:37 -0400 Subject: [PATCH] now missing dep gives nicer error and docs disambiguate as several libs out there have same name. Signed-off-by: Brian Coca --- library/monitoring/pingdom | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/library/monitoring/pingdom b/library/monitoring/pingdom index 242304af80..26ea1cfd95 100644 --- a/library/monitoring/pingdom +++ b/library/monitoring/pingdom @@ -9,7 +9,7 @@ description: version_added: "1.2" author: Justin Johns requirements: - - "pingdom python library" + - "This pingdom python library: https://github.com/mbabineau/pingdom-python" options: state: description: @@ -66,7 +66,12 @@ EXAMPLES = ''' state=running ''' -import pingdom +try: + import pingdom + HAS_PINGDOM = True +except: + HAS_PINGDOM = False + def pause(checkid, uid, passwd, key): @@ -105,6 +110,9 @@ def main(): ) ) + if not HAS_PINGDOM: + module.fail_json(msg="Missing requried pingdom module (check docs)") + checkid = module.params['checkid'] state = module.params['state'] uid = module.params['uid']