aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/httpClient.py
diff options
context:
space:
mode:
authorMytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>2018-06-22 16:04:14 +0100
committerMytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>2018-07-10 13:28:40 +0100
commit5c414e6d7e1fd830021b3b89932bf187d0c7e5cf (patch)
tree14b81fc464c4961d4cbab276a6bd5a0db5b27f3a /yardstick/common/httpClient.py
parent42b33dc3cba15a22214295770756c94f9be08f11 (diff)
Make uwsgi app to not demonize
Supervisord doesn't support demonize applications, thus we have to make the uwsgi application to run not in background. - Fixed Yardstick API path. - Fixed HttpClient class to raise correct exception when the HTML response (not JSON) like 4xx, 5xx is received. (http://docs.python-requests.org/en/master/user/quickstart/#json-response-content) JIRA: YARDSTICK-1297 Change-Id: I4d1c1bb7266eeed0bd357bd28b91206d1580611f Signed-off-by: Mytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>
Diffstat (limited to 'yardstick/common/httpClient.py')
-rw-r--r--yardstick/common/httpClient.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yardstick/common/httpClient.py b/yardstick/common/httpClient.py
index 54f7be670..5b7831144 100644
--- a/yardstick/common/httpClient.py
+++ b/yardstick/common/httpClient.py
@@ -26,10 +26,11 @@ class HttpClient(object):
while True:
try:
response = requests.post(url, data=data, headers=headers)
+ response.raise_for_status()
result = response.json()
logger.debug('The result is: %s', result)
return result
- except Exception:
+ except Exception: # pylint: disable=broad-except
if time.time() > t_end:
logger.exception('')
raise
@@ -37,4 +38,5 @@ class HttpClient(object):
def get(self, url):
response = requests.get(url)
+ response.raise_for_status()
return response.json()