1
0
Fork 0

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
1 changed files with 2 additions and 0 deletions

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: