NSX_V3: ensure that the correct router attributes are read

Make sure that the correct router attributes are read. If not
a StaleData exception is raised.

Change-Id: I58e90a7a361dc7dca1267d62545e838153fe7bec
This commit is contained in:
Gary Kotton 2018-01-08 02:15:40 -08:00 committed by garyk
parent bad6dc68a9
commit ddb2a7cf9a

View File

@ -3309,8 +3309,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
context,
router['id'],
{'router': {az_def.AZ_HINTS: az_hints}})
with db_api.context_manager.writer.using(context):
router_db = self._get_router(context, r['id'])
with db_api.context_manager.writer.using(context):
self._process_extra_attr_router_create(context, router_db, r)
# Create backend entries here in case neutron DB exception
# occurred during super.create_router(), which will cause