client HEAD headers and swift source in logs
Change-Id: Ic5e3b6d333f94da971bf3e0ae4cdd6a9689c7f1c
This commit is contained in:
parent
6f7f95ffde
commit
99b2aa0dec
@ -343,7 +343,7 @@ def get_container(url, token, container, marker=None, limit=None,
|
||||
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.
|
||||
|
||||
@ -361,7 +361,10 @@ def head_container(url, token, container, http_conn=None):
|
||||
else:
|
||||
parsed, conn = http_connection(url)
|
||||
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.read()
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
|
@ -1904,6 +1904,7 @@ class Application(BaseApplication):
|
||||
req.environ.get('swift.trans_id', '-'),
|
||||
logged_headers or '-',
|
||||
trans_time,
|
||||
req.environ.get('swift.source', '-'),
|
||||
)))
|
||||
# done with this transaction
|
||||
self.access_logger.txn_id = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user