Add OverQuotaClient as exception to neutronclient

In nova, there is no way to explictly knows whether the neutron
fails due to over quota or no more floating ips and fixed ips.
so nova need to check whether the return value is 409 in order to
raise an over quota exception. It's easier in neutronclient to
raise the exception then nova will handle it.

Related-Bug: #1210598

Change-Id: I8788993578ac872da9f676fe3e2fb8f98414289d
This commit is contained in:
jichenjc 2014-04-22 14:20:02 +08:00
parent f6eba87aa1
commit cbdd56da30
2 changed files with 5 additions and 0 deletions
neutronclient

@ -139,6 +139,10 @@ class IpAddressInUseClient(Conflict):
pass
class OverQuotaClient(Conflict):
pass
# TODO(amotoki): It is unused in Neutron, but it is referred to
# in Horizon code. After Horizon code is updated, remove it.
class AlreadyAttachedClient(Conflict):

@ -591,6 +591,7 @@ class CLITestV20ExceptionHandler(CLITestV20Base):
exceptions.IpAddressGenerationFailureClient, 409),
('ExternalIpAddressExhausted',
exceptions.ExternalIpAddressExhaustedClient, 400),
('OverQuota', exceptions.OverQuotaClient, 409),
]
error_msg = 'dummy exception message'