Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using enginefacade #175

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions magnum/common/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from eventlet.green import threading
from oslo_context import context
from oslo_db.sqlalchemy import enginefacade

from magnum.common import policy

Expand All @@ -20,6 +21,7 @@
CONF = magnum.conf.CONF


@enginefacade.transaction_context_provider
class RequestContext(context.RequestContext):
"""Extends security contexts from the OpenStack common library."""

Expand Down
4 changes: 2 additions & 2 deletions magnum/db/sqlalchemy/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from logging import config as log_config

from alembic import context
from oslo_db.sqlalchemy import enginefacade

from magnum.db.sqlalchemy import api as sqla_api
from magnum.db.sqlalchemy import models

# this is the Alembic Config object, which provides
Expand Down Expand Up @@ -43,7 +43,7 @@ def run_migrations_online():
and associate a connection with the context.
"""
engine = sqla_api.get_engine()
engine = enginefacade.writer.get_engine()
with engine.connect() as connection:
context.configure(connection=connection,
target_metadata=target_metadata)
Expand Down
Loading