From: Dan Wendlandt Date: Sun, 29 Jan 2012 22:11:03 +0000 (-0800) Subject: bug 923510: avoid querying all ports for non-detail GET Network call. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1eb3c693b5f6f3f301047100c36c7915434f8be7;p=openstack-build%2Fneutron-build.git bug 923510: avoid querying all ports for non-detail GET Network call. Change-Id: I9b4a20e5f6eb22dc234dfa675e7ca4f52893707d --- diff --git a/quantum/api/networks.py b/quantum/api/networks.py index bf90c3165..9ad883e6d 100644 --- a/quantum/api/networks.py +++ b/quantum/api/networks.py @@ -57,8 +57,10 @@ class Controller(common.QuantumController): # Doing this in the API is inefficient # TODO(salvatore-orlando): This should be fixed with Bug #834012 # Don't pass filter options - port_list = self._plugin.get_all_ports(tenant_id, network_id) - ports_data = [self._plugin.get_port_details( + ports_data = None + if port_details: + port_list = self._plugin.get_all_ports(tenant_id, network_id) + ports_data = [self._plugin.get_port_details( tenant_id, network_id, port['port-id']) for port in port_list] builder = networks_view.get_view_builder(request, self.version)