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:
Chris Yeoh 2013-03-22 08:45:13 +10:30
parent 4561612cce
commit 9467a6602e
1 changed files with 2 additions and 0 deletions

View File

@ -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()