Merge "TCP port is appended two time in ClientException"
This commit is contained in:
commit
41f5763b2b
@ -236,9 +236,8 @@ def get_auth_1_0(url, user, key, snet, **kwargs):
|
||||
# if we don't have a x-storage-url header and if we get a body.
|
||||
if resp.status < 200 or resp.status >= 300 or (body and not url):
|
||||
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)
|
||||
http_host=conn.host, http_path=parsed.path,
|
||||
http_status=resp.status, http_reason=resp.reason)
|
||||
if snet:
|
||||
parsed = list(urlparse(url))
|
||||
# Second item in the list is the netloc
|
||||
@ -430,9 +429,9 @@ def get_account(url, token, marker=None, limit=None, prefix=None,
|
||||
resp_headers[header.lower()] = value
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Account GET failed', http_scheme=parsed.scheme,
|
||||
http_host=conn.host, http_port=conn.port,
|
||||
http_path=parsed.path, http_query=qs,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_host=conn.host, http_path=parsed.path,
|
||||
http_query=qs, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
if resp.status == 204:
|
||||
return resp_headers, []
|
||||
@ -463,9 +462,8 @@ def head_account(url, token, http_conn=None):
|
||||
http_log((url, method,), {'headers': headers}, resp, body)
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Account HEAD 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,
|
||||
http_host=conn.host, http_path=parsed.path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
resp_headers = {}
|
||||
for header, value in resp.getheaders():
|
||||
@ -503,7 +501,6 @@ def post_account(url, token, headers, http_conn=None, response_dict=None):
|
||||
raise ClientException('Account POST 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,
|
||||
@ -580,9 +577,8 @@ def get_container(url, token, container, marker=None, limit=None,
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Container GET failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=cont_path,
|
||||
http_query=qs, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_path=cont_path, http_query=qs,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
resp_headers = {}
|
||||
for header, value in resp.getheaders():
|
||||
@ -623,8 +619,8 @@ def head_container(url, token, container, http_conn=None, headers=None):
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Container HEAD failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
resp_headers = {}
|
||||
for header, value in resp.getheaders():
|
||||
@ -669,8 +665,8 @@ def put_container(url, token, container, headers=None, http_conn=None,
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Container PUT failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
|
||||
@ -709,8 +705,8 @@ def post_container(url, token, container, headers, http_conn=None,
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Container POST failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
|
||||
@ -746,8 +742,8 @@ def delete_container(url, token, container, http_conn=None,
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Container DELETE failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
|
||||
@ -799,8 +795,8 @@ def get_object(url, token, container, name, http_conn=None,
|
||||
http_log(('%s%s' % (url.replace(parsed.path, ''), path), method,),
|
||||
{'headers': headers}, resp, body)
|
||||
raise ClientException('Object GET failed', http_scheme=parsed.scheme,
|
||||
http_host=conn.host, http_port=conn.port,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_host=conn.host, http_path=path,
|
||||
http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
if resp_chunk_size:
|
||||
@ -847,9 +843,8 @@ def head_object(url, token, container, name, http_conn=None):
|
||||
{'headers': headers}, resp, body)
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Object HEAD failed', http_scheme=parsed.scheme,
|
||||
http_host=conn.host, http_port=conn.port,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_host=conn.host, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
resp_headers = {}
|
||||
for header, value in resp.getheaders():
|
||||
@ -954,9 +949,8 @@ def put_object(url, token=None, container=None, name=None, contents=None,
|
||||
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Object PUT failed', http_scheme=parsed.scheme,
|
||||
http_host=conn.host, http_port=conn.port,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_host=conn.host, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
return resp.getheader('etag', '').strip('"')
|
||||
@ -994,9 +988,8 @@ def post_object(url, token, container, name, headers, http_conn=None,
|
||||
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Object POST failed', http_scheme=parsed.scheme,
|
||||
http_host=conn.host, http_port=conn.port,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_host=conn.host, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
|
||||
@ -1050,8 +1043,8 @@ def delete_object(url, token=None, container=None, name=None, http_conn=None,
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Object DELETE failed',
|
||||
http_scheme=parsed.scheme, http_host=conn.host,
|
||||
http_port=conn.port, http_path=path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_path=path, http_status=resp.status,
|
||||
http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
|
||||
|
||||
@ -1071,9 +1064,8 @@ def get_capabilities(http_conn):
|
||||
if resp.status < 200 or resp.status >= 300:
|
||||
raise ClientException('Capabilities 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,
|
||||
http_host=conn.host, http_path=parsed.path,
|
||||
http_status=resp.status, http_reason=resp.reason,
|
||||
http_response_content=body)
|
||||
return json_loads(body)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user