Skip to content

Commit

Permalink
Merge "Move to oslo.db"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jul 22, 2014
2 parents f4a2e99 + 6185e9d commit 323aba6
Show file tree
Hide file tree
Showing 27 changed files with 35 additions and 2,948 deletions.
3 changes: 1 addition & 2 deletions glance/cmd/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
sys.path.insert(0, possible_topdir)

from oslo.config import cfg
from oslo.db.sqlalchemy import migration

from glance.common import config
from glance.common import exception
from glance.common import utils
from glance.db import migration as db_migration
from glance.db.sqlalchemy import api as db_api
from glance.openstack.common.db.sqlalchemy import migration
from glance.openstack.common import gettextutils
from glance.openstack.common import log
from glance.openstack.common import strutils
Expand All @@ -67,7 +67,6 @@

CONF = cfg.CONF
CONF.register_opts(manager_opts)
CONF.import_group("database", "glance.openstack.common.db.options")


# Decorators for actions
Expand Down
2 changes: 1 addition & 1 deletion glance/db/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
IMPL = utils.LazyPluggable(
'backend',
config_group='database',
sqlalchemy='glance.openstack.common.db.sqlalchemy.migration')
sqlalchemy='oslo.db.sqlalchemy.migration')

INIT_VERSION = 0

Expand Down
18 changes: 9 additions & 9 deletions glance/db/sqlalchemy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

"""Defines interface for DB access."""

import threading

from oslo.config import cfg
from oslo.db import exception as db_exception
from oslo.db.sqlalchemy import session
from retrying import retry
import six
from six.moves import xrange
Expand All @@ -30,8 +34,6 @@

from glance.common import exception
from glance.db.sqlalchemy import models
from glance.openstack.common.db import exception as db_exception
from glance.openstack.common.db.sqlalchemy import session
from glance.openstack.common import gettextutils
import glance.openstack.common.log as os_logging
from glance.openstack.common import timeutils
Expand All @@ -49,11 +51,9 @@

CONF = cfg.CONF
CONF.import_opt('debug', 'glance.openstack.common.log')
CONF.import_opt('connection', 'glance.openstack.common.db.options',
group='database')


_FACADE = None
_LOCK = threading.Lock()


def _retry_on_deadlock(exc):
Expand All @@ -66,11 +66,11 @@ def _retry_on_deadlock(exc):


def _create_facade_lazily():
global _FACADE
global _LOCK, _FACADE
if _FACADE is None:
_FACADE = session.EngineFacade(
CONF.database.connection,
**dict(six.iteritems(CONF.database)))
with _LOCK:
if _FACADE is None:
_FACADE = session.EngineFacade.from_config(CONF)
return _FACADE


Expand Down
2 changes: 1 addition & 1 deletion glance/db/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import uuid

from oslo.db.sqlalchemy import models
from sqlalchemy import BigInteger
from sqlalchemy import Boolean
from sqlalchemy import Column
Expand All @@ -35,7 +36,6 @@
from sqlalchemy.types import TypeDecorator
from sqlalchemy import UniqueConstraint

from glance.openstack.common.db.sqlalchemy import models
from glance.openstack.common import jsonutils
from glance.openstack.common import timeutils

Expand Down
Empty file.
162 changes: 0 additions & 162 deletions glance/openstack/common/db/api.py

This file was deleted.

56 changes: 0 additions & 56 deletions glance/openstack/common/db/exception.py

This file was deleted.

0 comments on commit 323aba6

Please sign in to comment.