close db migration session
Explicitly close sessions in db migration 022. With the postgresql backend if the session is not closed explicitly it leaves a user of the db behind which can cause problems later on Fixes bug #1158544 Change-Id: I389b83397addc5901aa94b584856fbd7f5cef485
This commit is contained in:
parent
4561612cce
commit
9467a6602e
|
@ -30,6 +30,7 @@ def upgrade(migrate_engine):
|
|||
endpoint_table.c.extra: json.dumps(extra),
|
||||
endpoint_table.c.legacy_endpoint_id: legacy_endpoint_id})
|
||||
migrate_engine.execute(q)
|
||||
session.close()
|
||||
|
||||
|
||||
def downgrade(migrate_engine):
|
||||
|
@ -50,3 +51,4 @@ def downgrade(migrate_engine):
|
|||
endpoint_table.c.extra: json.dumps(extra),
|
||||
endpoint_table.c.legacy_endpoint_id: None})
|
||||
migrate_engine.execute(q)
|
||||
session.close()
|
||||
|
|
Loading…
Reference in New Issue