From e9a1c778f13f6224eb7156b5b3ee86a63dec251b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 17 Apr 2014 15:33:26 -0500 Subject: [PATCH] Update requests version Signed-off-by: Zack Cerza --- requirements.txt | 2 +- teuthology/report.py | 7 ++++--- teuthology/task/radosgw-admin-rest.py | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2ae8452a691..a8488f41999 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ configobj httplib2 paramiko >= 1.7.7 pexpect -requests == 0.14.0 +requests raven web.py docopt diff --git a/teuthology/report.py b/teuthology/report.py index c8c290b873f..45cea89cfd3 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -274,8 +274,9 @@ class ResultsReporter(object): if response.status_code == 200: return job_id - if response.json: - msg = response.json.get('message', '') + resp_json = response.json() + if resp_json: + msg = resp_json.get('message', '') else: msg = response.text @@ -333,7 +334,7 @@ class ResultsReporter(object): uri += "?fields=" + ','.join(fields) response = requests.get(uri) response.raise_for_status() - return response.json + return response.json() def delete_job(self, run_name, job_id): """ diff --git a/teuthology/task/radosgw-admin-rest.py b/teuthology/task/radosgw-admin-rest.py index 43cf735394c..866ff4f10e1 100644 --- a/teuthology/task/radosgw-admin-rest.py +++ b/teuthology/task/radosgw-admin-rest.py @@ -26,7 +26,7 @@ log = logging.getLogger(__name__) def successful_ops(out): """ Extract successful operations - :param out: list + :param out: list """ summary = out['summary'] if len(summary) == 0: @@ -37,7 +37,7 @@ def successful_ops(out): def rgwadmin(ctx, client, cmd): """ Perform rgw admin command - + :param client: client :param cmd: command to execute. :return: command exit status, json result. @@ -156,8 +156,8 @@ def rgwadmin_rest(connection, cmd, params=None, headers=None, raw=False): log.info(' text result: %s' % result.txt) return result.status_code, result.txt else: - log.info(' json result: %s' % result.json) - return result.status_code, result.json + log.info(' json result: %s' % result.json()) + return result.status_code, result.json() def task(ctx, config):