diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2013-02-22 16:37:28 +0000 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2013-02-25 21:32:59 +0000 |
| commit | 625ecb610cd491933dec311ba07ce50aa04bd8e2 (patch) | |
| tree | b1f951bb00395153d0c659131a2e9b3da70f74af /nova/compute | |
| parent | 42d058b2a1364266560dcd0aa205e743741d0a41 (diff) | |
| download | nova-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 'nova/compute')
| -rw-r--r-- | nova/compute/instance_types.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index 73105b33f..3060e0bc2 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -28,7 +28,7 @@ from oslo.config import cfg from nova import context from nova import db from nova import exception -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 log as logging from nova import utils @@ -134,7 +134,7 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb=None, flavorid=None, try: return db.instance_type_create(context.get_admin_context(), kwargs) - except db_session.DBError, e: + except db_exc.DBError, e: LOG.exception(_('DB error: %s') % e) raise exception.InstanceTypeCreateFailed() |
