NSX|V: Fix vcns timeout exception

Using a dedicated timeout exception for vcns calls timeout
The exception used before was logged as 'unprintable' since it didn't
include the relevant parameters

Change-Id: I706f3819ecaa180752e7c1926f7ec63510962f3a
This commit is contained in:
Adit Sarfaty 2017-10-17 18:57:05 +03:00
parent 14399bdf0b
commit de1de539fb
2 changed files with 5 additions and 1 deletions

View File

@ -144,7 +144,7 @@ class VcnsApiHelper(object):
headers=headers,
timeout=self.timeout)
except requests.exceptions.Timeout:
raise exceptions.VcnsApiException(uri=uri)
raise exceptions.ResourceTimedOut(uri=uri)
status = response.status_code

View File

@ -62,6 +62,10 @@ class ResourceNotFound(VcnsApiException):
message = _("Resource %(uri)s not found")
class ResourceTimedOut(VcnsApiException):
message = _("Resource %(uri)s timed out")
class MediaTypeUnsupport(VcnsApiException):
message = _("Media Type %(uri)s is not supported")