summaryrefslogtreecommitdiffstats
path: root/keystone/cli.py
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2013-05-28 15:28:28 -0700
committerBrian Waldon <bcwaldon@gmail.com>2013-06-02 17:17:50 +0000
commit780037502c2adb3eb780056008a03c9320b1b49b (patch)
treebbc009fac16042840c81b7e29c0769900509b6fc /keystone/cli.py
parentcd349711bc6210bf35952c5f71bb92ab7676bd2d (diff)
downloadkeystone-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/cli.py')
-rw-r--r--keystone/cli.py12
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,