)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"adfde0b0f6544a09949e9111f12fa3fac749edda","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                cells_api \u003d cells_rpcapi.CellsAPI()"},{"line_number":671,"context_line":"                cells_api.instance_update_at_top(context, stale_instance)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        if self._sync_cells:"},{"line_number":674,"context_line":"            # NOTE(danms): We have to be super careful here not to trigger"},{"line_number":675,"context_line":"            # any lazy-loads that will unmigrate or unbackport something. So,"},{"line_number":676,"context_line":"            # make a copy of the instance for notifications first."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_8a86a311","line":673,"updated":"2015-11-17 19:48:42.000000000","message":"From a cells pov this does what it should, and reduces redundancy in the notifications.  This change does now mean that cells concepts are guarding non cells specific operations, and before this only affected cells specific code.  That\u0027s fine, but I don\u0027t like that non cells users now need to understand self._sync_cells to determine the behavior here.\n\nIt would add some complexity but adding a new _notify(...) method that\u0027s called here which is overridden if not self._sync_cells to be \u0027lamdba ...: pass\u0027 would hide the cells code out of the way.\n\nBut if this isn\u0027t bothering others then it\u0027s fine with me.","commit_id":"d584546bec641a555021228d6e914ce07f9824f7"},{"author":{"_account_id":11069,"name":"Corey Wright","email":"undefined+launchpad@pobox.com","username":"coreywright"},"change_message_id":"0442b0b3879f9fff6133b01f0ab1d3de8e24d773","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                cells_api \u003d cells_rpcapi.CellsAPI()"},{"line_number":671,"context_line":"                cells_api.instance_update_at_top(context, stale_instance)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        if self._sync_cells:"},{"line_number":674,"context_line":"            # NOTE(danms): We have to be super careful here not to trigger"},{"line_number":675,"context_line":"            # any lazy-loads that will unmigrate or unbackport something. So,"},{"line_number":676,"context_line":"            # make a copy of the instance for notifications first."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_b95b8ef5","line":673,"in_reply_to":"ba8a016a_00b26b4c","updated":"2015-11-18 17:08:24.000000000","message":"Well, if we are going to defer to an inner function, then we can take a more traditional/conventional approach (which I believe Melanie was alluding to) and merely return/\"escape\" from the subroutine \"early\" and avoid the extra level of indirection in the function variable (and just stick to the singular indirection of an inner function).\n\nSee inner_function-early_escape.py on http://paste.openstack.org/show/479261/.\n\nAs I sense agreement from Andrew and Melanie that something more than what\u0027s in this current version is needed, I\u0027ll update this with something reflecting inner_function-early_escape.py.","commit_id":"d584546bec641a555021228d6e914ce07f9824f7"},{"author":{"_account_id":11069,"name":"Corey Wright","email":"undefined+launchpad@pobox.com","username":"coreywright"},"change_message_id":"7d94108b1a4d79039ee179decef281a2534f73a6","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                cells_api \u003d cells_rpcapi.CellsAPI()"},{"line_number":671,"context_line":"                cells_api.instance_update_at_top(context, stale_instance)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        if self._sync_cells:"},{"line_number":674,"context_line":"            # NOTE(danms): We have to be super careful here not to trigger"},{"line_number":675,"context_line":"            # any lazy-loads that will unmigrate or unbackport something. So,"},{"line_number":676,"context_line":"            # make a copy of the instance for notifications first."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_f06e2a2e","line":673,"in_reply_to":"ba8a016a_8a86a311","updated":"2015-11-18 05:32:06.000000000","message":"I can see the argument presented by Andrew and Melanie and I generally understand the approach presented by Andrew (\"All problems in computer science can be solved by another level of indirection.\" - David Wheeler), but like Melanie I need a little more clarification on the specific method Andrew envisions.\n\nMaybe using an inner function?\nMaybe using a local variable to reference a method?\nSee http://paste.openstack.org/show/479204/ for examples of the aforementioned.","commit_id":"d584546bec641a555021228d6e914ce07f9824f7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5d9ff6f183049f7559feeb953ab24070125528cb","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                cells_api \u003d cells_rpcapi.CellsAPI()"},{"line_number":671,"context_line":"                cells_api.instance_update_at_top(context, stale_instance)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        if self._sync_cells:"},{"line_number":674,"context_line":"            # NOTE(danms): We have to be super careful here not to trigger"},{"line_number":675,"context_line":"            # any lazy-loads that will unmigrate or unbackport something. So,"},{"line_number":676,"context_line":"            # make a copy of the instance for notifications first."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_0d1dedbc","line":673,"in_reply_to":"ba8a016a_8a86a311","updated":"2015-11-18 00:44:29.000000000","message":"I think this is a fair point. My initial thought on this was that it definitely solves the problem but there was something not great about guarding non-cells-specific behavior by a cells check. Also thinking ahead to when we\u0027ll be going through and removing all these when we have cells v2.\n\nI\u0027m not sure I understand the override part. Do you mean in _notify having \"if not self._sync_cells: pass\"?","commit_id":"d584546bec641a555021228d6e914ce07f9824f7"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e2d569471fc30e30f78be6504016e1c1dc334790","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                cells_api \u003d cells_rpcapi.CellsAPI()"},{"line_number":671,"context_line":"                cells_api.instance_update_at_top(context, stale_instance)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        if self._sync_cells:"},{"line_number":674,"context_line":"            # NOTE(danms): We have to be super careful here not to trigger"},{"line_number":675,"context_line":"            # any lazy-loads that will unmigrate or unbackport something. So,"},{"line_number":676,"context_line":"            # make a copy of the instance for notifications first."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba8a016a_00b26b4c","line":673,"in_reply_to":"ba8a016a_f06e2a2e","updated":"2015-11-18 13:28:42.000000000","message":"The inner function override in your paste is what I was thinking.  I\u0027m not overly concerned with the method though, I would just like cells code (mostly) hidden from non cells users.","commit_id":"d584546bec641a555021228d6e914ce07f9824f7"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"18938b93e32e643b1649013a58f3bc4eeebc1c97","unresolved":false,"context_lines":[{"line_number":684,"context_line":""},{"line_number":685,"context_line":"            notifications.send_update(context, old_ref, new_ref)"},{"line_number":686,"context_line":""},{"line_number":687,"context_line":"        _notify()"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"        self.obj_reset_changes()"},{"line_number":690,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_769a0470","line":687,"updated":"2015-11-18 21:43:49.000000000","message":"I think I would prefer it if this were:\n\n def _notify():\n     clone\n     send\n\n\n if not self.sync_cells:\n     _notify \u003d lambda: None\n\n\n _notify()","commit_id":"064dd6d061834aefa2fb7bfbf8a378580321c13c"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e93cdc1fc5edec7cc85113e4156a94a7398dcf4d","unresolved":false,"context_lines":[{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        # NOTE(coreywright): don\u0027t notify if cell synchronization is blocked"},{"line_number":682,"context_line":"        # because that means the notification will have already occurred"},{"line_number":683,"context_line":"        # during the pre-sync instance saving"},{"line_number":684,"context_line":"        if not self._sync_cells:"},{"line_number":685,"context_line":"            _notify \u003d lambda: None  # noqa: F811"},{"line_number":686,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_94b96fce","line":683,"updated":"2015-11-19 16:58:53.000000000","message":"\"pre-sync instance saving\" isn\u0027t quite right to describe when the notification will have occurred.  This is fine for now, or could be updated in a followup patch.  But perhaps something like \"If cell synchronization is blocked it means we have already run this block of code in either the parent or child of this cell.  Therefore this notification has already been sent.\"  But it\u0027s a bit nitpicky so I don\u0027t want to hold on that.","commit_id":"ca932cafde85fcfa12be50e92f0fc5f46226e3ef"},{"author":{"_account_id":11069,"name":"Corey Wright","email":"undefined+launchpad@pobox.com","username":"coreywright"},"change_message_id":"adcf43db447b6173950a1a88753d9f7a85ebc6a1","unresolved":false,"context_lines":[{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        # NOTE(coreywright): don\u0027t notify if cell synchronization is blocked"},{"line_number":682,"context_line":"        # because that means the notification will have already occurred"},{"line_number":683,"context_line":"        # during the pre-sync instance saving"},{"line_number":684,"context_line":"        if not self._sync_cells:"},{"line_number":685,"context_line":"            _notify \u003d lambda: None  # noqa: F811"},{"line_number":686,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_274ad726","line":683,"in_reply_to":"ba8a016a_94b96fce","updated":"2015-11-19 17:13:55.000000000","message":"Done!\n\nno time like the present.\n\nwhy put off to tomorrow what i can do quickly today (and will probably forget tomorrow ;)?","commit_id":"ca932cafde85fcfa12be50e92f0fc5f46226e3ef"}]}
