)]}'
{"placement/db_api.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a70555ee58aa1d10cdb87d2433fb638a5a90f4e3","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        # NOTE(sean-k-mooney): We only catch TypeError as this is the"},{"line_number":34,"context_line":"        # exception raised if a transation_context is started"},{"line_number":35,"context_line":"        # when configure is called. If the placement api is run via a"},{"line_number":36,"context_line":"        # mod_wsgi and the wsgi application is relaoded, it will be executed"},{"line_number":37,"context_line":"        # in the same process space. As such after any trasaction has"},{"line_number":38,"context_line":"        # previously been started we cannot reconfigure the transaction"},{"line_number":39,"context_line":"        # context manager without raising a TypeError."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d9387eee","line":36,"range":{"start_line":36,"start_character":47,"end_line":36,"end_character":55},"updated":"2018-10-23 10:51:30.000000000","message":"nit: reloaded","commit_id":"ec83da3a123c4746743428af774e48d521f3ae42"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"096733edaf489accea9f0ebbba60699e769b03b8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        # NOTE(sean-k-mooney): We only catch TypeError as this is the"},{"line_number":34,"context_line":"        # exception raised if a transation_context is started"},{"line_number":35,"context_line":"        # when configure is called. If the placement api is run via a"},{"line_number":36,"context_line":"        # mod_wsgi and the wsgi application is relaoded, it will be executed"},{"line_number":37,"context_line":"        # in the same process space. As such after any trasaction has"},{"line_number":38,"context_line":"        # previously been started we cannot reconfigure the transaction"},{"line_number":39,"context_line":"        # context manager without raising a TypeError."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_72d7ff51","line":36,"range":{"start_line":36,"start_character":47,"end_line":36,"end_character":55},"in_reply_to":"3f79a3b5_d9387eee","updated":"2018-10-23 12:29:05.000000000","message":"melanie left a comment on this on the nova review.\ni think her rephrasing makes more sense so ill copy that here also.","commit_id":"ec83da3a123c4746743428af774e48d521f3ae42"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a70555ee58aa1d10cdb87d2433fb638a5a90f4e3","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        # exception raised if a transation_context is started"},{"line_number":35,"context_line":"        # when configure is called. If the placement api is run via a"},{"line_number":36,"context_line":"        # mod_wsgi and the wsgi application is relaoded, it will be executed"},{"line_number":37,"context_line":"        # in the same process space. As such after any trasaction has"},{"line_number":38,"context_line":"        # previously been started we cannot reconfigure the transaction"},{"line_number":39,"context_line":"        # context manager without raising a TypeError."},{"line_number":40,"context_line":"        LOG.debug(\"Transaction context already started, not reconfiguring.\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_991a067e","line":37,"range":{"start_line":37,"start_character":55,"end_line":37,"end_character":65},"updated":"2018-10-23 10:51:30.000000000","message":"transaction","commit_id":"ec83da3a123c4746743428af774e48d521f3ae42"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a70555ee58aa1d10cdb87d2433fb638a5a90f4e3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        # in the same process space. As such after any trasaction has"},{"line_number":38,"context_line":"        # previously been started we cannot reconfigure the transaction"},{"line_number":39,"context_line":"        # context manager without raising a TypeError."},{"line_number":40,"context_line":"        LOG.debug(\"Transaction context already started, not reconfiguring.\")"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_1cfd8406","line":40,"updated":"2018-10-23 10:51:30.000000000","message":"you might consider doing an \u0027as exc\u0027 above, and including the stringified transaction in here, in case the information by the except ever becomes more interesting.","commit_id":"ec83da3a123c4746743428af774e48d521f3ae42"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"096733edaf489accea9f0ebbba60699e769b03b8","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        # in the same process space. As such after any trasaction has"},{"line_number":38,"context_line":"        # previously been started we cannot reconfigure the transaction"},{"line_number":39,"context_line":"        # context manager without raising a TypeError."},{"line_number":40,"context_line":"        LOG.debug(\"Transaction context already started, not reconfiguring.\")"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_92d2db5e","line":40,"in_reply_to":"3f79a3b5_1cfd8406","updated":"2018-10-23 12:29:05.000000000","message":"sure i can do that.","commit_id":"ec83da3a123c4746743428af774e48d521f3ae42"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"14fcd31d32df23761b9c4074b69608f98536db25","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    return dict(conf_group.items())"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"@run_once(\"TransactionFactory already started, not reconfiguring.\","},{"line_number":30,"context_line":"          LOG.warning)"},{"line_number":31,"context_line":"def configure(conf):"},{"line_number":32,"context_line":"    placement_context_manager.configure("},{"line_number":33,"context_line":"        **_get_db_conf(conf.placement_database))"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9575d335","line":33,"range":{"start_line":29,"start_character":0,"end_line":33,"end_character":48},"updated":"2018-11-06 13:14:57.000000000","message":"I feel that we over engineered this a bit. This decorator now used in a single place and  half of its logic (e.g. reset and cleanup) are unused.\n\nI might inline the necessary logic from the decorator into the configure function itself and delete the unused part of the decorator logic.\n\ndef configure(conf):\n    if not getattr(configure, \u0027called\u0027, False):\n        configure.called \u003d True\n        placement_context_manager.configure(\n            **_get_db_conf(conf.placement_database))","commit_id":"ba700c502848bfa21ef9b11ccd3beda2ecc23abd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bcd2d3cdc4946bd1da7edb3ee971373aa1237aee","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    return dict(conf_group.items())"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"@run_once(\"TransactionFactory already started, not reconfiguring.\","},{"line_number":30,"context_line":"          LOG.warning)"},{"line_number":31,"context_line":"def configure(conf):"},{"line_number":32,"context_line":"    placement_context_manager.configure("},{"line_number":33,"context_line":"        **_get_db_conf(conf.placement_database))"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_f070d5a9","line":33,"range":{"start_line":29,"start_character":0,"end_line":33,"end_character":48},"in_reply_to":"3f79a3b5_9575d335","updated":"2018-11-06 13:36:36.000000000","message":"OK, Chris pointed me to the later usage of reset() as well as another usage of the @run_once. So having the decorator feels less over engineering now.","commit_id":"ba700c502848bfa21ef9b11ccd3beda2ecc23abd"}],"placement/tests/unit/test_db_api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"14fcd31d32df23761b9c4074b69608f98536db25","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        db_api.configure(self.conf_fixture.conf)"},{"line_number":48,"context_line":"        # Note we have not reset the mock so it should"},{"line_number":49,"context_line":"        # have been called once from the first invoation of"},{"line_number":50,"context_line":"        # db_api.configure and the second invocation should not"},{"line_number":51,"context_line":"        # have called it again"},{"line_number":52,"context_line":"        configure_mock.assert_called_once()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_d5558bc2","line":49,"range":{"start_line":49,"start_character":47,"end_line":49,"end_character":56},"updated":"2018-11-06 13:14:57.000000000","message":"nit: invocation","commit_id":"ba700c502848bfa21ef9b11ccd3beda2ecc23abd"}]}
