Fix sqlalchemy 0.8 issues
Use import of exc instead exception. Mutability tracking is changed in SQLAlchemy 0.8, but it seems that sqlalchmy.types.MutableType is not needed in classes Json and Failure from models. Closes-bug: 1206669 Change-Id: Ib13c2575ead495b22ed5624e68e044e2f4927201
This commit is contained in:
@@ -27,7 +27,7 @@ import logging
|
||||
import time
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import exceptions as sa_exc
|
||||
from sqlalchemy import exc as sa_exc
|
||||
from sqlalchemy import orm as sa_orm
|
||||
from sqlalchemy import pool as sa_pool
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class TimestampMixin(object):
|
||||
updated_at = Column(DateTime, onupdate=timeutils.utcnow)
|
||||
|
||||
|
||||
class Json(types.TypeDecorator, types.MutableType):
|
||||
class Json(types.TypeDecorator):
|
||||
impl = types.Text
|
||||
|
||||
def process_bind_param(self, value, dialect):
|
||||
@@ -49,7 +49,7 @@ class Json(types.TypeDecorator, types.MutableType):
|
||||
return jsonutils.loads(value)
|
||||
|
||||
|
||||
class Failure(types.TypeDecorator, types.MutableType):
|
||||
class Failure(types.TypeDecorator):
|
||||
"""Put misc.Failure object into database column.
|
||||
|
||||
We convert Failure object to dict, serialize that dict into
|
||||
|
||||
Reference in New Issue
Block a user