diff options
author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2014-10-03 12:42:24 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2014-10-03 12:42:24 +0200 |
commit | 1084cb4e1ee5b09425c0ab95a96350f3ff50437b (patch) | |
tree | 90ae661bd207be8d5b8d7fc2343f053b7e3e2ca4 | |
parent | 634fa1d36d53fdbfe198dcb3236433d80d94344d (diff) | |
download | openstack-ansible-modules-1084cb4e1ee5b09425c0ab95a96350f3ff50437b.tar.gz |
Support icehouse in keystone_manage
The database migration functions moved around in keystone during the
icehouse cycle. This patch adds support for this release.
-rw-r--r-- | keystone_manage | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/keystone_manage b/keystone_manage index 37161a0..780f7c9 100644 --- a/keystone_manage +++ b/keystone_manage @@ -36,13 +36,19 @@ except AttributeError: pass try: - from keystone.common.sql import migration + from keystone.common import sql from migrate.versioning import api as versioning_api except ImportError: keystone_found = False else: keystone_found = True +try: + # for icehouse + from keystone.common.sql import migration_helpers as migration +except ImportError: + pass + def will_db_change(conf): """ Check if the database version will change after the sync. @@ -51,8 +57,14 @@ def will_db_change(conf): """ # Load the config file options - migration.CONF(project='keystone', default_config_files=[conf]) - current_version = migration.db_version() + try: + # before icehouse + sql.migration.CONF(project='keystone', default_config_files=[conf]) + current_version = sql.migration.db_version() + except AttributeError: + # starting with icehouse + sql.core.CONF(project='keystone', default_config_files=[conf]) + current_version = migration.get_db_version() # in havana the method _find_migrate_repo has been renamed to find_migrate_repo try: |