mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #3867 from bcoca/pingdom_nicer_import_error
now missing dep gives nicer error and docs disambiguate lib
This commit is contained in:
commit
33810c60cd
1 changed files with 10 additions and 2 deletions
|
@ -9,7 +9,7 @@ description:
|
||||||
version_added: "1.2"
|
version_added: "1.2"
|
||||||
author: Justin Johns
|
author: Justin Johns
|
||||||
requirements:
|
requirements:
|
||||||
- "pingdom python library"
|
- "This pingdom python library: https://github.com/mbabineau/pingdom-python"
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
|
@ -66,7 +66,12 @@ EXAMPLES = '''
|
||||||
state=running
|
state=running
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import pingdom
|
try:
|
||||||
|
import pingdom
|
||||||
|
HAS_PINGDOM = True
|
||||||
|
except:
|
||||||
|
HAS_PINGDOM = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pause(checkid, uid, passwd, key):
|
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']
|
checkid = module.params['checkid']
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
uid = module.params['uid']
|
uid = module.params['uid']
|
||||||
|
|
Loading…
Reference in a new issue