Close DB migration sessions explicitly for compatibility with PyMySQL
oslo.db lib starting with version 1.12.0 uses PyMySQL as mysql client.
We get problem with it as it does not close opened sessions by default.
And if we do some actions with migration sessions and do not close sessions,
then alembic, as db migration tool does not write to DB updated migration
version, that is final step of each migration.
It breaks further attempts to perform some migration actions in case some
migration can not be applied twice. Because of improper versions in DB,
alembic tries to execute same migrations again and again.
So, close migration sessions explicitly since PyMySQL does not do it itself.
Also, print version in devstack for getting more details in future debug of
devstack installation output.
Reviewed: https:/ /review. openstack. org/200848 /git.openstack. org/cgit/ openstack/ manila/ commit/ ?id=503203e243d 42d26d73d0aef16 774871b3496d6d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 503203e243d42d2 6d73d0aef167748 71b3496d6d
Author: Valeriy Ponomaryov <email address hidden>
Date: Sun Jul 12 00:04:22 2015 +0300
Close DB migration sessions explicitly for compatibility with PyMySQL
oslo.db lib starting with version 1.12.0 uses PyMySQL as mysql client.
We get problem with it as it does not close opened sessions by default.
And if we do some actions with migration sessions and do not close sessions,
then alembic, as db migration tool does not write to DB updated migration
version, that is final step of each migration.
It breaks further attempts to perform some migration actions in case some
migration can not be applied twice. Because of improper versions in DB,
alembic tries to execute same migrations again and again.
So, close migration sessions explicitly since PyMySQL does not do it itself.
Also, print version in devstack for getting more details in future debug of
devstack installation output.
Change-Id: I5c729f10bac23b 1853e18127b50b1 d9f053ab629
Closes-Bug: #1473400