summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMDCollins <github@m-collins.com>2016-12-05 13:02:15 -0800
committerToshio Kuratomi <a.badger@gmail.com>2016-12-05 13:02:15 -0800
commit1853e00f2c6e2a96ef2917a094e634f8d545eb75 (patch)
tree2a05c638aad181da6cbf5a6bea2ab2576a0f2b2e
parent15197d797539fc6a01dcc8c136be7eab61863fd7 (diff)
downloadansible-modules-extras-1853e00f2c6e2a96ef2917a094e634f8d545eb75.tar.gz
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.
-rw-r--r--monitoring/pagerduty.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/monitoring/pagerduty.py b/monitoring/pagerduty.py
index a6d6da7d..e2ba95fe 100644
--- a/monitoring/pagerduty.py
+++ b/monitoring/pagerduty.py
@@ -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: