diff options
| author | John Tran <jtran@attinteractive.com> | 2011-06-09 00:01:42 -0700 |
|---|---|---|
| committer | John Tran <jtran@attinteractive.com> | 2011-06-09 00:01:42 -0700 |
| commit | 463e0388308760dbf3bf2b3fa901d8076d002f91 (patch) | |
| tree | f132f1087ca7756c28226e594ccdb7523cb83d87 /nova/api | |
| parent | b11cf9bc7b1b9792bdab77aa72dc6163f3e44ca1 (diff) | |
| download | nova-463e0388308760dbf3bf2b3fa901d8076d002f91.tar.gz nova-463e0388308760dbf3bf2b3fa901d8076d002f91.tar.xz nova-463e0388308760dbf3bf2b3fa901d8076d002f91.zip | |
matched the inner exception specifically, instead of catching all RemoteError exceptions
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 6c5dba8ed..84a83d8e6 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -876,8 +876,11 @@ class CloudController(object): try: public_ip = self.network_api.allocate_floating_ip(context) return {'publicIp': public_ip} - except rpc.RemoteError: - raise exception.NoFloatingIpsDefined + except rpc.RemoteError as ex: + if ex.exc_type == 'NoMoreAddresses': + raise exception.NoFloatingIpsDefined + else: + raise def release_address(self, context, public_ip, **kwargs): LOG.audit(_("Release address %s"), public_ip, context=context) |
