From 625ecb610cd491933dec311ba07ce50aa04bd8e2 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Fri, 22 Feb 2013 16:37:28 +0000 Subject: Sync nova with oslo DB exception cleanup. DB exceptions have moved to openstack/common/db/exception module so that they can be shared with multiple DB implementations. Deadlock checking was also added to oslo to consolidate with DuplicateKey checking. This allows us to clean up our _retry_on_deadlock decorator in sqlalchemy/api.py Fixes unrelated pep8 issue with duplicate test in test_compute also. Change-Id: I7e985b384d1ef345e0d67c919b84b4faff869699 --- bin/nova-manage | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/nova-manage b/bin/nova-manage index c4e9841ce..0fde8ba0a 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -80,7 +80,7 @@ from nova import db from nova.db import migration from nova import exception from nova.openstack.common import cliutils -from nova.openstack.common.db.sqlalchemy import session as db_session +from nova.openstack.common.db import exception as db_exc from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import rpc @@ -861,7 +861,7 @@ class InstanceTypeCommands(object): except exception.InstanceTypeNotFound: print _("Valid instance type name is required") sys.exit(1) - except db_session.DBError, e: + except db_exc.DBError, e: print _("DB Error: %s") % e sys.exit(2) except Exception: @@ -878,7 +878,7 @@ class InstanceTypeCommands(object): inst_types = instance_types.get_all_types() else: inst_types = instance_types.get_instance_type_by_name(name) - except db_session.DBError, e: + except db_exc.DBError, e: _db_error(e) if isinstance(inst_types.values()[0], dict): for k, v in inst_types.iteritems(): @@ -909,7 +909,7 @@ class InstanceTypeCommands(object): ext_spec) print _("Key %(key)s set to %(value)s on instance" " type %(name)s") % locals() - except db_session.DBError, e: + except db_exc.DBError, e: _db_error(e) @args('--name', dest='name', metavar='', @@ -932,7 +932,7 @@ class InstanceTypeCommands(object): key) print _("Key %(key)s on instance type %(name)s unset") % locals() - except db_session.DBError, e: + except db_exc.DBError, e: _db_error(e) -- cgit