Skip to content

Commit

Permalink
circonus_annotation: fix broken import, update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
pilou- authored and abadger committed Aug 16, 2017
1 parent 24b58ba commit f69333b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 9 additions & 4 deletions lib/ansible/modules/monitoring/circonus_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
author: "Nick Harring (@NickatEpic)"
version_added: 2.0
requirements:
- urllib3
- requests
- time
- requests (either >= 2.0.0 for Python 3, or >= 1.0.0 for Python 2)
notes:
- Check mode isn’t supported.
options:
Expand Down Expand Up @@ -143,7 +141,11 @@
import time
import traceback

import requests
try:
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
Expand Down Expand Up @@ -201,6 +203,9 @@ def main():
)
)

if not HAS_REQUESTS:
module.fail_json(msg='requests is required for this module')

annotation = create_annotation(module)
try:
resp = post_annotation(annotation, module.params['api_key'])
Expand Down
1 change: 0 additions & 1 deletion test/sanity/import/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ lib/ansible/modules/clustering/consul_kv.py
lib/ansible/modules/messaging/rabbitmq_binding.py
lib/ansible/modules/messaging/rabbitmq_exchange.py
lib/ansible/modules/messaging/rabbitmq_queue.py
lib/ansible/modules/monitoring/circonus_annotation.py
lib/ansible/modules/network/cloudengine/ce_file_copy.py
lib/ansible/modules/network/cumulus/_cl_img_install.py
lib/ansible/modules/network/f5/bigip_command.py
Expand Down

0 comments on commit f69333b

Please sign in to comment.