client HEAD headers and swift source in logs
Change-Id: Ic5e3b6d333f94da971bf3e0ae4cdd6a9689c7f1c
This commit is contained in:
@@ -343,7 +343,7 @@ def get_container(url, token, container, marker=None, limit=None,
|
|||||||
return resp_headers, json_loads(resp.read())
|
return resp_headers, json_loads(resp.read())
|
||||||
|
|
||||||
|
|
||||||
def head_container(url, token, container, http_conn=None):
|
def head_container(url, token, container, http_conn=None, headers=None):
|
||||||
"""
|
"""
|
||||||
Get container stats.
|
Get container stats.
|
||||||
|
|
||||||
@@ -361,7 +361,10 @@ def head_container(url, token, container, http_conn=None):
|
|||||||
else:
|
else:
|
||||||
parsed, conn = http_connection(url)
|
parsed, conn = http_connection(url)
|
||||||
path = '%s/%s' % (parsed.path, quote(container))
|
path = '%s/%s' % (parsed.path, quote(container))
|
||||||
conn.request('HEAD', path, '', {'X-Auth-Token': token})
|
req_headers = {'X-Auth-Token': token}
|
||||||
|
if headers:
|
||||||
|
req_headers.update(headers)
|
||||||
|
conn.request('HEAD', path, '', req_headers)
|
||||||
resp = conn.getresponse()
|
resp = conn.getresponse()
|
||||||
resp.read()
|
resp.read()
|
||||||
if resp.status < 200 or resp.status >= 300:
|
if resp.status < 200 or resp.status >= 300:
|
||||||
|
|||||||
@@ -1904,6 +1904,7 @@ class Application(BaseApplication):
|
|||||||
req.environ.get('swift.trans_id', '-'),
|
req.environ.get('swift.trans_id', '-'),
|
||||||
logged_headers or '-',
|
logged_headers or '-',
|
||||||
trans_time,
|
trans_time,
|
||||||
|
req.environ.get('swift.source', '-'),
|
||||||
)))
|
)))
|
||||||
# done with this transaction
|
# done with this transaction
|
||||||
self.access_logger.txn_id = None
|
self.access_logger.txn_id = None
|
||||||
|
|||||||
Reference in New Issue
Block a user