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 --- nova/compute/instance_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/compute') 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() -- cgit