)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ea5741da3034f8d51f812514d416b27219daabdf","unresolved":false,"context_lines":[{"line_number":20,"context_line":"router. After that, it rollbacks this port to original state."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ib68aee164a3062648fc882012d57b5e381f52196"},{"line_number":23,"context_line":"Closes-Bug: #1535549"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_d32e02a4","line":23,"range":{"start_line":23,"start_character":13,"end_line":23,"end_character":20},"updated":"2016-09-08 08:57:59.000000000","message":"the bug says about the race with ports with duplicate CIDRs as router interfaces, the commit message is about clearing port\u0027s attributes in case of failure which is a bit different thing. Does the patch fixes the race?","commit_id":"4709d845cb5fe1ff19302eeb3b20097490496bb3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c725c05f6d87583f1c0db03ca5013ecdc341e7f9","unresolved":false,"context_lines":[{"line_number":20,"context_line":"router. After that, it rollbacks this port to original state."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ib68aee164a3062648fc882012d57b5e381f52196"},{"line_number":23,"context_line":"Closes-Bug: #1535549"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_980e528a","line":23,"range":{"start_line":23,"start_character":13,"end_line":23,"end_character":20},"in_reply_to":"9a89bdaa_82afc57b","updated":"2016-09-08 09:58:56.000000000","message":"Thanks for clarification, will you please add this to the commit message?","commit_id":"4709d845cb5fe1ff19302eeb3b20097490496bb3"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"3cf79d4eb631599695e7579c054e99537717e7c8","unresolved":false,"context_lines":[{"line_number":20,"context_line":"router. After that, it rollbacks this port to original state."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ib68aee164a3062648fc882012d57b5e381f52196"},{"line_number":23,"context_line":"Closes-Bug: #1535549"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_37570ccb","line":23,"range":{"start_line":23,"start_character":13,"end_line":23,"end_character":20},"in_reply_to":"9a89bdaa_980e528a","updated":"2016-09-08 12:26:18.000000000","message":"Done","commit_id":"4709d845cb5fe1ff19302eeb3b20097490496bb3"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"43b7754f7b9f052acc441045a693a36f4d42f738","unresolved":false,"context_lines":[{"line_number":20,"context_line":"router. After that, it rollbacks this port to original state."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ib68aee164a3062648fc882012d57b5e381f52196"},{"line_number":23,"context_line":"Closes-Bug: #1535549"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a89bdaa_82afc57b","line":23,"range":{"start_line":23,"start_character":13,"end_line":23,"end_character":20},"in_reply_to":"9a89bdaa_d32e02a4","updated":"2016-09-08 09:24:09.000000000","message":"As we expected, when the concurrent requests occuring, neutron will accept one request, and other will be rejected by message \u0027...overlapped CIDR...\u0027\n\nThe Kevin\u0027s patch[1] fixed the case of race condition, but neutron raises \u0027...Port already has an attached device...\u0027 instead of \u0027...overlapped CIDR...\u0027, because neutron didn\u0027t cleanup port when the request retrying.\n\n[1] https://review.openstack.org/#/c/303966/\n\nThis patch is needed to fix the bug completely.\nSo I mentioned the bug on the commit message.\nHow do you think?","commit_id":"4709d845cb5fe1ff19302eeb3b20097490496bb3"}],"neutron/db/l3_db.py":[{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"3a4759f6b06a6cc303c88ed55eaa3333c1f8e1f8","unresolved":false,"context_lines":[{"line_number":754,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"},{"line_number":755,"context_line":"                                               interface_info[\u0027port_id\u0027]) \\"},{"line_number":756,"context_line":"                    as delmgr:"},{"line_number":757,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":758,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":759,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":760,"context_line":"        # add_by_subnet is not used here, because the validation logic of"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_56c51e3a","line":757,"range":{"start_line":757,"start_character":41,"end_line":757,"end_character":52},"updated":"2016-07-25 15:29:27.000000000","message":"At this point, delete_port is always False, so it\u0027s more explicit IMO to use \u0027delmgr.delete_on_error \u003d False\u0027 here.","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"5f264d83a916250bd283293e1c216f481c7ba2fa","unresolved":false,"context_lines":[{"line_number":754,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"},{"line_number":755,"context_line":"                                               interface_info[\u0027port_id\u0027]) \\"},{"line_number":756,"context_line":"                    as delmgr:"},{"line_number":757,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":758,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":759,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":760,"context_line":"        # add_by_subnet is not used here, because the validation logic of"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_0dcccc87","line":757,"range":{"start_line":757,"start_character":41,"end_line":757,"end_character":52},"in_reply_to":"dada55a8_4d4fe433","updated":"2016-07-27 08:37:34.000000000","message":"Ah I mean that I want it become to same L770 :D","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"8d3cf9f0680c661bd384d0a77cf8bd918a480f18","unresolved":false,"context_lines":[{"line_number":754,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"},{"line_number":755,"context_line":"                                               interface_info[\u0027port_id\u0027]) \\"},{"line_number":756,"context_line":"                    as delmgr:"},{"line_number":757,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":758,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":759,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":760,"context_line":"        # add_by_subnet is not used here, because the validation logic of"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_ca3c5ae3","line":757,"range":{"start_line":757,"start_character":41,"end_line":757,"end_character":52},"in_reply_to":"dada55a8_56c51e3a","updated":"2016-07-27 08:16:29.000000000","message":"I just want to make uniform with other functions.","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"4c3b8454ddd6271de18655fe0e7f494ad08454c0","unresolved":false,"context_lines":[{"line_number":754,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"},{"line_number":755,"context_line":"                                               interface_info[\u0027port_id\u0027]) \\"},{"line_number":756,"context_line":"                    as delmgr:"},{"line_number":757,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":758,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":759,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":760,"context_line":"        # add_by_subnet is not used here, because the validation logic of"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_4d4fe433","line":757,"range":{"start_line":757,"start_character":41,"end_line":757,"end_character":52},"in_reply_to":"dada55a8_ca3c5ae3","updated":"2016-07-27 08:19:21.000000000","message":"Which functions?","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"3a4759f6b06a6cc303c88ed55eaa3333c1f8e1f8","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_1c146542","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"updated":"2016-07-25 15:29:27.000000000","message":"This can easily just use \u0027new_port\u0027, i.e. \"delmgr.delete_on_error \u003d new_port\" (which implies that only new ports should be deleted.\n\nFor clarity and added bonus, new_port can also be renamed to is_new_port :)","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"8d3cf9f0680c661bd384d0a77cf8bd918a480f18","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_6db8e82a","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"in_reply_to":"dada55a8_1c146542","updated":"2016-07-27 08:16:29.000000000","message":"We cannot use \"delmgr.delete_on_error \u003d new_port\".\nBecause \u0027new_port\u0027 always equal True. What happens if I want to add interface by port? :D","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"5f264d83a916250bd283293e1c216f481c7ba2fa","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_6d2e28a6","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"in_reply_to":"dada55a8_2d4ef03a","updated":"2016-07-27 08:37:34.000000000","message":"_add_interface_by_subnet returned 3 values (variable_A, variable_B, True). So I think that new_port is always True, did I miss something?\n\nAnd I think delete_port variable is needed.\ndelete_port is True if we add interface by subnet, it is False if we add interface by port.","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"8c971fecd2aee5d61e94104f749ee7968f90c845","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_a0c94728","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"in_reply_to":"dada55a8_6d2e28a6","updated":"2016-07-27 08:53:28.000000000","message":"[1] can return False for the third parameter :)\nIn this case, delete_port is indeeded needed - so I\u0027m suggesting you rename it to something more indicative (like \"is_new_port\" or \"should_delete_port\").\n\n[1]: https://github.com/openstack/neutron/blob/9fd6b5841d4d9e506812587f7d8b82868d267674/neutron/db/l3_db.py#L726","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"4c3b8454ddd6271de18655fe0e7f494ad08454c0","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_2d4ef03a","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"in_reply_to":"dada55a8_6db8e82a","updated":"2016-07-27 08:19:21.000000000","message":"new_port doesn\u0027t always equal True, since _add_interface_by_subnet might return False for the third argument in case it didn\u0027t need to create a new port.\n\nIf my last statement is incorrect though, and new_port is always True, then you don\u0027t need the delete_port variable at all :)","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"1e1cbafac2047de539114269fe3d81116f5a61ee","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        if new_port:"},{"line_number":768,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin,"},{"line_number":769,"context_line":"                                               context, port[\u0027id\u0027]) as delmgr:"},{"line_number":770,"context_line":"                delmgr.delete_on_error \u003d delete_port"},{"line_number":771,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":772,"context_line":"                    router_port \u003d RouterPort("},{"line_number":773,"context_line":"                        port_id\u003dport[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_030add25","line":770,"range":{"start_line":770,"start_character":41,"end_line":770,"end_character":52},"in_reply_to":"dada55a8_a0c94728","updated":"2016-07-27 09:17:34.000000000","message":"So sorry, I already missed it.\nThank you so much for reminding me. I will update this patch after Kevin\u0027s patch has been approved.","commit_id":"72e8fe75b01e6dd661594e512682478abc08c910"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"63f69a44504e11c298796dd32c0fdd726625a214","unresolved":false,"context_lines":[{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":779,"context_line":"        is_new_port \u003d True"},{"line_number":780,"context_line":"        delete_port \u003d False"},{"line_number":781,"context_line":""},{"line_number":782,"context_line":"        if add_by_port:"},{"line_number":783,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_85070081","line":780,"updated":"2016-08-17 22:32:48.000000000","message":"It\u0027s not a good idea to rename these, or methods, since it\u0027s noise reviewers have to go through to see the actual bug fix.  Please just add the code below for the fix and do any renaming in another cleanup change.","commit_id":"9673d178d2bbfe322a5c376a2f893477779dcff6"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"193ee175edf597f4523e9499947d99c0e8b59891","unresolved":false,"context_lines":[{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":779,"context_line":"        is_new_port \u003d True"},{"line_number":780,"context_line":"        delete_port \u003d False"},{"line_number":781,"context_line":""},{"line_number":782,"context_line":"        if add_by_port:"},{"line_number":783,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_b95ce07d","line":780,"in_reply_to":"3ac371cc_85070081","updated":"2016-08-18 02:22:15.000000000","message":"+1","commit_id":"9673d178d2bbfe322a5c376a2f893477779dcff6"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":795,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":796,"context_line":"            cleanup_port \u003d new_port  # only cleanup port we created"},{"line_number":797,"context_line":"            if not cleanup_port:"},{"line_number":798,"context_line":"                prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        if new_port:"},{"line_number":801,"context_line":"            with p_utils.delete_port_on_error("}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_a052a411","line":798,"updated":"2016-08-26 19:22:11.000000000","message":"You don\u0027t need this under an if, right? If you pass prev_owner and it\u0027s not used that\u0027s ok.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":795,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":796,"context_line":"            cleanup_port \u003d new_port  # only cleanup port we created"},{"line_number":797,"context_line":"            if not cleanup_port:"},{"line_number":798,"context_line":"                prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        if new_port:"},{"line_number":801,"context_line":"            with p_utils.delete_port_on_error("}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_84b578ef","line":798,"in_reply_to":"fa7ab95a_a052a411","updated":"2016-08-29 04:10:04.000000000","message":"Done","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":800,"context_line":"        if new_port:"},{"line_number":801,"context_line":"            with p_utils.delete_port_on_error("},{"line_number":802,"context_line":"                    self._core_plugin, context, port[\u0027id\u0027], prev_owner) \\"},{"line_number":803,"context_line":"                    as delmgr:"},{"line_number":804,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":805,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":806,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_206694ed","line":803,"updated":"2016-08-26 19:22:11.000000000","message":"Leaving the indentation like it was and putting prev_owner on a new line would remove the \u0027\\\u0027, and also make the change more obvious.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":800,"context_line":"        if new_port:"},{"line_number":801,"context_line":"            with p_utils.delete_port_on_error("},{"line_number":802,"context_line":"                    self._core_plugin, context, port[\u0027id\u0027], prev_owner) \\"},{"line_number":803,"context_line":"                    as delmgr:"},{"line_number":804,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":805,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":806,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_a4b8bce6","line":803,"in_reply_to":"fa7ab95a_206694ed","updated":"2016-08-29 04:10:04.000000000","message":"Done","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"28cc1c996ffe56fc5f94bae81066ba89b5d86419","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        if new_port:"},{"line_number":800,"context_line":"            with p_utils.delete_port_on_error(self._core_plugin,"},{"line_number":801,"context_line":"                                              context, port[\u0027id\u0027],"},{"line_number":802,"context_line":"                                              prev_owner) as delmgr:"},{"line_number":803,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":804,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":805,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_e338b3a2","line":802,"range":{"start_line":800,"start_character":0,"end_line":802,"end_character":68},"updated":"2016-08-30 03:17:18.000000000","message":"[1]\nAfter changing, the code will like that: http://paste.openstack.org/show/564723/\n\nHow do you thing?","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"bfa5917f69467923d848319d0c665bc85506fa09","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        if new_port:"},{"line_number":800,"context_line":"            with p_utils.delete_port_on_error(self._core_plugin,"},{"line_number":801,"context_line":"                                              context, port[\u0027id\u0027],"},{"line_number":802,"context_line":"                                              prev_owner) as delmgr:"},{"line_number":803,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":804,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":805,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_5f8564ab","line":802,"updated":"2016-08-31 05:04:18.000000000","message":"you would just use the \u0027cleanup_port\u0027 boolean to decide which context manager to use, not use both of them","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"56d4db3bc00edfb085f07ebf189efa23c4669d21","unresolved":false,"context_lines":[{"line_number":799,"context_line":"        if new_port:"},{"line_number":800,"context_line":"            with p_utils.delete_port_on_error(self._core_plugin,"},{"line_number":801,"context_line":"                                              context, port[\u0027id\u0027],"},{"line_number":802,"context_line":"                                              prev_owner) as delmgr:"},{"line_number":803,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":804,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":805,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_56baa66f","line":802,"in_reply_to":"fa7ab95a_5f8564ab","updated":"2016-08-31 08:46:16.000000000","message":"Done","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"1b34bfab7900a3286469863738ce0e64e55deaea","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        if new_port:"},{"line_number":800,"context_line":"            with p_utils.delete_port_on_error(self._core_plugin,"},{"line_number":801,"context_line":"                                              context, port[\u0027id\u0027],"},{"line_number":802,"context_line":"                                              prev_owner) as delmgr:"},{"line_number":803,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":804,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":805,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_d92c8204","line":802,"range":{"start_line":800,"start_character":0,"end_line":802,"end_character":68},"in_reply_to":"fa7ab95a_e338b3a2","updated":"2016-08-30 03:39:22.000000000","message":"s/thing/think","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":784,"context_line":"            port \u003d self._check_router_port(context, port_id, \u0027\u0027)"},{"line_number":785,"context_line":"            prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":786,"context_line":"            with p_utils.update_port_on_error("},{"line_number":787,"context_line":"                    self._core_plugin, context, port_id, prev_owner) as delmgr:"},{"line_number":788,"context_line":"                delmgr.delete_on_error \u003d False"},{"line_number":789,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":790,"context_line":"                    context, router, port_id, device_owner)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_7ca2209c","line":787,"updated":"2016-08-31 11:20:54.000000000","message":"get rid of delmgr here and make update_port_on_error just always update the port on errors.","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":804,"context_line":"            args \u003d (self._core_plugin, context, port[\u0027id\u0027], prev_owner)"},{"line_number":805,"context_line":""},{"line_number":806,"context_line":"        if new_port:"},{"line_number":807,"context_line":"            with cleanup_port_on_error(*args) as delmgr:"},{"line_number":808,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":809,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":810,"context_line":"                    router_port \u003d RouterPort("}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_9c9fe44f","line":807,"updated":"2016-08-31 11:20:54.000000000","message":"get rid of delmgr. cleanup_port already determines the behavior on error by selecting the correct context manager. L808 isn\u0027t necessary.","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"f36c2b5d7e0a98234f41da3afc4a0b4964f22091","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        elif add_by_sub:"},{"line_number":320,"context_line":"            port, subnets, is_new_port \u003d self._add_interface_by_subnet("},{"line_number":321,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":322,"context_line":"            delete_port \u003d is_new_port"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        subnet \u003d subnets[0]"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_adb42235","line":322,"updated":"2016-08-03 14:56:33.000000000","message":"Might as well add \"# only delete port we created\" to this file as well :)","commit_id":"a140617b9fd539d1623ec5df6c27c768882badf0"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"aa200bdb4618663116068a88200cfcbd1922395f","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        elif add_by_sub:"},{"line_number":320,"context_line":"            port, subnets, is_new_port \u003d self._add_interface_by_subnet("},{"line_number":321,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":322,"context_line":"            delete_port \u003d is_new_port"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        subnet \u003d subnets[0]"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_552192fa","line":322,"in_reply_to":"bacf61ea_adb42235","updated":"2016-08-04 01:10:39.000000000","message":"You\u0027re right. It will make the code clearer. Thanks so much for your reviewing :)","commit_id":"a140617b9fd539d1623ec5df6c27c768882badf0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"63f69a44504e11c298796dd32c0fdd726625a214","unresolved":false,"context_lines":[{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":314,"context_line":"        is_new_port \u003d True"},{"line_number":315,"context_line":"        delete_port \u003d False"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        if add_by_port:"},{"line_number":318,"context_line":"            with p_utils.cleanup_port_on_error(self._core_plugin, context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_650ac48b","line":315,"updated":"2016-08-17 22:32:48.000000000","message":"Here too","commit_id":"9673d178d2bbfe322a5c376a2f893477779dcff6"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":314,"context_line":"        new_port \u003d True"},{"line_number":315,"context_line":"        cleanup_port \u003d False"},{"line_number":316,"context_line":"        prev_owner \u003d None"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        if add_by_port:"},{"line_number":319,"context_line":"            port_id \u003d interface_info[\u0027port_id\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_545eec76","line":316,"updated":"2016-08-26 19:22:11.000000000","message":"Is this necessary? I think in both cases we\u0027ll get to L333 with port being set, so prev_owner would be too.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":314,"context_line":"        new_port \u003d True"},{"line_number":315,"context_line":"        cleanup_port \u003d False"},{"line_number":316,"context_line":"        prev_owner \u003d None"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        if add_by_port:"},{"line_number":319,"context_line":"            port_id \u003d interface_info[\u0027port_id\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_c4cf807d","line":316,"in_reply_to":"fa7ab95a_545eec76","updated":"2016-08-29 04:10:04.000000000","message":"Done","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":330,"context_line":"            cleanup_port \u003d new_port"},{"line_number":331,"context_line":"            if not cleanup_port:"},{"line_number":332,"context_line":"                prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        subnet \u003d subnets[0]"},{"line_number":335,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_a02b8481","line":332,"updated":"2016-08-26 19:22:11.000000000","message":"You don\u0027t need this under an if, right?  If you pass prev_owner and it\u0027s not used that\u0027s ok.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":330,"context_line":"            cleanup_port \u003d new_port"},{"line_number":331,"context_line":"            if not cleanup_port:"},{"line_number":332,"context_line":"                prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        subnet \u003d subnets[0]"},{"line_number":335,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_24c58c5a","line":332,"in_reply_to":"fa7ab95a_a02b8481","updated":"2016-08-29 04:10:04.000000000","message":"Done","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        if new_port:"},{"line_number":337,"context_line":"            with p_utils.delete_port_on_error("},{"line_number":338,"context_line":"                    self._core_plugin, context, port[\u0027id\u0027], prev_owner) \\"},{"line_number":339,"context_line":"                    as delmgr:"},{"line_number":340,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":341,"context_line":"                if router.extra_attributes.distributed and router.gw_port:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_55827c95","line":338,"updated":"2016-08-26 19:22:11.000000000","message":"Leaving the indentation like it was and putting prev_owner on a new line would remove the \u0027\\\u0027, and also make the change more obvious.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        if new_port:"},{"line_number":337,"context_line":"            with p_utils.delete_port_on_error("},{"line_number":338,"context_line":"                    self._core_plugin, context, port[\u0027id\u0027], prev_owner) \\"},{"line_number":339,"context_line":"                    as delmgr:"},{"line_number":340,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":341,"context_line":"                if router.extra_attributes.distributed and router.gw_port:"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_44a290af","line":338,"in_reply_to":"fa7ab95a_55827c95","updated":"2016-08-29 04:10:04.000000000","message":"Done","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":319,"context_line":"            port \u003d self._check_router_port(context, port_id, \u0027\u0027)"},{"line_number":320,"context_line":"            prev_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":321,"context_line":"            with p_utils.update_port_on_error("},{"line_number":322,"context_line":"                    self._core_plugin, context, port_id, prev_owner) as delmgr:"},{"line_number":323,"context_line":"                delmgr.delete_on_error \u003d False"},{"line_number":324,"context_line":"                port, subnets \u003d self._add_interface_by_port("},{"line_number":325,"context_line":"                    context, router, port_id, device_owner)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_3c98986a","line":322,"updated":"2016-08-31 11:20:54.000000000","message":"get rid of delmgr and L323","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            args \u003d (self._core_plugin, context, port[\u0027id\u0027])"},{"line_number":337,"context_line":"        else:"},{"line_number":338,"context_line":"            cleanup_port_on_error \u003d p_utils.update_port_on_error"},{"line_number":339,"context_line":"            args \u003d (self._core_plugin, context, port[\u0027id\u0027], prev_owner)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"        if new_port:"},{"line_number":342,"context_line":"            with cleanup_port_on_error(*args) as delmgr:"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_5c9d5c58","line":339,"updated":"2016-08-31 11:20:54.000000000","message":"the args don\u0027t need to be stashed separately, you can just construct the context manager directly here. it\u0027s not invoked until the \u0027with\u0027 statment. \n\nL334-L344 becomes:\n\nif cleanup_port:\n    mgr \u003d p_utils.delete_port_on_error(self._core_plugin, context, port[\u0027id\u0027])\nelse:\n    mgr \u003d p_utils.update_port_on_error(self._core_plugin, context, port[\u0027id\u0027], prev_owner)\n\nif new_port:\n    with mgr:\n       if router.extra_attributes.distributed...","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"837e726e9a1b41c1c3d08fbb6a7458d8e4c02d15","unresolved":false,"context_lines":[{"line_number":339,"context_line":"            args \u003d (self._core_plugin, context, port[\u0027id\u0027], prev_owner)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"        if new_port:"},{"line_number":342,"context_line":"            with cleanup_port_on_error(*args) as delmgr:"},{"line_number":343,"context_line":"                delmgr.delete_on_error \u003d cleanup_port"},{"line_number":344,"context_line":"                if router.extra_attributes.distributed and router.gw_port:"},{"line_number":345,"context_line":"                    admin_context \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_c5e1969c","line":342,"updated":"2016-08-31 09:47:05.000000000","message":"you can get rid of delmgr in this case and then have update_port_on_error not yield anything since it doesn\u0027t need to be conditional","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"}],"neutron/plugins/common/utils.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d68ba466f4b4250e15d741b5df2effbd912d1816","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                else:"},{"line_number":217,"context_line":"                    core_plugin.update_port(context, port_id,"},{"line_number":218,"context_line":"                                            {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027,"},{"line_number":219,"context_line":"                                                      \u0027device_owner\u0027: \u0027\u0027}}"},{"line_number":220,"context_line":"                                            )"},{"line_number":221,"context_line":"            except Exception:"},{"line_number":222,"context_line":"                LOG.exception(_LE(\"Failed to cleanup port: %s\"), port_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3ac371cc_98be17ac","line":219,"updated":"2016-08-18 14:16:48.000000000","message":"I don\u0027t think clearing device_owner here is right.","commit_id":"f181a34b76474139f2fe4ab84a685ac03278710e"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"5ab1eb93fa7e182f90e73af22cb1d5f0ecea03b3","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                else:"},{"line_number":217,"context_line":"                    core_plugin.update_port(context, port_id,"},{"line_number":218,"context_line":"                                            {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027,"},{"line_number":219,"context_line":"                                                      \u0027device_owner\u0027: \u0027\u0027}}"},{"line_number":220,"context_line":"                                            )"},{"line_number":221,"context_line":"            except Exception:"},{"line_number":222,"context_line":"                LOG.exception(_LE(\"Failed to cleanup port: %s\"), port_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3ac371cc_3d0d2e38","line":219,"in_reply_to":"3ac371cc_98be17ac","updated":"2016-08-19 03:20:53.000000000","message":"This\u0027s my mistake, I will update later.","commit_id":"f181a34b76474139f2fe4ab84a685ac03278710e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90a981212977eb1564b9ca06e434ed10b5d16637","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"@contextlib.contextmanager"},{"line_number":206,"context_line":"def delete_port_on_error(core_plugin, context, port_id, prev_owner\u003dNone):"},{"line_number":207,"context_line":"    mgr \u003d _DelManager()"},{"line_number":208,"context_line":"    try:"},{"line_number":209,"context_line":"        yield mgr"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_e979e9fd","line":206,"updated":"2016-08-26 19:22:11.000000000","message":"Do (or should?) all users pass prev_owner?","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19554,"name":"Nam","email":"namnh68@fsoft.com.vn","username":"namnh"},"change_message_id":"204a65c26c1089070ed37b3005c0b6917f8765fc","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"@contextlib.contextmanager"},{"line_number":206,"context_line":"def delete_port_on_error(core_plugin, context, port_id, prev_owner\u003dNone):"},{"line_number":207,"context_line":"    mgr \u003d _DelManager()"},{"line_number":208,"context_line":"    try:"},{"line_number":209,"context_line":"        yield mgr"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_02a07b8f","line":206,"in_reply_to":"fa7ab95a_22f3bfd7","updated":"2016-08-29 02:22:17.000000000","message":"trananhkma: IMO, \"all users\" means to be both admin and normal user. \n\n\u003e Do (or should?) all users pass prev_owner?\n\nIMO, Should we allow all users (both admin and normal user) can pass \"prev_owner\" value via API.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"6199ac315802100b71a4d96f5d300aa4afad6877","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"@contextlib.contextmanager"},{"line_number":206,"context_line":"def delete_port_on_error(core_plugin, context, port_id, prev_owner\u003dNone):"},{"line_number":207,"context_line":"    mgr \u003d _DelManager()"},{"line_number":208,"context_line":"    try:"},{"line_number":209,"context_line":"        yield mgr"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_64087492","line":206,"in_reply_to":"fa7ab95a_e979e9fd","updated":"2016-08-29 04:10:04.000000000","message":"\u0027prev_owner\u0027 is not used in all pre-existing function calls.\nNow, in my changing, it\u0027s used in somewhere, but not all. So I put the \u0027None\u0027 for default values to pass all pre-existing.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"39686581facc2b89848ba22a54479ded4f14829f","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"@contextlib.contextmanager"},{"line_number":206,"context_line":"def delete_port_on_error(core_plugin, context, port_id, prev_owner\u003dNone):"},{"line_number":207,"context_line":"    mgr \u003d _DelManager()"},{"line_number":208,"context_line":"    try:"},{"line_number":209,"context_line":"        yield mgr"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa7ab95a_22f3bfd7","line":206,"in_reply_to":"fa7ab95a_e979e9fd","updated":"2016-08-29 02:15:02.000000000","message":"trananhkma: I believe what bhaley was saying is, are there really any circumstances where prev_owner should not be set?  If prev_owner should always be set, then don\u0027t have prev_owner default to None.","commit_id":"1ae18425453a8d43d34448684084e6563462de73"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a709faa98a7155028d2871807aac20e3ea8e0462","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                if mgr.delete_on_error:"},{"line_number":214,"context_line":"                    core_plugin.delete_port(context, port_id,"},{"line_number":215,"context_line":"                                            l3_port_check\u003dFalse)"},{"line_number":216,"context_line":"                else:"},{"line_number":217,"context_line":"                    core_plugin.update_port(context, port_id,"},{"line_number":218,"context_line":"                        {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027,"},{"line_number":219,"context_line":"                                  \u0027device_owner\u0027: prev_owner}})"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_021af87c","line":216,"updated":"2016-08-29 23:27:27.000000000","message":"please just create an alternate context manager that does this. Having something update a port instead isn\u0027t intuitive.\n\nOne called \u0027update_port_on_error\u0027 that accepts a dictionary to pass to \u0027update\u0027.","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":19935,"name":"Anh Tran","email":"anhtt@vn.fujitsu.com","username":"trananhkma"},"change_message_id":"28cc1c996ffe56fc5f94bae81066ba89b5d86419","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                if mgr.delete_on_error:"},{"line_number":214,"context_line":"                    core_plugin.delete_port(context, port_id,"},{"line_number":215,"context_line":"                                            l3_port_check\u003dFalse)"},{"line_number":216,"context_line":"                else:"},{"line_number":217,"context_line":"                    core_plugin.update_port(context, port_id,"},{"line_number":218,"context_line":"                        {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027,"},{"line_number":219,"context_line":"                                  \u0027device_owner\u0027: prev_owner}})"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa7ab95a_c6b49d36","line":216,"in_reply_to":"fa7ab95a_021af87c","updated":"2016-08-30 03:17:18.000000000","message":"If we detach the \u0027else\u0027 here to other contextmanager, we must use double \u0027with\u0027 in [1], right?","commit_id":"3d28057108d95cf97b04b8ac97e9ef8e5fcbd141"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    except Exception:"},{"line_number":211,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":212,"context_line":"            try:"},{"line_number":213,"context_line":"                if mgr.delete_on_error:"},{"line_number":214,"context_line":"                    core_plugin.delete_port(context, port_id,"},{"line_number":215,"context_line":"                                            l3_port_check\u003dFalse)"},{"line_number":216,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_bcaca88d","line":213,"updated":"2016-08-31 11:20:54.000000000","message":"get rid of this conditional and L207. Turn L209 into just \u0027yield\u0027","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"@contextlib.contextmanager"},{"line_number":221,"context_line":"def update_port_on_error(core_plugin, context, port_id, prev_owner):"},{"line_number":222,"context_line":"    mgr \u003d _DelManager()"},{"line_number":223,"context_line":"    try:"},{"line_number":224,"context_line":"        yield mgr"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_dca96c7d","line":221,"updated":"2016-08-31 11:20:54.000000000","message":"make this function not tied to just the device_owner. Have the last arg just be a dict that you pass into the body of update_port.\n\ncore_plugin.update_port(context, port_id, {\u0027port\u0027: revert_value})","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2974474fed8f15e58733e7c9bd1cb7247751a10","unresolved":false,"context_lines":[{"line_number":225,"context_line":"    except Exception:"},{"line_number":226,"context_line":"        with excutils.save_and_reraise_exception():"},{"line_number":227,"context_line":"            try:"},{"line_number":228,"context_line":"                if not mgr.delete_on_error:"},{"line_number":229,"context_line":"                    core_plugin.update_port(context, port_id,"},{"line_number":230,"context_line":"                        {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027,"},{"line_number":231,"context_line":"                                  \u0027device_owner\u0027: prev_owner}})"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa7ab95a_fcb470d5","line":228,"updated":"2016-08-31 11:20:54.000000000","message":"get rid of this conditional and L222 and turn L224 into just \u0027yield\u0027","commit_id":"8fa04365e99ae88121e220997f21dafc231ec67b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"252c05a901c065dc0d91a105b27580c9b355b6b4","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    return core_plugin.create_port(context, {\u0027port\u0027: port_data})"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"class _DelManager(object):"},{"line_number":201,"context_line":"    def __init__(self):"},{"line_number":202,"context_line":"        self.delete_on_error \u003d True"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa7ab95a_495ad52b","line":200,"updated":"2016-08-31 20:16:48.000000000","message":"get rid of this class now","commit_id":"dc8e4ed70921be85032892deea8428febe1f2993"}]}
