#NEWLINE# @ contextmanager #NEWLINE# def target_cell( context , cell_mapping ) : #NEWLINE# #INDENT# 'Adds database connection information to the context for communicating\n    with the given target cell.\n\n    :param context: The RequestContext to add database connection information\n    :param cell_mapping: A objects.CellMapping object\n    ' #NEWLINE# original_db_connection = context . db_connection #NEWLINE# from nova import db #NEWLINE# connection_string = connection_string . database_connection #NEWLINE# context . db_connection = db . create_context_manager ( connection_string ) #NEWLINE# try : #NEWLINE# #INDENT# ( yield context ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# context . db_connection = original_db_connection