Check responsecodes

This commit is contained in:
Ruud
2014-02-16 10:27:31 +01:00
parent aa5937c278
commit 888ee07f65

View File

@@ -172,7 +172,10 @@ class Plugin(object):
log.info('Opening url: %s %s, data: %s', (method, url, [x for x in data.keys()] if isinstance(data, dict) else 'with data'))
response = r.request(method, url, verify = False, **kwargs)
data = response.content
if response.status_code != requests.codes.ok:
data = response.content
else:
response.raise_for_status()
self.http_failed_request[host] = 0
except (IOError, MaxRetryError, Timeout):