From ca987efd55ab240e9d438dca70b3d594c24f96a2 Mon Sep 17 00:00:00 2001 From: Michael Derynck Date: Fri, 17 Feb 2023 11:04:02 -0700 Subject: [PATCH] Handle OnCall gateway connector delete 204 (#1313) Deleting an oncall connector from the gateway returns a 204 so it should not try to parse the response for json. --- .github/ISSUE_TEMPLATE/issue-template.md | 1 + engine/common/oncall_gateway/oncall_gateway_client.py | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md index cb292597..c6fc0f94 100644 --- a/.github/ISSUE_TEMPLATE/issue-template.md +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -10,6 +10,7 @@ assignees: '' Hi, thank you for opening an issue! Here is a quick checklist: + - [ ] Is it about Cloud or Open Source OnCall? - [ ] Add OnCall backend & frontend versions. - [ ] Include labels starting with "part:". Like `part:alertflow` or `part:schedules`. diff --git a/engine/common/oncall_gateway/oncall_gateway_client.py b/engine/common/oncall_gateway/oncall_gateway_client.py index 9b8c03b5..ee900618 100644 --- a/engine/common/oncall_gateway/oncall_gateway_client.py +++ b/engine/common/oncall_gateway/oncall_gateway_client.py @@ -52,14 +52,7 @@ class OnCallGatewayAPIClient: def delete_oncall_connector(self, oncall_org_id: str) -> requests.models.Response: url = urljoin(f"{self._oncall_connectors_url}/", oncall_org_id) response = self._delete(url=url) - response_data = response.json() - return ( - OnCallConnector( - response_data["oncall_org_id"], - response_data["backend"], - ), - response, - ) + return response # Slack Connector @property