diff options
| author | Andy Smith <code@term.ie> | 2011-01-19 01:39:41 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-01-19 01:39:41 +0000 |
| commit | 4eed55b46cfaba58b5d344f0ca96eba090d8bd34 (patch) | |
| tree | be28644743097fd8228134f31be9f3dc683db7c8 /bin | |
| parent | 3b874805e2f7de43fd143f2b414e40ceef70e0c4 (diff) | |
| parent | 7f352a72333e94c642d8288638c73a166cfb2943 (diff) | |
Allows moving from the Austin-style db to the Bexar-style.
Prevents the db from being created automatically when services run.
Adds nova-manage db sync and nova manage db version to bring the db up-to-date and to check the current version. Must be run with the same privileges as the services who will access the database (or you need to chmod the db afterwards if sqlite)
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-manage | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index b5842b595..d0901ddfc 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -82,6 +82,7 @@ from nova import quota from nova import utils from nova.auth import manager from nova.cloudpipe import pipelib +from nova.db import migration logging.basicConfig() @@ -519,6 +520,21 @@ class LogCommands(object): print re.sub('#012', "\n", "\n".join(lines)) +class DbCommands(object): + """Class for managing the database.""" + + def __init__(self): + pass + + def sync(self, version=None): + """Sync the database up to the most recent version.""" + return migration.db_sync(version) + + def version(self): + """Print the current database version.""" + print migration.db_version() + + CATEGORIES = [ ('user', UserCommands), ('project', ProjectCommands), @@ -528,7 +544,8 @@ CATEGORIES = [ ('floating', FloatingIpCommands), ('network', NetworkCommands), ('service', ServiceCommands), - ('log', LogCommands)] + ('log', LogCommands), + ('db', DbCommands)] def lazy_match(name, key_value_tuples): |
