summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2013-01-17 12:42:24 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2013-01-31 15:38:17 -0800
commit45e92d47038514fc05ae17a8a38dae1b337c15fe (patch)
tree380c42ba080cbd8e1fea82280e87ce3528fe2cd0 /nova/api
parent05751bb7861892b949dedeccc283ce48abee0d16 (diff)
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
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/floating_ips.py4
1 files changed, 2 insertions, 2 deletions
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}