Merge "Retrieve fresh network DB data before getting it in ml2"

This commit is contained in:
Jenkins 2017-04-03 23:46:39 +00:00 committed by Gerrit Code Review
commit cb60d32003
2 changed files with 9 additions and 3 deletions

View File

@ -815,7 +815,13 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
self.type_manager.extend_network_dict_provider(context,
updated_network)
updated_network = self.get_network(context, id)
# 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)
updated_network = self._make_network_dict(
db_network, context=context)
kwargs = {'context': context, 'network': updated_network,
'original_network': original_network}

View File

@ -177,8 +177,8 @@ class QosTestJSON(base.BaseAdminNetworkTest):
self.assertIn(rule, actual_rule_types)
def _disassociate_network(self, client, network_id):
client.update_network(network_id, qos_policy_id=None)
updated_network = self.admin_client.show_network(network_id)
updated_network = client.update_network(network_id,
qos_policy_id=None)
self.assertIsNone(updated_network['network']['qos_policy_id'])
@decorators.idempotent_id('65b9ef75-1911-406a-bbdb-ca1d68d528b0')