@contextmanager
def target_cell(context, cell_mapping):
    original_db_connection = context.db_connection
    # avoid circular import
    from nova import db
    connection_string = cell_mapping.database_connection
    context.db_connection = db.create_context_manager(connection_string)

    try:
        yield context
    finally:
        context.db_connection = original_db_connection
Adds database connection information to the context for communicating
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/context.py/target_cell