diff options
author | Brian Waldon <bcwaldon@gmail.com> | 2013-05-28 15:28:28 -0700 |
---|---|---|
committer | Brian Waldon <bcwaldon@gmail.com> | 2013-06-02 17:17:50 +0000 |
commit | 780037502c2adb3eb780056008a03c9320b1b49b (patch) | |
tree | bbc009fac16042840c81b7e29c0769900509b6fc /keystone | |
parent | cd349711bc6210bf35952c5f71bb92ab7676bd2d (diff) | |
download | keystone-780037502c2adb3eb780056008a03c9320b1b49b.tar.gz keystone-780037502c2adb3eb780056008a03c9320b1b49b.tar.xz keystone-780037502c2adb3eb780056008a03c9320b1b49b.zip |
Add db_version command to keystone-manage
The db_version command simply looks at the database and prints the
version to which the database has been migrated.
Change-Id: I50098bf1aa6d57883cc9acc0c4d09d9c8448db7f
Diffstat (limited to 'keystone')
-rw-r--r-- | keystone/cli.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/keystone/cli.py b/keystone/cli.py index 82ecc18a..ee304210 100644 --- a/keystone/cli.py +++ b/keystone/cli.py @@ -23,6 +23,7 @@ from oslo.config import cfg import pbr.version from keystone.common import openssl +from keystone.common.sql import migration from keystone import config from keystone.openstack.common import importutils from keystone.openstack.common import jsonutils @@ -65,6 +66,16 @@ class DbSync(BaseApp): driver.db_sync(CONF.command.version) +class DbVersion(BaseApp): + """Print the current migration version of the database.""" + + name = 'db_version' + + @staticmethod + def main(): + print migration.db_version() + + class BaseCertificateSetup(BaseApp): """Common user/group setup for PKI and SSL generation.""" @@ -190,6 +201,7 @@ class ImportNovaAuth(BaseApp): CMDS = [ DbSync, + DbVersion, ExportLegacyCatalog, ImportLegacy, ImportNovaAuth, |