Merge "make ClientException.http_status default to None rather than 0"

This commit is contained in:
Jenkins 2015-09-10 21:47:43 +00:00 committed by Gerrit Code Review
commit 26d29f5ce0
2 changed files with 3 additions and 3 deletions

@ -1400,7 +1400,7 @@ class Connection(object):
self.http_conn = None
except ClientException as err:
self._add_response_dict(caller_response_dict, kwargs)
if self.attempts > self.retries:
if self.attempts > self.retries or err.http_status is None:
logger.exception(err)
raise
if err.http_status == 401:

@ -17,9 +17,9 @@
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=''):
Exception.__init__(self, msg)
super(ClientException, self).__init__(msg)
self.msg = msg
self.http_scheme = http_scheme
self.http_host = http_host