summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2012-02-13 16:50:00 -0800
committertermie <github@anarkystic.com>2012-02-13 18:05:30 -0800
commit63adca31f772ab50a2da1c81bda9a66e0e009e02 (patch)
treed2b84470deb53fc29f36a5c98b91f6062a0ea919
parent48f2f650c8b622b55e67610081336055ec9a2c8e (diff)
add import legacy cli command
Change-Id: I41f0baaf3e7beb5c1ba44a7da420b411c1f60277
-rw-r--r--keystone/cli.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/keystone/cli.py b/keystone/cli.py
index 1e47b530..b7e7dfbb 100644
--- a/keystone/cli.py
+++ b/keystone/cli.py
@@ -1,3 +1,5 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
from __future__ import absolute_import
import json
@@ -56,7 +58,24 @@ class DbSync(BaseApp):
driver.db_sync()
+class ImportLegacy(BaseApp):
+ """Import a legacy database."""
+
+ name = 'import_legacy'
+
+ def __init__(self, *args, **kw):
+ super(ImportLegacy, self).__init__(*args, **kw)
+ self.add_param('old_db', nargs=1)
+
+ def main(self):
+ from keystone.common.sql import legacy
+ old_db = self.params.old_db[0]
+ migration = legacy.LegacyMigration(old_db)
+ migration.migrate_all()
+
+
CMDS = {'db_sync': DbSync,
+ 'import_legacy': ImportLegacy,
}