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 /nova/compute | |
| parent | 47bbf12a6c9705e5abca29a1d44b753c8506505d (diff) | |
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 'nova/compute')
| -rw-r--r-- | nova/compute/instance_types.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index 78129ee6b..30766fd9e 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -27,6 +27,7 @@ from nova import context from nova import db from nova import exception from nova.openstack.common import cfg +from nova.openstack.common.db.sqlalchemy import session as db_session from nova.openstack.common import log as logging from nova import utils @@ -110,7 +111,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 exception.DBError, e: + except db_session.DBError, e: LOG.exception(_('DB error: %s') % e) raise exception.InstanceTypeCreateFailed() |
