Add missing transaction in driver_controller.
All the operations related to router associations (add/del) were executed under transactions, there was a case 'get_provider_for_router' doing add_resource_association out of db transaction, luckily due to autocommit there were no issues but this patch adds the missing transaction. Closes-Bug: #1778118 Change-Id: Iaec9a40614c7e6ce1120e9fa7ef3a4fdb4d59963
This commit is contained in:
parent
b9fabd8267
commit
d97cce0403
|
@ -180,10 +180,13 @@ class DriverController(object):
|
|||
router = self.l3_plugin.get_router(context, router_id)
|
||||
driver = self._attrs_to_driver(router)
|
||||
driver_name = driver.name
|
||||
self._stm.add_resource_association(context, plugin_constants.L3,
|
||||
with context.session.begin(subtransactions=True):
|
||||
self._stm.add_resource_association(
|
||||
context, plugin_constants.L3,
|
||||
driver_name, router_id)
|
||||
registry.notify(
|
||||
resources.ROUTER_CONTROLLER, events.PRECOMMIT_ADD_ASSOCIATION,
|
||||
resources.ROUTER_CONTROLLER,
|
||||
events.PRECOMMIT_ADD_ASSOCIATION,
|
||||
self, context=context, router_id=router_id,
|
||||
router=router, old_driver=None, new_driver=driver)
|
||||
return self.drivers[driver_name]
|
||||
|
|
Loading…
Reference in New Issue