From 45e92d47038514fc05ae17a8a38dae1b337c15fe Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 17 Jan 2013 12:42:24 -0800 Subject: Optimize network calls by moving them to api Now that quantumv2 replaces api, there is no need for many of the network calls to go over rpc. This patch optimizes them by moving the implementation into the api class. Note that the old methods are left in place to keep rpcapi compatibility. This patch also adds api_deprecated in case anyone is using a custom out-of-tree manager class. It is possible to set: network_api_class=nova.network.api_deprecated.API to get the old functionality. Part of blueprint optimize-nova-network Change-Id: I130908df060246e8a5f3711cf16d1c49ee3e2664 --- nova/api/openstack/compute/contrib/floating_ips.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index 3f00136f5..81b8c3dc0 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -67,11 +67,11 @@ def _translate_floating_ip_view(floating_ip): } try: result['fixed_ip'] = floating_ip['fixed_ip']['address'] - except (TypeError, KeyError): + except (TypeError, KeyError, AttributeError): result['fixed_ip'] = None try: result['instance_id'] = floating_ip['instance']['uuid'] - except (TypeError, KeyError): + except (TypeError, KeyError, AttributeError): result['instance_id'] = None return {'floating_ip': result} -- cgit