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).
pull/18777/head
Markus Ostertag 9 years ago committed by Matt Clay
parent 517feda4ac
commit 8fd23c7d75

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

Loading…
Cancel
Save