diff options
| author | Anthony Young <sleepsonthefloor@gmail.com> | 2011-09-01 05:37:27 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-09-01 05:37:27 +0000 |
| commit | 17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2 (patch) | |
| tree | 71c189eb64e48d445e7f546ae8d4ade6d7082401 /nova/api | |
| parent | ab00393da6ab61db1952b6826ea806b66ca6cc29 (diff) | |
| parent | fdf076a04e001b897d01b2a8c4a9e3c980ea8f94 (diff) | |
| download | nova-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.py | 6 |
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} |
