diff options
| author | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-11-16 14:47:27 +1000 |
|---|---|---|
| committer | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-11-16 14:47:27 +1000 |
| commit | 8e63b53a9bcb0ff199373fec5785e07a26902721 (patch) | |
| tree | e773154631acd70be32ab7332b2c74e5b6c0f0bc /swiftclient/client.py | |
| parent | 5427f7f5017b844e39d85ce434cbe92cea990c71 (diff) | |
| download | python-swiftclient-8e63b53a9bcb0ff199373fec5785e07a26902721.tar.gz | |
Remove unused json_request.
- This has been long delegated to python-keystoneclient for auth 2.0.
Change-Id: I92b1fc2db68192cfeefd623c59882f65a4e4405c
Diffstat (limited to 'swiftclient/client.py')
| -rw-r--r-- | swiftclient/client.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 896dd35..98bfb52 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -175,32 +175,6 @@ def http_connection(url, proxy=None): return parsed, conn -def json_request(method, url, **kwargs): - """Takes a request in json parse it and return in json""" - kwargs.setdefault('headers', {}) - if 'body' in kwargs: - kwargs['headers']['Content-Type'] = 'application/json' - kwargs['body'] = json_dumps(kwargs['body']) - parsed, conn = http_connection(url) - conn.request(method, parsed.path, **kwargs) - resp = conn.getresponse() - body = resp.read() - http_log((url, method,), kwargs, resp, body) - if body: - try: - body = json_loads(body) - except ValueError: - body = None - if not body or resp.status < 200 or resp.status >= 300: - raise ClientException('Auth GET failed', http_scheme=parsed.scheme, - http_host=conn.host, - http_port=conn.port, - http_path=parsed.path, - http_status=resp.status, - http_reason=resp.reason) - return resp, body - - def get_auth_1_0(url, user, key, snet): parsed, conn = http_connection(url) method = 'GET' |
