Bump to sqlalchemy-migrate 0.8.2

This allows us to drop some unsightly sqlalchemy-migrate 0.7.3
patching.

The related requirements change is here:

  Icde6248ca102884323d7912bab0f4a716aa294ec

Change-Id: I5f80dfc07f8256716d025002fc1a1f47e58b2142
This commit is contained in:
Dan Prince 2013-12-02 19:14:43 -05:00
parent 6a6fc11489
commit 2a8485a296
2 changed files with 4 additions and 37 deletions

View File

@ -19,48 +19,15 @@
import os
import distutils.version as dist_version
import migrate
from migrate.versioning import util as migrate_util
from migrate import exceptions as versioning_exceptions
from migrate.versioning import api as versioning_api
from migrate.versioning.repository import Repository
import sqlalchemy
from cinder.db.sqlalchemy.api import get_engine
from cinder import exception
from cinder.openstack.common import log as logging
INIT_VERSION = 000
LOG = logging.getLogger(__name__)
@migrate_util.decorator
def patched_with_engine(f, *a, **kw):
url = a[0]
engine = migrate_util.construct_engine(url, **kw)
try:
kw['engine'] = engine
return f(*a, **kw)
finally:
if isinstance(engine, migrate_util.Engine) and engine is not url:
migrate_util.log.debug('Disposing SQLAlchemy engine %s', engine)
engine.dispose()
# TODO(jkoelker) When migrate 0.7.3 is released and cinder depends
# on that version or higher, this can be removed
MIN_PKG_VERSION = dist_version.StrictVersion('0.7.3')
if (not hasattr(migrate, '__version__') or
dist_version.StrictVersion(migrate.__version__) < MIN_PKG_VERSION):
migrate_util.with_engine = patched_with_engine
# NOTE(jkoelker) Delay importing migrate until we are patched
from migrate import exceptions as versioning_exceptions
from migrate.versioning import api as versioning_api
from migrate.versioning.repository import Repository
_REPOSITORY = None

View File

@ -21,7 +21,7 @@ Routes>=1.12.3
rtslib-fb>=2.1.39
six>=1.4.1
SQLAlchemy>=0.7.8,<=0.7.99
sqlalchemy-migrate>=0.7.2
sqlalchemy-migrate>=0.8.2
stevedore>=0.10
suds>=0.4
WebOb>=1.2.3,<1.3