Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Moritz <[email protected]>
  • Loading branch information
flkhndlr and Nemental authored Apr 22, 2024
1 parent a152f0a commit 356885e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/modules/grafana_silence.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
module: grafana_silence
author:
- flkhndlr (@flkhndlr)
version_added: "1.6.0"
version_added: "1.8.0"
short_description: Manage Grafana Silences
description:
- Create/delete Grafana Silences through the Alertmanager Silence API.
Expand Down Expand Up @@ -225,9 +225,7 @@ def _send_request(self, url, data=None, headers=None, method="GET"):
)
elif status_code == 403:
self._module.fail_json(failed=True, msg="Permission Denied")
elif status_code == 202:
return self._module.from_json(resp.read())
elif status_code == 200:
elif status_code in [200, 202]:
return self._module.from_json(resp.read())
elif status_code == 400:
self._module.fail_json(failed=True, msg=info)
Expand Down

0 comments on commit 356885e

Please sign in to comment.