]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Avoid fetching network in _commit_port_binding
authorrossella <rsblendido@suse.com>
Thu, 12 Feb 2015 15:51:03 +0000 (16:51 +0100)
committerrossella <rsblendido@suse.com>
Mon, 23 Feb 2015 10:57:56 +0000 (10:57 +0000)
There's no need to get the network from the DB in
_commit_port_binding since it's stored in the PortContext

Change-Id: Icd5200746dc8fbba336bd4e5714b90b9f89704c0

neutron/plugins/ml2/plugin.py

index 2972900893679e0e2537422ee18fd9e74a4ae5b1..8215789536c117f3e2ba8883f74f62b4bfe48bd4 100644 (file)
@@ -359,7 +359,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
                 return (None, None)
             oport = self._make_port_dict(port_db)
             port = self._make_port_dict(port_db)
-            network = self.get_network(plugin_context, port['network_id'])
+            network = new_context.network.current
             if port['device_owner'] == const.DEVICE_OWNER_DVR_INTERFACE:
                 # REVISIT(rkukura): The PortBinding instance from the
                 # ml2_port_bindings table, returned as cur_binding