diff options
author | Eric Windisch <eric@cloudscaling.com> | 2013-01-17 15:38:02 -0500 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2013-02-05 10:13:04 +0000 |
commit | cd0c765ced2823c05b16126d6ba6a823bb66fe7d (patch) | |
tree | 31b3e5535d39db7afaefa12a89d74b68b7885ced /bin | |
parent | 47bbf12a6c9705e5abca29a1d44b753c8506505d (diff) | |
download | nova-cd0c765ced2823c05b16126d6ba6a823bb66fe7d.tar.gz nova-cd0c765ced2823c05b16126d6ba6a823bb66fe7d.tar.xz nova-cd0c765ced2823c05b16126d6ba6a823bb66fe7d.zip |
Use oslo database code
Bring in the new database code from oslo.
Uses get_session() from oslo as well as changing NovaBase to derive from
a common class.
Remove test_sqlalchemy.py now that this code is test in oslo.
Implements blueprint db-common.
Change-Id: I090754981c871250dd981cbbe1a08e7181440120
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/nova-manage | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 82edf7389..c793fed16 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -80,6 +80,7 @@ from nova.db import migration from nova import exception from nova.openstack.common import cfg from nova.openstack.common import cliutils +from nova.openstack.common.db.sqlalchemy import session as db_session from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import rpc @@ -831,7 +832,7 @@ class InstanceTypeCommands(object): except exception.InstanceTypeNotFound: print _("Valid instance type name is required") sys.exit(1) - except exception.DBError, e: + except db_session.DBError, e: print _("DB Error: %s") % e sys.exit(2) except Exception: @@ -848,7 +849,7 @@ class InstanceTypeCommands(object): inst_types = instance_types.get_all_types() else: inst_types = instance_types.get_instance_type_by_name(name) - except exception.DBError, e: + except db_session.DBError, e: _db_error(e) if isinstance(inst_types.values()[0], dict): for k, v in inst_types.iteritems(): @@ -879,7 +880,7 @@ class InstanceTypeCommands(object): ext_spec) print _("Key %(key)s set to %(value)s on instance" " type %(name)s") % locals() - except exception.DBError, e: + except db_session.DBError, e: _db_error(e) @args('--name', dest='name', metavar='<name>', @@ -902,7 +903,7 @@ class InstanceTypeCommands(object): key) print _("Key %(key)s on instance type %(name)s unset") % locals() - except exception.DBError, e: + except db_session.DBError, e: _db_error(e) |