Merge "Log request-id for each api call"

This commit is contained in:
Jenkins
2016-07-15 10:56:25 +00:00
committed by Gerrit Code Review
2 changed files with 16 additions and 0 deletions
+10
View File
@@ -120,6 +120,16 @@ 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