Merge "minutæ: port ClientException tweaks from swiftclient; dict .pop"

This commit is contained in:
Jenkins 2015-10-12 12:56:13 +00:00 committed by Gerrit Code Review
commit be0ae0172b
2 changed files with 4 additions and 10 deletions

View File

@ -513,14 +513,8 @@ def retry(func, *args, **kwargs):
:returns: result of func
:raises ClientException: all retries failed
"""
retries = 5
if 'retries' in kwargs:
retries = kwargs['retries']
del kwargs['retries']
error_log = None
if 'error_log' in kwargs:
error_log = kwargs['error_log']
del kwargs['error_log']
retries = kwargs.pop('retries', 5)
error_log = kwargs.pop('error_log', None)
attempts = 0
backoff = 1
while attempts <= retries:

View File

@ -214,9 +214,9 @@ class APIVersionError(SwiftException):
class ClientException(Exception):
def __init__(self, msg, http_scheme='', http_host='', http_port='',
http_path='', http_query='', http_status=0, http_reason='',
http_path='', http_query='', http_status=None, http_reason='',
http_device='', http_response_content='', http_headers=None):
Exception.__init__(self, msg)
super(ClientException, self).__init__(msg)
self.msg = msg
self.http_scheme = http_scheme
self.http_host = http_host