commit | 0488f934e203f70afc1704d0fd21e00592c265d3 | [log] [tgz] |
---|---|---|
author | Adam Tengler <adam.tengler@tcpcloud.eu> | Wed Nov 30 11:59:59 2016 +0100 |
committer | Adam Tengler <adam.tengler@tcpcloud.eu> | Wed Nov 30 11:59:59 2016 +0100 |
tree | 1008c202fcddcc647afc18686788d90cd1ab46df | |
parent | 3f044b20d605adc6bd9b69490b68c685726b77ae [diff] |
Raise HTTP error on HTTP response codes >= 400
diff --git a/_states/grafana3_datasource.py b/_states/grafana3_datasource.py index a66836b..42599e5 100644 --- a/_states/grafana3_datasource.py +++ b/_states/grafana3_datasource.py
@@ -197,6 +197,8 @@ 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: