diff options
| author | Anthony Young <sleepsonthefloor@gmail.com> | 2011-09-08 13:18:08 -0700 |
|---|---|---|
| committer | Anthony Young <sleepsonthefloor@gmail.com> | 2011-09-08 13:18:08 -0700 |
| commit | fe355a10ad0a215eb5295e46e6c106221972e7ed (patch) | |
| tree | 6a7decaf8eab3037a1a58f6f22b0acaee0f591cf /nova/api | |
| parent | b6d454762d7fdf9b202d8a580dd9bfdf069a5e80 (diff) | |
make check for fixed_ip association more defensive
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/contrib/floating_ips.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py index 9ceb5858f..d078b26c6 100644 --- a/nova/api/openstack/contrib/floating_ips.py +++ b/nova/api/openstack/contrib/floating_ips.py @@ -107,7 +107,7 @@ class FloatingIPController(object): context = req.environ['nova.context'] floating_ip = self.network_api.get_floating_ip(context, id) - if floating_ip['fixed_ip']: + if floating_ip.get('fixed_ip'): self.network_api.disassociate_floating_ip(context, floating_ip['address']) @@ -161,7 +161,7 @@ class Floating_ips(extensions.ExtensionDescriptor): raise webob.exc.HTTPBadRequest(explanation=msg) floating_ip = self.network_api.get_floating_ip_by_ip(context, address) - if floating_ip['fixed_ip']: + if floating_ip.get('fixed_ip'): self.network_api.disassociate_floating_ip(context, address) return webob.Response(status_int=202) |
