summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem@us.ibm.com>2014-07-23 09:27:46 -0700
committerMatt Riedemann <mriedem@us.ibm.com>2014-07-23 10:37:30 -0700
commit5eeba0ca19a683ef546cacd280a0dd1dfdb4995e (patch)
treede3028a7ff78b46d60b0a080450aa1a9f5862d31
parente0591432fc8128d8df41a692e416b2758a3cf7a9 (diff)
downloadpython-neutronclient-5eeba0ca19a683ef546cacd280a0dd1dfdb4995e.tar.gz
Add MacAddressInUseClient exception handling
Nova needs a specific client exception defined for the server's MacAddressInUse exception when allocating ports so it can handle the exception properly, otherwise the NeutronClientException with a 409 can be confused with other errors. Partial-Bug: #1347778 Change-Id: Ia02dbc8fe32a43adeb229e3b640b9b33ec0dd6c7
-rw-r--r--neutronclient/common/exceptions.py4
-rw-r--r--neutronclient/tests/unit/test_cli20.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/neutronclient/common/exceptions.py b/neutronclient/common/exceptions.py
index 3572660..4c21e62 100644
--- a/neutronclient/common/exceptions.py
+++ b/neutronclient/common/exceptions.py
@@ -155,6 +155,10 @@ class IpAddressGenerationFailureClient(Conflict):
pass
+class MacAddressInUseClient(Conflict):
+ pass
+
+
class ExternalIpAddressExhaustedClient(BadRequest):
pass
diff --git a/neutronclient/tests/unit/test_cli20.py b/neutronclient/tests/unit/test_cli20.py
index 40502f2..daad6a0 100644
--- a/neutronclient/tests/unit/test_cli20.py
+++ b/neutronclient/tests/unit/test_cli20.py
@@ -604,6 +604,7 @@ class CLITestV20ExceptionHandler(CLITestV20Base):
('IpAddressInUse', exceptions.IpAddressInUseClient, 409),
('IpAddressGenerationFailure',
exceptions.IpAddressGenerationFailureClient, 409),
+ ('MacAddressInUse', exceptions.MacAddressInUseClient, 409),
('ExternalIpAddressExhausted',
exceptions.ExternalIpAddressExhaustedClient, 400),
('OverQuota', exceptions.OverQuotaClient, 409),