From 21ee9f58b803170f99bd455b8f26b40b2200927e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 18 May 2016 12:08:25 -0400 Subject: [PATCH] Remove cap on oslo.db version This commit removes the requirements cap on oslo.db. This was originally added because of the removal of a private interface that subunit2sql depended on in it's alembic env.py. A public interface was eventually added to provide analogous functionality but subunit2sql never removed the cap and used the new interface; until now. Change-Id: Idbc17096d0d3fe43261026b866041ae8a97d86fc --- requirements.txt | 2 +- subunit2sql/migrations/env.py | 4 ++-- subunit2sql/tests/migrations/test_model_sync.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index c79b0ec..eeac8b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ alembic>=0.4.1 oslo.config>=1.4.0.0a3 -oslo.db!=1.12.0,<2.0.0 +oslo.db>=2.1.0 oslo.concurrency pbr>=1.0.0 python-subunit>=0.0.18 diff --git a/subunit2sql/migrations/env.py b/subunit2sql/migrations/env.py index 4095a82..e165081 100644 --- a/subunit2sql/migrations/env.py +++ b/subunit2sql/migrations/env.py @@ -79,7 +79,7 @@ def run_migrations_online(): facade = db_api._create_facade_lazily() engine = facade.get_engine() connection = engine.connect() - facade._session_maker.configure(bind=connection) + facade.get_sessionmaker().configure(bind=connection) context.configure(connection=connection, target_metadata=target_metadata, @@ -90,7 +90,7 @@ def run_migrations_online(): context.run_migrations() finally: connection.close() - facade._session_maker.configure(bind=engine) + facade.get_sessionmaker().configure(bind=engine) if context.is_offline_mode(): run_migrations_offline() diff --git a/subunit2sql/tests/migrations/test_model_sync.py b/subunit2sql/tests/migrations/test_model_sync.py index 90d8f85..a06fbfb 100644 --- a/subunit2sql/tests/migrations/test_model_sync.py +++ b/subunit2sql/tests/migrations/test_model_sync.py @@ -108,7 +108,7 @@ class TestModelsMigrations(test_migrations.ModelsMigrationsSync, object_, name, type_, reflected, compare_to) def filter_metadata_diff(self, diff): - return filter(self.remove_unrelated_errors, diff) + return list(filter(self.remove_unrelated_errors, diff)) def remove_unrelated_errors(self, element): insp = sqlalchemy.engine.reflection.Inspector.from_engine(