Adds ExternalIpAddressExhaustedClient exception

Adds the ExternalIpAddressExhaustedClient exception so
a more specific exception than NeutronClientException is raised
when IPs run out. This will allow for better exception
handling in Nova.

Closes-Bug: 1233143

Change-Id: I9f40bf14eec0f485dfd21b36605a2474b99a8941
This commit is contained in:
Chris Yeoh
2013-09-30 22:30:10 +09:30
parent 16bf2825ad
commit 0d532673d7
2 changed files with 7 additions and 1 deletions

View File

@@ -94,6 +94,10 @@ class IpAddressGenerationFailureClient(NeutronClientException):
pass
class ExternalIpAddressExhaustedClient(NeutronClientException):
pass
class Unauthorized(NeutronClientException):
message = _("Unauthorized: bad credentials.")

View File

@@ -51,7 +51,9 @@ def exception_handler_v20(status_code, error_content):
'PortInUse': exceptions.PortInUseClient,
'AlreadyAttached': exceptions.AlreadyAttachedClient,
'IpAddressGenerationFailure':
exceptions.IpAddressGenerationFailureClient, }
exceptions.IpAddressGenerationFailureClient,
'ExternalIpAddressExhausted':
exceptions.ExternalIpAddressExhaustedClient, }
error_dict = None
if isinstance(error_content, dict):