From 4ae9640df9e35eb3df8a8c0b2fc86e9913728f40 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Fri, 26 Apr 2024 13:08:33 +0200 Subject: [PATCH] grafana silence returns 202 as OK - need to handle that --- plugins/module_utils/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/base.py b/plugins/module_utils/base.py index 4d2cb2a7..6d885550 100644 --- a/plugins/module_utils/base.py +++ b/plugins/module_utils/base.py @@ -80,7 +80,7 @@ def grafana_send_request(self, module, url, grafana_url, data=None, headers=None self._module.fail_json(failed=True, msg="Permission Denied") elif status_code < 0: self._module.fail_json(failed=True, msg=info["msg"]) - elif status_code == 200: + elif status_code in [200, 202]: return self._module.from_json(resp.read()) self._module.fail_json( failed=True,