)]}'
{"nova/tests/fixtures.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":251,"context_line":"class CellDatabases(fixtures.Fixture):"},{"line_number":252,"context_line":"    \"\"\"Create cell databases for testing."},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    How to use:"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"      fix \u003d CellDatabases()"},{"line_number":257,"context_line":"      fix.add_cell_database(\u0027connection1\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_0a0d413e","line":254,"range":{"start_line":254,"start_character":14,"end_line":254,"end_character":15},"updated":"2016-12-01 23:21:59.000000000","message":"nit: not that it really matters too much, but this would be :: for code blocks.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":251,"context_line":"class CellDatabases(fixtures.Fixture):"},{"line_number":252,"context_line":"    \"\"\"Create cell databases for testing."},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    How to use:"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"      fix \u003d CellDatabases()"},{"line_number":257,"context_line":"      fix.add_cell_database(\u0027connection1\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_2dd937f4","line":254,"range":{"start_line":254,"start_character":14,"end_line":254,"end_character":15},"in_reply_to":"3a71b18c_0a0d413e","updated":"2016-12-01 23:49:05.000000000","message":"Oh, cool. I didn\u0027t think about making it a code block, just kind of threw this in. I think it would make sense as a code block so I\u0027ll do that.\n\nI also need to add more words explaining that because of the hacky _last_ctxt_mgr thing, the last call to add_cell_database needs to be a compute cell database (can\u0027t be cell0) because service start will trigger a non-switching local cell database access.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    How to use:"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"      fix \u003d CellDatabases()"},{"line_number":257,"context_line":"      fix.add_cell_database(\u0027connection1\u0027)"},{"line_number":258,"context_line":"      fix.add_cell_database(\u0027connection2\u0027)"},{"line_number":259,"context_line":"      self.useFixture(fix)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_0d7d5b1c","line":256,"updated":"2016-12-01 23:21:59.000000000","message":"Until I looked at the test for this, I didn\u0027t make the connection that these are specifically non-api DB connections. I\u0027m not sure if that\u0027s worth being explicit about in the docstring or not, but I take it for granted that \u0027cell\u0027 database means non-api (child) cell.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    How to use:"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"      fix \u003d CellDatabases()"},{"line_number":257,"context_line":"      fix.add_cell_database(\u0027connection1\u0027)"},{"line_number":258,"context_line":"      fix.add_cell_database(\u0027connection2\u0027)"},{"line_number":259,"context_line":"      self.useFixture(fix)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_ed49ff8c","line":256,"in_reply_to":"3a71b18c_0d7d5b1c","updated":"2016-12-01 23:49:05.000000000","message":"Noted. I\u0027ll add that to this docstring too, can\u0027t hurt to be explicit.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"891db552feee8b48a389ec0058b9680d64034383","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    How to use:"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"      fix \u003d CellDatabases()"},{"line_number":257,"context_line":"      fix.add_cell_database(\u0027connection1\u0027)"},{"line_number":258,"context_line":"      fix.add_cell_database(\u0027connection2\u0027)"},{"line_number":259,"context_line":"      self.useFixture(fix)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_60b734f5","line":256,"in_reply_to":"3a71b18c_ed49ff8c","updated":"2016-12-05 23:42:05.000000000","message":"The first line is \"create cell databases\". Not sure what else to say. I\u0027ve changed \"cell\" to \"per-cell\" in the version I\u0027m about to push up, but please chime in with actual words you think would make it better.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _cache_schema(self, connection_str):"},{"line_number":266,"context_line":"        global DB_SCHEMA"},{"line_number":267,"context_line":"        if not DB_SCHEMA[\u0027main\u0027]:"},{"line_number":268,"context_line":"            ctxt_mgr \u003d self._ctxt_mgrs[connection_str]"},{"line_number":269,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"},{"line_number":270,"context_line":"            conn \u003d engine.connect()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_ed149ff6","line":267,"updated":"2016-12-01 23:21:59.000000000","message":"Why do we only do this if main isn\u0027t set? Might be good to have a comment here. And I guess this makes it a singleton...","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"30c4737f89a0c6f2fd2940963deda435e6d33f60","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _cache_schema(self, connection_str):"},{"line_number":266,"context_line":"        global DB_SCHEMA"},{"line_number":267,"context_line":"        if not DB_SCHEMA[\u0027main\u0027]:"},{"line_number":268,"context_line":"            ctxt_mgr \u003d self._ctxt_mgrs[connection_str]"},{"line_number":269,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"},{"line_number":270,"context_line":"            conn \u003d engine.connect()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_106e4e2f","line":267,"in_reply_to":"3a71b18c_0d0d5b3e","updated":"2016-12-02 00:08:25.000000000","message":"Still though, once this is set once, it\u0027s not going to be cached again, right? The other fixture probably only assumes a single cell database, but here we can have multiples, so wouldn\u0027t this need to be a list on line 272?","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"54bfeea1907739b17c539e540631894cf594c912","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _cache_schema(self, connection_str):"},{"line_number":266,"context_line":"        global DB_SCHEMA"},{"line_number":267,"context_line":"        if not DB_SCHEMA[\u0027main\u0027]:"},{"line_number":268,"context_line":"            ctxt_mgr \u003d self._ctxt_mgrs[connection_str]"},{"line_number":269,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"},{"line_number":270,"context_line":"            conn \u003d engine.connect()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_f072b2e4","line":267,"in_reply_to":"3a71b18c_106e4e2f","updated":"2016-12-02 00:22:31.000000000","message":"Yeah, we only need one main database schema per test suite run. Every main database uses the same schema. So once we have one main database schema, we can use it to run migrations on any new main database we create.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _cache_schema(self, connection_str):"},{"line_number":266,"context_line":"        global DB_SCHEMA"},{"line_number":267,"context_line":"        if not DB_SCHEMA[\u0027main\u0027]:"},{"line_number":268,"context_line":"            ctxt_mgr \u003d self._ctxt_mgrs[connection_str]"},{"line_number":269,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"},{"line_number":270,"context_line":"            conn \u003d engine.connect()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_0d0d5b3e","line":267,"in_reply_to":"3a71b18c_ed149ff6","updated":"2016-12-01 23:49:05.000000000","message":"This is the schema caching thing, same as the normal Database fixture does. It generates schemas once per test suite run, I think, and caches them. Cell databases are only \u0027main\u0027 databases, so we only need to generate and cache the \u0027main\u0027 database schema if it hasn\u0027t already been generated and cached by some other test.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    @contextmanager"},{"line_number":277,"context_line":"    def _wrap_target_cell(self, context, cell_mapping):"},{"line_number":278,"context_line":"        ctxt_mgr \u003d self._ctxt_mgrs[cell_mapping.database_connection]"},{"line_number":279,"context_line":"        # This assumes the next local DB access is the same cell that"},{"line_number":280,"context_line":"        # was targeted last time."},{"line_number":281,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":282,"context_line":"        with self._real_target_cell(context, cell_mapping) as ccontext:"},{"line_number":283,"context_line":"            yield ccontext"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_ada627bf","line":280,"range":{"start_line":279,"start_character":8,"end_line":280,"end_character":33},"updated":"2016-12-01 23:21:59.000000000","message":"Can we assert this somehow? Like storing _last_connection or something? Then if cell_mapping.database_connection !\u003d self._last_connection we blow up.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    @contextmanager"},{"line_number":277,"context_line":"    def _wrap_target_cell(self, context, cell_mapping):"},{"line_number":278,"context_line":"        ctxt_mgr \u003d self._ctxt_mgrs[cell_mapping.database_connection]"},{"line_number":279,"context_line":"        # This assumes the next local DB access is the same cell that"},{"line_number":280,"context_line":"        # was targeted last time."},{"line_number":281,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":282,"context_line":"        with self._real_target_cell(context, cell_mapping) as ccontext:"},{"line_number":283,"context_line":"            yield ccontext"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_b004ba15","line":280,"range":{"start_line":279,"start_character":8,"end_line":280,"end_character":33},"in_reply_to":"3a71b18c_ada627bf","updated":"2016-12-01 23:49:05.000000000","message":"That\u0027s a good idea, that way we know if the assumption gets violated.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"891db552feee8b48a389ec0058b9680d64034383","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    @contextmanager"},{"line_number":277,"context_line":"    def _wrap_target_cell(self, context, cell_mapping):"},{"line_number":278,"context_line":"        ctxt_mgr \u003d self._ctxt_mgrs[cell_mapping.database_connection]"},{"line_number":279,"context_line":"        # This assumes the next local DB access is the same cell that"},{"line_number":280,"context_line":"        # was targeted last time."},{"line_number":281,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":282,"context_line":"        with self._real_target_cell(context, cell_mapping) as ccontext:"},{"line_number":283,"context_line":"            yield ccontext"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_208ffc2a","line":280,"range":{"start_line":279,"start_character":8,"end_line":280,"end_character":33},"in_reply_to":"3a71b18c_b004ba15","updated":"2016-12-05 23:42:05.000000000","message":"How would we do that? We\u0027re making the assumption because we don\u0027t really know, right?\n\nIn the version I\u0027m about to push up, I always reset the last context manager to the default one whenever we leave target-cell context. That means we always know that last_ctx_mgr is the cell one if we\u0027re in that context, and if not, it\u0027s whatever you asked for to be default.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        string for this database. It should match the database_connection field"},{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_cd7c4375","line":301,"range":{"start_line":301,"start_character":27,"end_line":301,"end_character":49},"updated":"2016-12-01 23:21:59.000000000","message":"Isn\u0027t this _wrap_create_context_manager now? Which calls self._ctxt_mgrs[connection], but nothing is in self._ctxt_mgrs yet, so how are we not getting a KeyError here? Or is session.create_context_manager() here the real thing that creates the backing sqlite db?","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"54bfeea1907739b17c539e540631894cf594c912","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        string for this database. It should match the database_connection field"},{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_d3a5c004","line":301,"range":{"start_line":301,"start_character":27,"end_line":301,"end_character":49},"in_reply_to":"3a71b18c_90c7be11","updated":"2016-12-02 00:22:31.000000000","message":"Yeah ... An alternate way might be to do the patching in a start() method or something that has to be called before use instead. And make it blow up with a helpful error if start() hasn\u0027t been called.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        string for this database. It should match the database_connection field"},{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_d020569e","line":301,"range":{"start_line":301,"start_character":27,"end_line":301,"end_character":49},"in_reply_to":"3a71b18c_cd7c4375","updated":"2016-12-01 23:49:05.000000000","message":"No, because of the usage instructions. I patch create_context_manager in setUp, and setUp doesn\u0027t run until useFixture is called. The add_cell_database calls need to happen before most things are patched.\n\nThe way the sqlite in-memory databases work is, each new connection creates a new, blank database. What we want to do is create each cell database for real, once, and cache references to them.\n\nThen in setUp, patch such that new connections that the code would otherwise create will return a cached reference. That way we don\u0027t ever create new blank databases in the middle of a test run (which results in NonExistentTable exceptions). I should probably explain that in the docstring as well.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"30c4737f89a0c6f2fd2940963deda435e6d33f60","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        string for this database. It should match the database_connection field"},{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_90c7be11","line":301,"range":{"start_line":301,"start_character":27,"end_line":301,"end_character":49},"in_reply_to":"3a71b18c_d020569e","updated":"2016-12-02 00:08:25.000000000","message":"Ah yes, I forgot that all of the \u0027setup\u0027 is done before the actual fixture is \u0027setup\u0027 for use. That\u0027s tricky.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"},{"line_number":305,"context_line":"        # to be a compute cell."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_cdca83a1","line":302,"updated":"2016-12-01 23:21:59.000000000","message":"What if connection_str is already in self._ctxt_mgrs? Should we just overwrite? Or error out? Seems you\u0027d be leaking connections if you just overwrite.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":299,"context_line":"        in the corresponding CellMapping."},{"line_number":300,"context_line":"        \"\"\""},{"line_number":301,"context_line":"        ctxt_mgr \u003d session.create_context_manager()"},{"line_number":302,"context_line":"        self._ctxt_mgrs[connection_str] \u003d ctxt_mgr"},{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"},{"line_number":305,"context_line":"        # to be a compute cell."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_30db4a7e","line":302,"in_reply_to":"3a71b18c_cdca83a1","updated":"2016-12-01 23:49:05.000000000","message":"Yeah, this is assuming a perfect world where no one does that. It should raise an error.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"},{"line_number":305,"context_line":"        # to be a compute cell."},{"line_number":306,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        def get_context_manager(context):"},{"line_number":309,"context_line":"            return ctxt_mgr"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_8d37abaf","line":306,"range":{"start_line":306,"start_character":13,"end_line":306,"end_character":27},"updated":"2016-12-01 23:21:59.000000000","message":"So this is really, _last_added_ctxt_mgr...right? I got confused with the comment above about \u0027first db access\u0027.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"},{"line_number":305,"context_line":"        # to be a compute cell."},{"line_number":306,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        def get_context_manager(context):"},{"line_number":309,"context_line":"            return ctxt_mgr"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_9037beaf","line":306,"range":{"start_line":306,"start_character":13,"end_line":306,"end_character":27},"in_reply_to":"3a71b18c_8d37abaf","updated":"2016-12-01 23:49:05.000000000","message":"Well, at first yes. It will change potentially each time get_context_manager is called. It\u0027s \"last context manager gotten by get_context_manager.\"","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"30c4737f89a0c6f2fd2940963deda435e6d33f60","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        # NOTE(melwitt): The first DB access through service start is"},{"line_number":304,"context_line":"        # local so this initializes _last_ctxt_mgr for that and needs"},{"line_number":305,"context_line":"        # to be a compute cell."},{"line_number":306,"context_line":"        self._last_ctxt_mgr \u003d ctxt_mgr"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        def get_context_manager(context):"},{"line_number":309,"context_line":"            return ctxt_mgr"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_f0d632c4","line":306,"range":{"start_line":306,"start_character":13,"end_line":306,"end_character":27},"in_reply_to":"3a71b18c_9037beaf","updated":"2016-12-02 00:08:25.000000000","message":"OK, last touched or something.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            return ctxt_mgr"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        with fixtures.MonkeyPatch("},{"line_number":312,"context_line":"                \u0027nova.db.sqlalchemy.api.get_context_manager\u0027,"},{"line_number":313,"context_line":"                get_context_manager):"},{"line_number":314,"context_line":"            self._cache_schema(connection_str)"},{"line_number":315,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_ed465f22","line":312,"updated":"2016-12-01 23:21:59.000000000","message":"Doesn\u0027t this overwrite the monkeypatch on L327?","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"21d963e06cb237a709f552c3f0a5ae97dd1d822e","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            return ctxt_mgr"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        with fixtures.MonkeyPatch("},{"line_number":312,"context_line":"                \u0027nova.db.sqlalchemy.api.get_context_manager\u0027,"},{"line_number":313,"context_line":"                get_context_manager):"},{"line_number":314,"context_line":"            self._cache_schema(connection_str)"},{"line_number":315,"context_line":"            engine \u003d ctxt_mgr.get_legacy_facade().get_engine()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_f05c7227","line":312,"in_reply_to":"3a71b18c_ed465f22","updated":"2016-12-01 23:49:05.000000000","message":"No because this runs before setUp. I have to do this because I need this to return me the same connection created on L301, else I would get a new blank database here. I want to run migrations on the database I created on L301 to be handed out later.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2018ef8d152f6173b7a1f293bf8e8b12e47d4975","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":351,"context_line":"        self._real_target_cell \u003d context.target_cell"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        # NOTE(danms): These context manageres are in place for the"},{"line_number":354,"context_line":"        # duration of the test (unlike the temporary ones above) and"},{"line_number":355,"context_line":"        # provide te actual \"runtime\" switching of connections for us."},{"line_number":356,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_44c06c50","line":353,"range":{"start_line":353,"start_character":37,"end_line":353,"end_character":46},"updated":"2016-12-06 14:45:43.000000000","message":"and managers. sheesh.","commit_id":"e49ce3d3af6b51061e5097cd2938845b5e0abd40"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7954920e5fb9e42966af485495a07b3622fbaa4e","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"        # NOTE(danms): These context manageres are in place for the"},{"line_number":354,"context_line":"        # duration of the test (unlike the temporary ones above) and"},{"line_number":355,"context_line":"        # provide te actual \"runtime\" switching of connections for us."},{"line_number":356,"context_line":"        self.useFixture(fixtures.MonkeyPatch("},{"line_number":357,"context_line":"            \u0027nova.db.sqlalchemy.api.create_context_manager\u0027,"},{"line_number":358,"context_line":"            self._wrap_create_context_manager))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_8398dac1","line":355,"range":{"start_line":355,"start_character":18,"end_line":355,"end_character":20},"updated":"2016-12-05 23:59:40.000000000","message":"the","commit_id":"e49ce3d3af6b51061e5097cd2938845b5e0abd40"}],"nova/tests/functional/db/test_connection_switch.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7319737cecc8a8231ee36438dfe3146a1743a315","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        with context.target_cell(ctxt, mapping1):"},{"line_number":96,"context_line":"            instance \u003d objects.Instance(context\u003dctxt, uuid\u003duuid,"},{"line_number":97,"context_line":"                                        project_id\u003d\u0027fake-project\u0027)"},{"line_number":98,"context_line":"            instance.create()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            inst \u003d objects.Instance.get_by_uuid(ctxt, uuid)"},{"line_number":101,"context_line":"            self.assertEqual(uuid, inst.uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_8db6cbda","line":98,"range":{"start_line":98,"start_character":12,"end_line":98,"end_character":29},"updated":"2016-12-01 23:21:59.000000000","message":"If this is a no-db test case, how does this not blow up? I guess because it actually creates the instance in the \u0027blah\u0027 cell1 database, which is just sqlite. Cool.","commit_id":"27aa41fdab06727ea17f02e5cee0698d9c8bcdb5"}]}
