mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix statusio_maintenance exception handling
This commit is contained in:
parent
2809c1ca07
commit
c56da672d1
1 changed files with 4 additions and 2 deletions
|
@ -319,7 +319,8 @@ def create_maintenance(auth_headers, url, statuspage, host_ids,
|
||||||
|
|
||||||
if data["status"]["error"] == "yes":
|
if data["status"]["error"] == "yes":
|
||||||
return 1, None, data["status"]["message"]
|
return 1, None, data["status"]["message"]
|
||||||
except Exception, e:
|
except Exception:
|
||||||
|
e = get_exception()
|
||||||
return 1, None, str(e)
|
return 1, None, str(e)
|
||||||
return 0, None, None
|
return 0, None, None
|
||||||
|
|
||||||
|
@ -337,7 +338,8 @@ def delete_maintenance(auth_headers, url, statuspage, maintenance_id):
|
||||||
data = json.loads(response.read())
|
data = json.loads(response.read())
|
||||||
if data["status"]["error"] == "yes":
|
if data["status"]["error"] == "yes":
|
||||||
return 1, None, "Invalid maintenance_id"
|
return 1, None, "Invalid maintenance_id"
|
||||||
except Exception, e:
|
except Exception:
|
||||||
|
e = get_exception()
|
||||||
return 1, None, str(e)
|
return 1, None, str(e)
|
||||||
return 0, None, None
|
return 0, None, None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue