1
0
Fork 0
mirror of synced 2024-11-25 02:05:36 -05:00

Raise HTTP error on HTTP response codes >= 400

This commit is contained in:
Adam Tengler 2016-11-30 11:59:59 +01:00
parent 3f044b20d6
commit 0488f934e2

View file

@ -197,6 +197,8 @@ def _get_datasource(profile, name):
auth=_get_auth(profile),
timeout=profile.get('grafana_timeout', 3),
)
if response.status_code >= 400:
response.raise_for_status()
data = response.json()
for datasource in data:
if datasource['name'] == name: