diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-07-30 22:01:48 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-07-30 22:01:48 +0000 |
| commit | c0392370078e1d3ea0405024f4c3b7135d8a0faf (patch) | |
| tree | 59ef5496366c05c764e715ee28f8533a918dd7fa | |
| parent | ee7e22fa52fb24d42791b22e5108def1ffc0d3ab (diff) | |
| parent | 155183a21e106a7a1616c19f3a3249044c78d27e (diff) | |
| download | python-glanceclient-c0392370078e1d3ea0405024f4c3b7135d8a0faf.tar.gz | |
Merge "Log request-id before exceptions raised"
| -rw-r--r-- | glanceclient/common/http.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 7556537..6951939 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -92,6 +92,16 @@ class _BaseHTTPClient(object): return data def _handle_response(self, resp): + # log request-id for each api cal + request_id = resp.headers.get('x-openstack-request-id') + if request_id: + LOG.debug('%(method)s call to glance-api for ' + '%(url)s used request id ' + '%(response_request_id)s', + {'method': resp.request.method, + 'url': resp.url, + 'response_request_id': request_id}) + if not resp.ok: LOG.debug("Request returned failure status %s." % resp.status_code) raise exc.from_response(resp, resp.content) @@ -120,16 +130,6 @@ class _BaseHTTPClient(object): except ValueError: body_iter = None - # log request-id for each api call - request_id = resp.headers.get('x-openstack-request-id') - if request_id: - LOG.debug('%(method)s call to glance-api for ' - '%(url)s used request id ' - '%(response_request_id)s', - {'method': resp.request.method, - 'url': resp.url, - 'response_request_id': request_id}) - return resp, body_iter |
