Browse Source

Merge "Remove unneeded DB register retrieval and refresh in network update" into stable/ussuri

changes/68/789868/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
7df0417208
1 changed files with 4 additions and 10 deletions
  1. +4
    -10
      neutron/plugins/ml2/plugin.py

+ 4
- 10
neutron/plugins/ml2/plugin.py View File

@ -1080,7 +1080,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
need_network_update_notify = False
with db_api.CONTEXT_WRITER.using(context):
original_network = self.get_network(context, id)
db_network = self._get_network(context, id)
original_network = self.get_network(context, id, net_db=db_network)
self._update_provider_network_attributes(
context, original_network, net_data)
@ -1091,12 +1092,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
updated_network)
self._process_l3_update(context, updated_network, net_data)
# ToDO(QoS): This would change once EngineFacade moves out
db_network = self._get_network(context, id)
# Expire the db_network in current transaction, so that the join
# relationship can be updated.
context.session.expire(db_network)
if mtuw_apidef.MTU in net_data:
db_network.mtu = self._get_network_mtu(db_network)
# agents should now update all ports to reflect new MTU
@ -1138,10 +1133,9 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
return updated_network
@db_api.retry_if_session_inactive()
def get_network(self, context, id, fields=None):
def get_network(self, context, id, fields=None, net_db=None):
with db_api.CONTEXT_READER.using(context):
net_db = self._get_network(context, id)
net_db = net_db or self._get_network(context, id)
net_data = self._make_network_dict(net_db, context=context)
self.type_manager.extend_network_dict_provider(context, net_data)


Loading…
Cancel
Save