Update the status codes to look for (#2120)

Creation of a maintenance window returns a 201 (PagerDuty Developer documentation is unfortunately incorrect). Deleting a maintenance window returns a 204.
pull/18777/head
MDCollins 8 years ago committed by Matt Clay
parent 5bfbeadca3
commit 7d8d830aee

@ -214,7 +214,7 @@ def create(module, name, user, passwd, token, requester_id, service, hours, minu
data = json.dumps(request_data)
response, info = fetch_url(module, url, data=data, headers=headers, method='POST')
if info['status'] != 200:
if info['status'] != 201:
module.fail_json(msg="failed to create the window: %s" % info['msg'])
try:
@ -240,7 +240,7 @@ def absent(module, name, user, passwd, token, requester_id, service):
data = json.dumps(request_data)
response, info = fetch_url(module, url, data=data, headers=headers, method='DELETE')
if info['status'] != 200:
if info['status'] != 204:
module.fail_json(msg="failed to delete the window: %s" % info['msg'])
try:

Loading…
Cancel
Save