Skip to content

Commit 38757d4

Browse files
committed
Plugins: Accept empty JSON response on plugin uninstall
1 parent 5c79d9d commit 38757d4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## unreleased
44

5+
* Plugins: Accept empty JSON response on plugin uninstall
6+
57

68
## 3.9.0 (2023-09-21)
79

grafana_client/elements/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def uninstall(self, plugin_id, errors="raise"):
5555
"""
5656
try:
5757
path = "/plugins/%s/uninstall" % plugin_id
58-
r = self.client.POST(path)
58+
# Unfortunately, this endpoint may respond with an empty JSON,
59+
# which needs compensation, because it does not decode well.
60+
r = self.client.POST(path, accept_empty_json=True)
5961
return r
6062
except Exception as ex:
6163
if errors == "raise":

0 commit comments

Comments
 (0)