summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAndy Smith <code@term.ie>2011-01-12 16:57:04 -0800
committerAndy Smith <code@term.ie>2011-01-12 16:57:04 -0800
commit4f5c0c64ec9d397048dfd7b8d5c007ec0fa39ec5 (patch)
treedbf153da4079934dec8105a0dec88041eff39d3a /bin
parent27369c18bde257c068ffc51e5ef51b479ad351d0 (diff)
add support for database migration
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage20
1 files changed, 19 insertions, 1 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 3e290567c..c441fa7f2 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()
@@ -515,6 +516,22 @@ 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):
+ """adds role to user
+ if project is specified, adds project specific role
+ arguments: user, role [project]"""
+ return migration.db_sync(version)
+
+ def version(self):
+ print migration.db_version()
+
+
CATEGORIES = [
('user', UserCommands),
('project', ProjectCommands),
@@ -524,7 +541,8 @@ CATEGORIES = [
('floating', FloatingIpCommands),
('network', NetworkCommands),
('service', ServiceCommands),
- ('log', LogCommands)]
+ ('log', LogCommands),
+ ('db', DbCommands)]
def lazy_match(name, key_value_tuples):