)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dc1499f63ca10ea9662a9a43615263cb2e4e209f","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This makes target_cell() do the thing it was originally intended to do,"},{"line_number":10,"context_line":"which is yield a new context that is targeted at the proper cell. With this,"},{"line_number":11,"context_line":"any objects you create inside the target context manager (assuming you use"},{"line_number":12,"context_line":"the yielded context) will remain targeted after the thing returns."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Related to blueprint cells-aware-api"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"ff0f0b1f_b5fc5eb5","line":12,"range":{"start_line":12,"start_character":22,"end_line":12,"end_character":66},"updated":"2017-05-23 09:30:19.000000000","message":"thanks for explaining why we need that.","commit_id":"9d2153261e51d85ed6dd58bd24a5a9ef0ef2c854"}],"nova/context.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"13ce400e312ead73b4d39ba00d62154461898c9c","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"@contextmanager"},{"line_number":388,"context_line":"def target_cell(context, cell_mapping):"},{"line_number":389,"context_line":"    \"\"\"Temporarily adds database connection information to the context"},{"line_number":390,"context_line":"    for communicating with the given target cell."},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    This context manager makes a temporary change to the context"},{"line_number":393,"context_line":"    and restores it when complete."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    Passing None for cell_mapping will untarget the context temporarily."},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":398,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_c66d4a99","line":395,"range":{"start_line":389,"start_character":4,"end_line":395,"end_character":72},"updated":"2017-04-25 17:55:31.000000000","message":"I think this part of the docstring needs to be updated to match the change.","commit_id":"eed58cf28e48cad4aac1c02f0f457c912512dc1f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b957af151dddae7f84bfb35c911fd2cc6c545c9e","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"@contextmanager"},{"line_number":388,"context_line":"def target_cell(context, cell_mapping):"},{"line_number":389,"context_line":"    \"\"\"Temporarily adds database connection information to the context"},{"line_number":390,"context_line":"    for communicating with the given target cell."},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    This context manager makes a temporary change to the context"},{"line_number":393,"context_line":"    and restores it when complete."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    Passing None for cell_mapping will untarget the context temporarily."},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":398,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_2b8bfcc2","line":395,"range":{"start_line":389,"start_character":4,"end_line":395,"end_character":72},"in_reply_to":"5ff73747_0ac2f5e9","updated":"2017-05-01 18:27:39.000000000","message":"Ack.","commit_id":"eed58cf28e48cad4aac1c02f0f457c912512dc1f"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"de537f8c3dc2cbc2989828533f963afc8d3c6b6a","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"@contextmanager"},{"line_number":388,"context_line":"def target_cell(context, cell_mapping):"},{"line_number":389,"context_line":"    \"\"\"Temporarily adds database connection information to the context"},{"line_number":390,"context_line":"    for communicating with the given target cell."},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    This context manager makes a temporary change to the context"},{"line_number":393,"context_line":"    and restores it when complete."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    Passing None for cell_mapping will untarget the context temporarily."},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":398,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_0ac2f5e9","line":395,"range":{"start_line":389,"start_character":4,"end_line":395,"end_character":72},"in_reply_to":"5ff73747_c66d4a99","updated":"2017-04-26 14:23:00.000000000","message":"+1","commit_id":"eed58cf28e48cad4aac1c02f0f457c912512dc1f"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"de537f8c3dc2cbc2989828533f963afc8d3c6b6a","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    \"\"\""},{"line_number":400,"context_line":"    cctxt \u003d copy.copy(context)"},{"line_number":401,"context_line":"    set_target_cell(cctxt, cell_mapping)"},{"line_number":402,"context_line":"    yield cctxt"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_8a2045b2","line":402,"updated":"2017-04-26 14:23:00.000000000","message":"Note that there\u0027s no longer any cleanup after the yield: it\u0027s not really a context manager any more. That\u0027s why when I wrote a version of this I just made it return a value instead:\n\nhttps://review.openstack.org/#/c/445140/4/nova/context.py\n\nEvery:\n\n  with target_cell(ctxt, cell_mapping) as cctxt:\n    ... use cctxt ...\n\ncould be written instead as:\n\n  cctxt \u003d target_cell(ctxt, cell_mapping)\n  ... use cctxt ...\n\nand it would be identical in function, but with less indentation.","commit_id":"eed58cf28e48cad4aac1c02f0f457c912512dc1f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b957af151dddae7f84bfb35c911fd2cc6c545c9e","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    \"\"\""},{"line_number":400,"context_line":"    cctxt \u003d copy.copy(context)"},{"line_number":401,"context_line":"    set_target_cell(cctxt, cell_mapping)"},{"line_number":402,"context_line":"    yield cctxt"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ff73747_6b9d8408","line":402,"in_reply_to":"5ff73747_8a2045b2","updated":"2017-05-01 18:27:39.000000000","message":"Unfortunately, because database state is global, for unit and functional tests we need to have a clear enter/exit point for switching that state. We have to lock anyone else from entering that region while we\u0027ve switched the global state, and the context manager makes that clean.\n\nOur contexts are also almost exclusively global at this point, and we will sometimes call through a couple of \"extensions\" in the API, getting the context from the original request in each extension, which is why we\u0027re force targeting those cases right now. Using the context manager syntax helps to define regions in the code where the new/targeted context is used which I think helps increase clarity.","commit_id":"eed58cf28e48cad4aac1c02f0f457c912512dc1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d9b1579ba2ccc3112f6601c52be590f0c2a78efb","unresolved":false,"context_lines":[{"line_number":411,"context_line":"    This function yields a copy of the provided context, which is targeted to"},{"line_number":412,"context_line":"    the referenced cell for MQ and DB connections."},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    Passing None for cell_mapping will yield an untargetd copy of the context."},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":417,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff0f0b1f_fe7beb77","line":414,"range":{"start_line":414,"start_character":48,"end_line":414,"end_character":57},"updated":"2017-05-22 19:32:58.000000000","message":"untargeted","commit_id":"861802202e44f6df9ca6131fa59a15e56057e93d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dc1499f63ca10ea9662a9a43615263cb2e4e209f","unresolved":false,"context_lines":[{"line_number":411,"context_line":"    This function yields a copy of the provided context, which is targeted to"},{"line_number":412,"context_line":"    the referenced cell for MQ and DB connections."},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    Passing None for cell_mapping will yield an untargetd copy of the context."},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":417,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff0f0b1f_f571b677","line":414,"range":{"start_line":414,"start_character":48,"end_line":414,"end_character":57},"updated":"2017-05-23 09:30:19.000000000","message":"untargeted","commit_id":"9d2153261e51d85ed6dd58bd24a5a9ef0ef2c854"}],"nova/tests/unit/test_context.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2bce396880bc1bfba83c481c8f142449333bb406","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                                      transport_url\u003d\u0027fake://\u0027)"},{"line_number":306,"context_line":"        with context.target_cell(ctxt, mapping) as cctxt:"},{"line_number":307,"context_line":"            self.assertEqual(cctxt.db_connection, mock.sentinel.cdb)"},{"line_number":308,"context_line":"            self.assertEqual(cctxt.mq_connection, mock.sentinel.cmq)"},{"line_number":309,"context_line":"        self.assertEqual(mock.sentinel.db_conn, ctxt.db_connection)"},{"line_number":310,"context_line":"        self.assertEqual(mock.sentinel.mq_conn, ctxt.mq_connection)"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_1dbcc803","line":308,"updated":"2017-05-04 20:35:46.000000000","message":"Might be nice to add assertions that the supplied ctxt param is no longer modified by target_cell()","commit_id":"7b83843e00b440f5276986f3619bc086e67bde25"}]}
