Adds IpAddressGenerationFailureClient exception

Adds the IpAddressGenerationFailureClient exception so
a more specific exception than NeutronClientException is raised
when IPs run out. This will allow for better exception
handling in Nova and help fix nova bug 1212137

Change-Id: I921ba5d5f5ee3dc9620dcdbbd04d6fef824c9a53
Closes-Bug: 1231836
This commit is contained in:
Chris Yeoh
2013-09-27 17:04:44 +09:30
parent 15d5e50891
commit 16bf2825ad
2 changed files with 7 additions and 1 deletions

View File

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

View File

@@ -49,7 +49,9 @@ def exception_handler_v20(status_code, error_content):
'PortNotFound': exceptions.PortNotFoundClient,
'RequestedStateInvalid': exceptions.StateInvalidClient,
'PortInUse': exceptions.PortInUseClient,
'AlreadyAttached': exceptions.AlreadyAttachedClient, }
'AlreadyAttached': exceptions.AlreadyAttachedClient,
'IpAddressGenerationFailure':
exceptions.IpAddressGenerationFailureClient, }
error_dict = None
if isinstance(error_content, dict):