Change success status code to 202

As I already mentioned here: a1b1182662 (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).
This commit is contained in:
Markus Ostertag 2016-04-26 14:39:00 +02:00 committed by Matt Clay
parent 517feda4ac
commit 8fd23c7d75

View file

@ -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':