summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Ostertag <mo@mo-its.de>2016-04-26 14:39:00 +0200
committerMarkus Ostertag <mo@mo-its.de>2016-04-26 14:39:00 +0200
commitd5ab3dc0f38927f426f70c22e7143077c5b4e8cf (patch)
tree383cac8b138163084c8d1062657bd7580b634614
parent86f08bfcda17e95fb284f9a8b7c0a3cbf518173b (diff)
downloadansible-modules-extras-d5ab3dc0f38927f426f70c22e7143077c5b4e8cf.tar.gz
Change success status code to 202
As I already mentioned here: https://github.com/ansible/ansible-modules-extras/commit/a1b11826625b7f48d517b088651dc5ed4d6eb9d6#diff-d04a476e5d71372918cb6e7e5b39a683R120 @jimi-c added some "hidden" additional check in his urllib commit and broke the whole module for everybody as Datadog answers with an 202 in case of success (http://docs.datadoghq.com/api/#troubleshooting).
-rw-r--r--monitoring/datadog_event.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/monitoring/datadog_event.py b/monitoring/datadog_event.py
index 25e8ce05..5d083eab 100644
--- a/monitoring/datadog_event.py
+++ b/monitoring/datadog_event.py
@@ -142,7 +142,7 @@ def post_event(module):
headers = {"Content-Type": "application/json"}
(response, info) = fetch_url(module, uri, data=json_body, headers=headers)
- if info['status'] == 200:
+ if info['status'] == 202:
response_body = response.read()
response_json = module.from_json(response_body)
if response_json['status'] == 'ok':