Merge "Fix CellDatabases fixture swallowing exceptions" into stable/pike

This commit is contained in:
Zuul 2017-12-18 09:01:43 +00:00 committed by Gerrit Code Review
commit 5f8266a640
1 changed files with 3 additions and 5 deletions

View File

@ -418,11 +418,9 @@ class CellDatabases(fixtures.Fixture):
# cell_mapping of None. Since we're controlling our
# own targeting in this fixture, we need to call this out
# specifically and avoid switching global database state
try:
with self._real_target_cell(context, cell_mapping) as c:
yield c
finally:
return
with self._real_target_cell(context, cell_mapping) as c:
yield c
return
ctxt_mgr = self._ctxt_mgrs[cell_mapping.database_connection]
# This assumes the next local DB access is the same cell that
# was targeted last time.