diff options
author | nitzmahone <mdavis@ansible.com> | 2016-06-20 13:13:09 -0700 |
---|---|---|
committer | nitzmahone <mdavis@ansible.com> | 2016-06-20 13:13:09 -0700 |
commit | 81c7630c011296a8cf34e75b47afec807dc0ec8e (patch) | |
tree | 4d1f24032b489177459feaab6a7d0d7d06fbcddb /monitoring | |
parent | 5cd3e328f3d5459d39a6f88bd331f362dca96d5f (diff) | |
download | ansible-modules-extras-81c7630c011296a8cf34e75b47afec807dc0ec8e.tar.gz |
fix statusio_maintenance exception handling
Diffstat (limited to 'monitoring')
-rw-r--r-- | monitoring/statusio_maintenance.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/monitoring/statusio_maintenance.py b/monitoring/statusio_maintenance.py index 893545e4..c2b93db5 100644 --- a/monitoring/statusio_maintenance.py +++ b/monitoring/statusio_maintenance.py @@ -319,7 +319,8 @@ def create_maintenance(auth_headers, url, statuspage, host_ids, if data["status"]["error"] == "yes": return 1, None, data["status"]["message"] - except Exception, e: + except Exception: + e = get_exception() return 1, None, str(e) return 0, None, None @@ -337,7 +338,8 @@ def delete_maintenance(auth_headers, url, statuspage, maintenance_id): data = json.loads(response.read()) if data["status"]["error"] == "yes": return 1, None, "Invalid maintenance_id" - except Exception, e: + except Exception: + e = get_exception() return 1, None, str(e) return 0, None, None |