diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 9fe2d789a5..6e4a92536f 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -467,6 +467,9 @@ function init_manila { # (re)create manila database recreate_database manila utf8 $MANILA_BIN_DIR/manila-manage db sync + + # Display version as debug-action (see bug/1473400) + $MANILA_BIN_DIR/manila-manage db version fi # Create cache dir diff --git a/manila/db/migrations/alembic/versions/56cdbe267881_add_share_export_locations_table.py b/manila/db/migrations/alembic/versions/56cdbe267881_add_share_export_locations_table.py index faf4a59037..7e137fd010 100644 --- a/manila/db/migrations/alembic/versions/56cdbe267881_add_share_export_locations_table.py +++ b/manila/db/migrations/alembic/versions/56cdbe267881_add_share_export_locations_table.py @@ -55,7 +55,8 @@ def upgrade(): sa.Column('updated_at', sa.DateTime)) export_locations = [] - for share in op.get_bind().execute(shares_table.select()): + session = sa.orm.Session(bind=op.get_bind().connect()) + for share in session.query(shares_table).all(): deleted = share.deleted if isinstance(share.deleted, int) else 0 export_locations.append({ 'created_at': share.created_at, @@ -68,6 +69,7 @@ def upgrade(): op.bulk_insert(export_locations_table, export_locations) op.drop_column('shares', 'export_location') + session.close_all() def downgrade(): @@ -106,3 +108,4 @@ def downgrade(): connection.execute(update) op.drop_table('share_export_locations') + session.close_all() diff --git a/manila/db/migrations/alembic/versions/59eb64046740_add_required_extra_spec.py b/manila/db/migrations/alembic/versions/59eb64046740_add_required_extra_spec.py index a87e5c2bbb..9557b921c8 100644 --- a/manila/db/migrations/alembic/versions/59eb64046740_add_required_extra_spec.py +++ b/manila/db/migrations/alembic/versions/59eb64046740_add_required_extra_spec.py @@ -70,6 +70,7 @@ def upgrade(): }) op.bulk_insert(es_table, extra_specs) + session.close_all() def downgrade():