Comment 2 for bug 1199435

Revision history for this message
Lei Zhang (redheadflyundershadow) wrote :

After checking this carefully, I can fix the bug mentioned by the bug description.
But another error still there, that is db sync, we use sqlalchemy-migrate now, the version is 0.7.2,
can not support sqlalchemy 0.8, the ref is here:
https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=156
due to this error:
Traceback (most recent call last):
  File "heat/tests/test_watch.py", line 64, in setUp
    self.setUpDatabase()
  File "heat/tests/test_watch.py", line 49, in setUpDatabase
    utils.setup_dummy_db()
  File "heat/tests/utils.py", line 92, in setup_dummy_db
    migration.db_sync()
  File "heat/db/migration.py", line 28, in db_sync
    return IMPL.db_sync(version=version)
  File "heat/db/utils.py", line 40, in __getattr__
    backend = self.__get_backend()
  File "heat/db/utils.py", line 36, in __get_backend
    self.__backend = __import__(name, None, None, fromlist)
  File "heat/db/sqlalchemy/migration.py", line 54, in <module>
    from migrate.versioning import api as versioning_api
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 33, in <module>
    from migrate.versioning import (repository, schema, version,
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 10, in <module>
    from sqlalchemy import exceptions as sa_exceptions
ImportError: cannot import name exceptions

It is because sqlalchemy has removed exceptions module.

It also seems that sqlalchemy-migrate would not support sqlalchemy any more, so I suggest we use alembic as migration tools
If it is approved, I will add alembic repo and figure it out by using sqlalchemy >=0.8 in heat (like what neutron done).

What do you think?

Regards
Lei