Skip to content

Commit 0d53267

Browse files
author
Chris Yeoh
committed
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
1 parent 16bf282 commit 0d53267

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

neutronclient/common/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class IpAddressGenerationFailureClient(NeutronClientException):
9494
pass
9595

9696

97+
class ExternalIpAddressExhaustedClient(NeutronClientException):
98+
pass
99+
100+
97101
class Unauthorized(NeutronClientException):
98102
message = _("Unauthorized: bad credentials.")
99103

neutronclient/v2_0/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def exception_handler_v20(status_code, error_content):
5151
'PortInUse': exceptions.PortInUseClient,
5252
'AlreadyAttached': exceptions.AlreadyAttachedClient,
5353
'IpAddressGenerationFailure':
54-
exceptions.IpAddressGenerationFailureClient, }
54+
exceptions.IpAddressGenerationFailureClient,
55+
'ExternalIpAddressExhausted':
56+
exceptions.ExternalIpAddressExhaustedClient, }
5557

5658
error_dict = None
5759
if isinstance(error_content, dict):

0 commit comments

Comments
 (0)