Merge "Fix incorrect exception order in _execute_request"

This commit is contained in:
Jenkins 2014-11-28 21:54:48 +00:00 committed by Gerrit Code Review
commit 51aad1c43a
2 changed files with 4 additions and 5 deletions

View File

@ -19,7 +19,6 @@ disable=
locally-disabled,
# "E" Error for important programming issues (likely bugs)
access-member-before-definition,
bad-except-order,
bad-super-call,
maybe-no-member,
no-member,

View File

@ -130,15 +130,15 @@ class NSClient(object):
try:
response = requests.request(method, url=resource_uri,
headers=headers, data=body)
except requests.exceptions.SSLError:
LOG.exception(_LE("SSL error occurred while connecting to %s"),
self.service_uri)
raise NCCException(NCCException.CONNECTION_ERROR)
except requests.exceptions.ConnectionError:
LOG.exception(_LE("Connection error occurred while connecting "
"to %s"),
self.service_uri)
raise NCCException(NCCException.CONNECTION_ERROR)
except requests.exceptions.SSLError:
LOG.exception(_LE("SSL error occurred while connecting to %s"),
self.service_uri)
raise NCCException(NCCException.CONNECTION_ERROR)
except requests.exceptions.Timeout:
LOG.exception(_LE("Request to %s timed out"), self.service_uri)
raise NCCException(NCCException.CONNECTION_ERROR)