summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-09-01 05:37:27 +0000
committerTarmac <>2011-09-01 05:37:27 +0000
commit17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2 (patch)
tree71c189eb64e48d445e7f546ae8d4ade6d7082401 /nova/api
parentab00393da6ab61db1952b6826ea806b66ca6cc29 (diff)
parentfdf076a04e001b897d01b2a8c4a9e3c980ea8f94 (diff)
downloadnova-17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2.tar.gz
nova-17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2.tar.xz
nova-17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2.zip
fix for lp838583 - fixes bug in os-floating-ips view code that prevents instance_id from being returned for associated addresses.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/contrib/floating_ips.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py
index 6ce531c8f..d1add8f83 100644
--- a/nova/api/openstack/contrib/floating_ips.py
+++ b/nova/api/openstack/contrib/floating_ips.py
@@ -36,9 +36,9 @@ def _translate_floating_ip_view(floating_ip):
result['fixed_ip'] = floating_ip['fixed_ip']['address']
except (TypeError, KeyError):
result['fixed_ip'] = None
- if 'instance' in floating_ip:
- result['instance_id'] = floating_ip['instance']['id']
- else:
+ try:
+ result['instance_id'] = floating_ip['fixed_ip']['instance_id']
+ except (TypeError, KeyError):
result['instance_id'] = None
return {'floating_ip': result}