summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2013-02-22 16:37:28 +0000
committerChris Behrens <cbehrens@codestud.com>2013-02-25 21:32:59 +0000
commit625ecb610cd491933dec311ba07ce50aa04bd8e2 (patch)
treeb1f951bb00395153d0c659131a2e9b3da70f74af /bin
parent42d058b2a1364266560dcd0aa205e743741d0a41 (diff)
downloadnova-625ecb610cd491933dec311ba07ce50aa04bd8e2.tar.gz
nova-625ecb610cd491933dec311ba07ce50aa04bd8e2.tar.xz
nova-625ecb610cd491933dec311ba07ce50aa04bd8e2.zip
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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage10
1 files changed, 5 insertions, 5 deletions
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='<name>',
@@ -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)