]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Big Switch: Add missing data to topology sync
authorKevin Benton <blak111@gmail.com>
Mon, 9 Jun 2014 18:50:30 +0000 (11:50 -0700)
committerKevin Benton <blak111@gmail.com>
Sat, 7 Jun 2014 04:33:19 +0000 (21:33 -0700)
Adds data to the topology sync function that was
missing in the case where it is called from the
ML2 driver.

Closes-Bug: #1328222
Change-Id: I1cc3b0430f63f62c881f28139d1e5ebf22766357

neutron/plugins/bigswitch/plugin.py

index 1e9621846d6a7a421f19a549c19f56ef38d572ff..5e44d99a60704acf9d9bfd15e8454cb0e1a6c4ab 100644 (file)
@@ -178,11 +178,13 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
                       get_routers=True):
         admin_context = qcontext.get_admin_context()
         networks = []
-
-        all_networks = self.get_networks(admin_context) or []
+        # this method is used by the ML2 driver so it can't directly invoke
+        # the self.get_(ports|networks) methods
+        plugin = manager.NeutronManager.get_plugin()
+        all_networks = plugin.get_networks(admin_context) or []
         for net in all_networks:
             mapped_network = self._get_mapped_network_with_subnets(net)
-            flips_n_ports = {}
+            flips_n_ports = mapped_network
             if get_floating_ips:
                 flips_n_ports = self._get_network_with_floatingips(
                     mapped_network)
@@ -190,8 +192,8 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
             if get_ports:
                 ports = []
                 net_filter = {'network_id': [net.get('id')]}
-                net_ports = self.get_ports(admin_context,
-                                           filters=net_filter) or []
+                net_ports = plugin.get_ports(admin_context,
+                                             filters=net_filter) or []
                 for port in net_ports:
                     mapped_port = self._map_state_and_status(port)
                     mapped_port['attachment'] = {