diff options
author | Chris Behrens <cbehrens@codestud.com> | 2013-03-13 21:41:43 +0000 |
---|---|---|
committer | Chris Behrens <cbehrens@codestud.com> | 2013-03-13 21:41:43 +0000 |
commit | cef34cd69156036c855ec217225edfce65b63d3c (patch) | |
tree | 3b596e1d6330e58c4631ae89b8b41344e2119d1a | |
parent | dd6e5368f1a9512f807f5140f687804d6a96adf5 (diff) | |
download | nova-cef34cd69156036c855ec217225edfce65b63d3c.tar.gz nova-cef34cd69156036c855ec217225edfce65b63d3c.tar.xz nova-cef34cd69156036c855ec217225edfce65b63d3c.zip |
Remove sqlalchemy calling back to DB API
sqlalchemy unnecessarily calls back to DB API in a few spots. It's
more efficient to not do so.
Also, when dbapi_use_tpool is enabled, this causes a lock up due to an
eventlet bug.
Fixes bug 1154811
Change-Id: I5937a2dce85a09502f40ebcd99afb441938c1289
-rw-r--r-- | nova/db/sqlalchemy/api.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 81a975983..459b024b4 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -121,7 +121,7 @@ def require_instance_exists_using_uuid(f): """ @functools.wraps(f) def wrapper(context, instance_uuid, *args, **kwargs): - db.instance_get_by_uuid(context, instance_uuid) + instance_get_by_uuid(context, instance_uuid) return f(context, instance_uuid, *args, **kwargs) return wrapper @@ -136,7 +136,7 @@ def require_aggregate_exists(f): @functools.wraps(f) def wrapper(context, aggregate_id, *args, **kwargs): - db.aggregate_get(context, aggregate_id) + aggregate_get(context, aggregate_id) return f(context, aggregate_id, *args, **kwargs) return wrapper @@ -1437,7 +1437,7 @@ def instance_create(context, values): instance_ref.save(session=session) # create the instance uuid to ec2_id mapping entry for instance - db.ec2_instance_create(context, instance_ref['uuid']) + ec2_instance_create(context, instance_ref['uuid']) return instance_ref |