summaryrefslogtreecommitdiff
path: root/nova/context.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-01 21:49:23 +0000
committerGerrit Code Review <review@openstack.org>2016-09-01 21:49:23 +0000
commit8bd486594f5677e1e4a1f78495cfe5565022c274 (patch)
treea96ca92c4c565853f14e8c614c427f8d6a43ab78 /nova/context.py
parentf3a1f92a1fc809ad7e73ad36f2db12f474366377 (diff)
parent4df0869e00f4316ebb41ed9cdf4d6a433227f4d0 (diff)
downloadnova-8bd486594f5677e1e4a1f78495cfe5565022c274.tar.gz
Merge "Move cell message queue switching and add caching"
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/nova/context.py b/nova/context.py
index 313919f83d..5d464f034f 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -343,26 +343,18 @@ def authorize_quota_class_context(context, class_name):
@contextmanager
def target_cell(context, cell_mapping):
- """Adds database and message queue connection information to the context
+ """Adds database connection information to the context
for communicating with the given target cell.
:param context: The RequestContext to add connection information
:param cell_mapping: A objects.CellMapping object
"""
original_db_connection = context.db_connection
- original_mq_connection = context.mq_connection
- # avoid circular imports
+ # avoid circular import
from nova import db
- from nova import rpc
db_connection_string = cell_mapping.database_connection
context.db_connection = db.create_context_manager(db_connection_string)
- # NOTE(melwitt): none:// url is a special value meaning do not switch
- if not cell_mapping.transport_url.startswith('none'):
- transport_url = cell_mapping.transport_url
- context.mq_connection = rpc.create_transport(transport_url)
-
try:
yield context
finally:
context.db_connection = original_db_connection
- context.mq_connection = original_mq_connection