summaryrefslogtreecommitdiffstats
path: root/keystone/cli.py
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2012-02-13 22:07:10 -0800
committertermie <github@anarkystic.com>2012-02-14 12:54:56 -0800
commit27db5cbc05864b8c130eded9082ee82f7e722c34 (patch)
tree7e14843a1ad791cdbc6c603553431d854bf98b78 /keystone/cli.py
parent1ed067cb5791585bb02644a4a3827b6640324a95 (diff)
downloadkeystone-27db5cbc05864b8c130eded9082ee82f7e722c34.tar.gz
keystone-27db5cbc05864b8c130eded9082ee82f7e722c34.tar.xz
keystone-27db5cbc05864b8c130eded9082ee82f7e722c34.zip
add catalog export
Change-Id: I66a7b3e8136757979c96984242b2bbd5f390b9a0
Diffstat (limited to 'keystone/cli.py')
-rw-r--r--keystone/cli.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/keystone/cli.py b/keystone/cli.py
index b7e7dfbb..b6b5abb8 100644
--- a/keystone/cli.py
+++ b/keystone/cli.py
@@ -74,8 +74,25 @@ class ImportLegacy(BaseApp):
migration.migrate_all()
+class ExportLegacyCatalog(BaseApp):
+ """Export the service catalog from a legacy database."""
+
+ name = 'export_legacy_catalog'
+
+ def __init__(self, *args, **kw):
+ super(ExportLegacyCatalog, 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)
+ print '\n'.join(migration.dump_catalog())
+
+
CMDS = {'db_sync': DbSync,
'import_legacy': ImportLegacy,
+ 'export_legacy_catalog': ExportLegacyCatalog,
}