Permalink
Browse files

Merge branch 'migrate-fixes' of git://github.com/PiotrSikora/buildbot

* 'migrate-fixes' of git://github.com/PiotrSikora/buildbot:
  Change order.
  Fix integration with SQLAlchemy-migrate-0.6.1.

(_hush_pyflakes added by dustin)
  • Loading branch information...
2 parents eae1014 + fb4d65f commit 0e78c4c71020170c2732bbdc1d898cb0d9a6b723 @djmitche djmitche committed Feb 16, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 master/buildbot/db/model.py
@@ -21,10 +21,15 @@
import migrate
import migrate.versioning.schema
import migrate.versioning.repository
-import migrate.versioning.exceptions
from twisted.python import util, log
from buildbot.db import base
+try:
+ from migrate.versioning import exceptions
+ _hush_pyflakes = exceptions
+except ImportError:
+ from migrate import exceptions
+
class Model(base.DBConnectorComponent):
"""
DBConnector component to handle the database model; an instance is available
@@ -345,7 +350,7 @@ def thd(engine):
# migrate.api doesn't let us hand in an engine
schema = migrate.versioning.schema.ControlledSchema(engine, self.repo_path)
db_version = schema.version
- except migrate.versioning.exceptions.DatabaseNotControlledError:
+ except exceptions.DatabaseNotControlledError:
return False
return db_version == repo_version

0 comments on commit 0e78c4c

Please sign in to comment.