~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/openstack/common/db/sqlalchemy/migration_cli/ext_alembic.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, James Page
  • Date: 2014-04-04 11:54:02 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140404115402-wz51btzqxomdizv0
Tags: 2014.1~rc1-0ubuntu1
[ Adam Gandelman ]
* debian/ironic-common.postinst: Fix syntax preventing postinst
  from running.
* debian/ironic-api.install: Create missing .install, install
  ironic-api to /usr/bin/ironic-api.
* debian/patches/set_logdir.patch: Set log_dir to /var/log/ironic/ in
  sample config, causing both daemons to log to respective files there.
* debian/{rules, ironic-common.install}: Install ironic.conf.sample
  as /etc/ironic/ironic.conf.
* Fail build if test suite fails, limit testing concurrency to 1.
* debian/control: Add missing alembic, python-lockfile dependencies.

[ James Page ]
* d/control: Add Vcs-* fields for ubuntu-server-dev branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        repo_path = migration_config.get('alembic_repo_path')
41
41
        if repo_path:
42
42
            self.config.set_main_option('script_location', repo_path)
 
43
        self.db_url = migration_config['db_url']
43
44
 
44
45
    def upgrade(self, version):
45
46
        return alembic.command.upgrade(self.config, version or 'head')
50
51
        return alembic.command.downgrade(self.config, version)
51
52
 
52
53
    def version(self):
53
 
        engine = db_session.get_engine()
 
54
        engine = db_session.create_engine(self.db_url)
54
55
        with engine.connect() as conn:
55
56
            context = alembic_migration.MigrationContext.configure(conn)
56
57
            return context.get_current_revision()