]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
bug 923510: avoid querying all ports for non-detail GET Network call.
authorDan Wendlandt <dan@nicira.com>
Sun, 29 Jan 2012 22:11:03 +0000 (14:11 -0800)
committerDan Wendlandt <dan@nicira.com>
Sun, 29 Jan 2012 22:11:03 +0000 (14:11 -0800)
Change-Id: I9b4a20e5f6eb22dc234dfa675e7ca4f52893707d

quantum/api/networks.py

index bf90c31654e5cb1188b415f1973c670abb856ee4..9ad883e6df7f172d41646d40c5fe6b856d82e33d 100644 (file)
@@ -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)