Skip to content

Commit

Permalink
Plugins: Accept empty JSON response on plugin uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 21, 2023
1 parent 5c79d9d commit 38757d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## unreleased

* Plugins: Accept empty JSON response on plugin uninstall


## 3.9.0 (2023-09-21)

Expand Down
4 changes: 3 additions & 1 deletion grafana_client/elements/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def uninstall(self, plugin_id, errors="raise"):
"""
try:
path = "/plugins/%s/uninstall" % plugin_id
r = self.client.POST(path)
# Unfortunately, this endpoint may respond with an empty JSON,
# which needs compensation, because it does not decode well.
r = self.client.POST(path, accept_empty_json=True)
return r
except Exception as ex:
if errors == "raise":
Expand Down

0 comments on commit 38757d4

Please sign in to comment.