diff options
| author | Chuck Short <chuck.short@canonical.com> | 2012-08-09 15:32:20 -0500 |
|---|---|---|
| committer | Chuck Short <chuck.short@canonical.com> | 2012-08-09 15:43:17 -0500 |
| commit | 65c3759674dec87c895c44d95c7b279ea4e4eb05 (patch) | |
| tree | ec11428c07dc048389a495f69e77769a24e1321b /nova/api | |
| parent | c60e2e8f30ced68c24ef9af75bd429a7529f353d (diff) | |
| download | nova-65c3759674dec87c895c44d95c7b279ea4e4eb05.tar.gz nova-65c3759674dec87c895c44d95c7b279ea4e4eb05.tar.xz nova-65c3759674dec87c895c44d95c7b279ea4e4eb05.zip | |
Traceback when over allocating IP addresses
When a user over allocates a number of IP addresses
via euca-allocate-address, the user will get a nice
traceback saying that they over quota for IP address
allocation. Display a more userfriendly error when this
happens.
LP: #971609
Change-Id: If8586e246564f1069cb60bac9592f9d750522e81
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 22eb78b63..42ba1e8e5 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1098,7 +1098,10 @@ class CloudController(object): def allocate_address(self, context, **kwargs): LOG.audit(_("Allocate address"), context=context) - public_ip = self.network_api.allocate_floating_ip(context) + try: + public_ip = self.network_api.allocate_floating_ip(context) + except exception.FloatingIpLimitExceeded: + raise exception.EC2APIError(_('No more floating IPs available')) return {'publicIp': public_ip} def release_address(self, context, public_ip, **kwargs): |
