)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"04d96867d9955548f3b5826936778d336d11c450","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     ZhaoBo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-04-13 20:50:04 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIP port forwarding support[1]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"9f6a8fd7_50d50de4","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":30},"updated":"2018-04-20 09:40:54.000000000","message":"I think the neutron-server side patch, should be the first\none, and the l3 agent side (this) patch depends on that.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     ZhaoBo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-04-13 20:50:04 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIP port forwarding support[1]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"9f6a8fd7_c972d8ad","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":30},"in_reply_to":"9f6a8fd7_50d50de4","updated":"2018-04-21 07:09:12.000000000","message":"OK. Thanks for suggestion. From my thought, I think the function should be after API. But maybe it\u0027s wrong. I will change the order.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     ZhaoBo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-05-10 18:43:28 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIP port forwarding support[agent-side]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5f7c97a3_706a401a","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":39},"updated":"2018-05-15 08:01:33.000000000","message":"What about `L3 agent side floating IP port forwarding`","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     ZhaoBo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-05-10 18:43:28 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"FIP port forwarding support[agent-side]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5f7c97a3_8741dfab","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":39},"in_reply_to":"5f7c97a3_706a401a","updated":"2018-05-15 08:58:51.000000000","message":"Good, let me change. :)","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":7,"context_line":"FIP port forwarding support[agent-side]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Patch List:"},{"line_number":12,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":13,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer work."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5f7c97a3_50586486","line":10,"updated":"2018-05-15 08:01:33.000000000","message":"Yes, again, a brief description for the new l3 agent extension.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"FIP port forwarding support[agent-side]"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Patch List:"},{"line_number":12,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":13,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer work."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5f7c97a3_c70cb795","line":10,"in_reply_to":"5f7c97a3_50586486","updated":"2018-05-15 08:58:51.000000000","message":"OK.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Patch List:"},{"line_number":16,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":17,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer work."},{"line_number":18,"context_line":"[3] Extend the current fip API"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_4806a688","line":17,"range":{"start_line":17,"start_character":71,"end_line":17,"end_character":76},"updated":"2018-05-29 14:16:34.000000000","message":"nit: this line is a bit too long","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Patch List:"},{"line_number":16,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":17,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer work."},{"line_number":18,"context_line":"[3] Extend the current fip API"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_860fc686","line":17,"range":{"start_line":17,"start_character":71,"end_line":17,"end_character":76},"in_reply_to":"5f7c97a3_4806a688","updated":"2018-05-30 01:58:11.000000000","message":"Thanks, will rework here.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"26317c5ac30efe714f3daa475666b0454551bc3c","unresolved":false,"context_lines":[{"line_number":18,"context_line":"[3] Extend the current fip API"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: blueprint port-forwarding"},{"line_number":21,"context_line":"Depends-On: https://review.openstack.org/#/c/535647/"},{"line_number":22,"context_line":"Partial-Bug: #1491317"},{"line_number":23,"context_line":"Change-Id: Ic56e67d428f6177099c285a9d1bccabc1e710f2b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_994156a9","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":52},"updated":"2018-05-30 21:31:19.000000000","message":"I don\u0027t think this line is necessary. This patchset is rebased on top of that one. That\u0027s all we need","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":18,"context_line":"[3] Extend the current fip API"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Implements: blueprint port-forwarding"},{"line_number":21,"context_line":"Depends-On: https://review.openstack.org/#/c/535647/"},{"line_number":22,"context_line":"Partial-Bug: #1491317"},{"line_number":23,"context_line":"Change-Id: Ic56e67d428f6177099c285a9d1bccabc1e710f2b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_a05c0f19","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":52},"in_reply_to":"5f7c97a3_994156a9","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"ced27fbc654e65d03b61a61ac7167e126cf236e4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Currrently, we support all Neutron Router reference implementations."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Patch List:"},{"line_number":16,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":17,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer"},{"line_number":18,"context_line":"work."},{"line_number":19,"context_line":"[3] Extend the current fip API"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partially-Implements: blueprint port-forwarding"},{"line_number":22,"context_line":"Partial-Bug: #1491317"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"5f7c97a3_9771ed47","line":19,"range":{"start_line":16,"start_character":0,"end_line":19,"end_character":30},"updated":"2018-07-10 18:37:49.000000000","message":"I think this need an update !","commit_id":"7763bdb07271d20b58753931d9fadd6dcec54e1e"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"9dd79141f5e7aef4d1dc8c007fd101990053e587","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Currrently, we support all Neutron Router reference implementations."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Patch List:"},{"line_number":16,"context_line":"[1] Extend l3 agent extension and necessary works in backend."},{"line_number":17,"context_line":"[2] Create new service plugin for port forwarding and fulfill db layer"},{"line_number":18,"context_line":"work."},{"line_number":19,"context_line":"[3] Extend the current fip API"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partially-Implements: blueprint port-forwarding"},{"line_number":22,"context_line":"Partial-Bug: #1491317"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"5f7c97a3_e9cabd45","line":19,"range":{"start_line":16,"start_character":0,"end_line":19,"end_character":30},"in_reply_to":"5f7c97a3_9771ed47","updated":"2018-07-11 03:38:53.000000000","message":"Done","commit_id":"7763bdb07271d20b58753931d9fadd6dcec54e1e"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":"This patch introduce a new l3 agent extension named \"port_forwarding\","},{"line_number":11,"context_line":"to process the binding the port forwarding resources, manage its own"},{"line_number":12,"context_line":"floatingip configuration on router interface and floatingip status."},{"line_number":13,"context_line":"Currrently, we support all Neutron Router reference implementations."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_c66b8719","line":11,"range":{"start_line":11,"start_character":23,"end_line":11,"end_character":26},"updated":"2018-07-18 11:07:22.000000000","message":"\"of the\" probably","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch contains the l3 agent extension and agent part code."},{"line_number":10,"context_line":"This patch introduce a new l3 agent extension named \"port_forwarding\","},{"line_number":11,"context_line":"to process the binding the port forwarding resources, manage its own"},{"line_number":12,"context_line":"floatingip configuration on router interface and floatingip status."},{"line_number":13,"context_line":"Currrently, we support all Neutron Router reference implementations."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_c1d931f1","line":11,"range":{"start_line":11,"start_character":23,"end_line":11,"end_character":26},"in_reply_to":"5f7c97a3_c66b8719","updated":"2018-07-18 12:02:42.000000000","message":"Done","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_66c39307","line":21,"range":{"start_line":21,"start_character":35,"end_line":21,"end_character":40},"updated":"2018-07-18 11:07:22.000000000","message":"\"refresh\" maybe?","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_26c91b23","line":21,"range":{"start_line":21,"start_character":61,"end_line":21,"end_character":66},"updated":"2018-07-18 11:07:22.000000000","message":"larger?","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_a6476ba4","line":21,"range":{"start_line":21,"start_character":2,"end_line":21,"end_character":5},"updated":"2018-07-18 11:07:22.000000000","message":"shouldn\u0027t be \"in smaller\"?","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_61ecdd91","line":21,"range":{"start_line":21,"start_character":61,"end_line":21,"end_character":66},"in_reply_to":"5f7c97a3_26c91b23","updated":"2018-07-18 12:02:42.000000000","message":"Done","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_21e2659d","line":21,"range":{"start_line":21,"start_character":35,"end_line":21,"end_character":40},"in_reply_to":"5f7c97a3_66c39307","updated":"2018-07-18 12:02:42.000000000","message":"Done","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":18,"context_line":"* The main idea about this new extension is using the generic router sync"},{"line_number":19,"context_line":"  rpc to maintain the host port forwarding resources,"},{"line_number":20,"context_line":"* For a single port forwarding create/update/delete, process it one by one"},{"line_number":21,"context_line":"  and smaller scope for forbidding fresh the iptables with a large"},{"line_number":22,"context_line":"  scope frequently."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-Implements: blueprint port-forwarding"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":28,"id":"5f7c97a3_e1ff8d32","line":21,"range":{"start_line":21,"start_character":2,"end_line":21,"end_character":5},"in_reply_to":"5f7c97a3_a6476ba4","updated":"2018-07-18 12:02:42.000000000","message":"Many thanks for helping English. :)","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"}],"neutron/agent/l3/extensions/port_forwarding.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a45d98fb57de19d8b667e1367f4584ef745485c4","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class RouterFipPfMapping(object):"},{"line_number":34,"context_line":"    def __init__(self):"},{"line_number":35,"context_line":"        self.managed_port_forwardings \u003d {}"},{"line_number":36,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_00382cd1","line":33,"range":{"start_line":33,"start_character":15,"end_line":33,"end_character":17},"updated":"2018-04-15 06:56:51.000000000","message":"Please change this to PortFowarding","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"2adf37c99dd7716628bca368fd5ecbb56472255d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class RouterFipPfMapping(object):"},{"line_number":34,"context_line":"    def __init__(self):"},{"line_number":35,"context_line":"        self.managed_port_forwardings \u003d {}"},{"line_number":36,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_e023b8bd","line":33,"range":{"start_line":33,"start_character":15,"end_line":33,"end_character":17},"in_reply_to":"9f6a8fd7_00382cd1","updated":"2018-04-15 10:15:01.000000000","message":"Thanks, will update it. :)","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a45d98fb57de19d8b667e1367f4584ef745485c4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def consume_api(self, agent_api):"},{"line_number":127,"context_line":"        self.agent_api \u003d agent_api"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":130,"context_line":"    def _handle_notification(self, context, resource_type,"},{"line_number":131,"context_line":"                             forwardings, event_type):"},{"line_number":132,"context_line":"        for forwarding in forwardings:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_c031d4ee","line":129,"updated":"2018-04-15 06:56:51.000000000","message":"why the lock here - this means that the whole all port forwarding will be serial.  why not per id or something that can still enable parallelism?","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"2adf37c99dd7716628bca368fd5ecbb56472255d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def consume_api(self, agent_api):"},{"line_number":127,"context_line":"        self.agent_api \u003d agent_api"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":130,"context_line":"    def _handle_notification(self, context, resource_type,"},{"line_number":131,"context_line":"                             forwardings, event_type):"},{"line_number":132,"context_line":"        for forwarding in forwardings:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_403f04d6","line":129,"in_reply_to":"9f6a8fd7_c031d4ee","updated":"2018-04-15 10:15:01.000000000","message":"Hmm, I consider the reason is this agent extension will listen on 2 rpc queues, one is the general \"router_update\", the other is the OVO \"PortForwarding\" queue. So I consider it may raise the concurrency issue if requesting \"router_update\" and create/update portforwarding resource, but the rpc messages arrived are not the same with request ordering. Please feel free to correct me, or welcome some advices about this. Thanks.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def _check_if_need_process(self, ri):"},{"line_number":250,"context_line":"        if not ri or not ri.get_ex_gw_port():"},{"line_number":251,"context_line":"            # agent not hold the router. pass"},{"line_number":252,"context_line":"            # This router doesn\u0027t own a gw port. pass"},{"line_number":253,"context_line":"            return False"},{"line_number":254,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"},{"line_number":255,"context_line":"        agent_mode \u003d ri.agent_conf.agent_mode"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_704cd141","line":252,"range":{"start_line":251,"start_character":12,"end_line":252,"end_character":53},"updated":"2018-04-20 09:24:09.000000000","message":"Maybe you can rewrite such notes, : )","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def _check_if_need_process(self, ri):"},{"line_number":250,"context_line":"        if not ri or not ri.get_ex_gw_port():"},{"line_number":251,"context_line":"            # agent not hold the router. pass"},{"line_number":252,"context_line":"            # This router doesn\u0027t own a gw port. pass"},{"line_number":253,"context_line":"            return False"},{"line_number":254,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"},{"line_number":255,"context_line":"        agent_mode \u003d ri.agent_conf.agent_mode"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_896860b9","line":252,"range":{"start_line":251,"start_character":12,"end_line":252,"end_character":53},"in_reply_to":"9f6a8fd7_704cd141","updated":"2018-04-21 07:09:12.000000000","message":"Ha, Right. Thanks.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                context, [port_forwarding], ri, interface_name, namespace,"},{"line_number":282,"context_line":"                iptables_manager)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _process_update(self, port_forwardings, iptables_manager,"},{"line_number":285,"context_line":"                        interface_name, namespace):"},{"line_number":286,"context_line":"        if not port_forwardings:"},{"line_number":287,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_30bdf901","line":284,"range":{"start_line":284,"start_character":8,"end_line":284,"end_character":23},"updated":"2018-04-20 09:24:09.000000000","message":"Maybe you should take care one scenario that mixed dvr_snat and compute node.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                context, [port_forwarding], ri, interface_name, namespace,"},{"line_number":282,"context_line":"                iptables_manager)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _process_update(self, port_forwardings, iptables_manager,"},{"line_number":285,"context_line":"                        interface_name, namespace):"},{"line_number":286,"context_line":"        if not port_forwardings:"},{"line_number":287,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_c943b812","line":284,"range":{"start_line":284,"start_character":8,"end_line":284,"end_character":23},"in_reply_to":"9f6a8fd7_30bdf901","updated":"2018-04-21 07:09:12.000000000","message":"Hmm, yes. But I test in the dvr_snat and compute node scenario. Both devstack and wire a same neutron-server(also test ha, hadvr). I test it. It seems OK. If any scenarios I missed, welcome to point out, I will make it better, and thanks for reminding. :)","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":411,"context_line":"                             namespace, iptable_manager)"},{"line_number":412,"context_line":"        self._store_local(remove_pfs, events.DELETED)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":415,"context_line":"    def add_router(self, context, data):"},{"line_number":416,"context_line":"        \"\"\"Handle a router add event."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        Called on router create."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param context: RPC context."},{"line_number":421,"context_line":"        :param data: Router data."},{"line_number":422,"context_line":"        \"\"\""},{"line_number":423,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":424,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":425,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":426,"context_line":"            return"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":431,"context_line":"    def update_router(self, context, data):"},{"line_number":432,"context_line":"        \"\"\"Handle a router update event."},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        Called on router update."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        :param context: RPC context."},{"line_number":437,"context_line":"        :param data: Router data."},{"line_number":438,"context_line":"        \"\"\""},{"line_number":439,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":440,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":441,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":442,"context_line":"            return"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"    def delete_router(self, context, data):"},{"line_number":447,"context_line":"        \"\"\"Handle a router delete event."}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_f038e1a0","line":444,"range":{"start_line":414,"start_character":0,"end_line":444,"end_character":64},"updated":"2018-04-20 09:24:09.000000000","message":"ditto","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":411,"context_line":"                             namespace, iptable_manager)"},{"line_number":412,"context_line":"        self._store_local(remove_pfs, events.DELETED)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":415,"context_line":"    def add_router(self, context, data):"},{"line_number":416,"context_line":"        \"\"\"Handle a router add event."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        Called on router create."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param context: RPC context."},{"line_number":421,"context_line":"        :param data: Router data."},{"line_number":422,"context_line":"        \"\"\""},{"line_number":423,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":424,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":425,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":426,"context_line":"            return"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":431,"context_line":"    def update_router(self, context, data):"},{"line_number":432,"context_line":"        \"\"\"Handle a router update event."},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"        Called on router update."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        :param context: RPC context."},{"line_number":437,"context_line":"        :param data: Router data."},{"line_number":438,"context_line":"        \"\"\""},{"line_number":439,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":440,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":441,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":442,"context_line":"            return"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"    def delete_router(self, context, data):"},{"line_number":447,"context_line":"        \"\"\"Handle a router delete event."}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_694cec41","line":444,"range":{"start_line":414,"start_character":0,"end_line":444,"end_character":64},"in_reply_to":"9f6a8fd7_f038e1a0","updated":"2018-04-21 07:09:12.000000000","message":"Thanks, will update.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _get_fip_rules(self, port_forward, wrap_name):"},{"line_number":144,"context_line":"        chain_rule_list \u003d []"},{"line_number":145,"context_line":"        chain_rule_list.append((\u0027fip-pf\u0027,"},{"line_number":146,"context_line":"                                \u0027-j %s-%s\u0027 %"},{"line_number":147,"context_line":"                                (wrap_name, self._get_pf_chain_name("},{"line_number":148,"context_line":"                                    port_forward.id))))"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_705d6045","line":145,"range":{"start_line":145,"start_character":32,"end_line":145,"end_character":40},"updated":"2018-05-15 08:01:33.000000000","message":"We can make such fixed name as global variable.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _get_fip_rules(self, port_forward, wrap_name):"},{"line_number":144,"context_line":"        chain_rule_list \u003d []"},{"line_number":145,"context_line":"        chain_rule_list.append((\u0027fip-pf\u0027,"},{"line_number":146,"context_line":"                                \u0027-j %s-%s\u0027 %"},{"line_number":147,"context_line":"                                (wrap_name, self._get_pf_chain_name("},{"line_number":148,"context_line":"                                    port_forward.id))))"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_077cefe9","line":145,"range":{"start_line":145,"start_character":32,"end_line":145,"end_character":40},"in_reply_to":"5f7c97a3_705d6045","updated":"2018-05-15 08:58:51.000000000","message":"Done","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        chain_rule_list \u003d []"},{"line_number":145,"context_line":"        chain_rule_list.append((\u0027fip-pf\u0027,"},{"line_number":146,"context_line":"                                \u0027-j %s-%s\u0027 %"},{"line_number":147,"context_line":"                                (wrap_name, self._get_pf_chain_name("},{"line_number":148,"context_line":"                                    port_forward.id))))"},{"line_number":149,"context_line":"        floating_ip_address \u003d str(port_forward.floating_ip_address)"},{"line_number":150,"context_line":"        protocol \u003d port_forward.protocol"},{"line_number":151,"context_line":"        internal_ip_address \u003d str(port_forward.internal_ip_address)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_d065541f","line":148,"range":{"start_line":147,"start_character":44,"end_line":148,"end_character":51},"updated":"2018-05-15 08:01:33.000000000","message":"add:\nchain_name \u003d self._get_pf_chain_name(port_forward.id)\nthen you can save L154 to call it again.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        chain_rule_list \u003d []"},{"line_number":145,"context_line":"        chain_rule_list.append((\u0027fip-pf\u0027,"},{"line_number":146,"context_line":"                                \u0027-j %s-%s\u0027 %"},{"line_number":147,"context_line":"                                (wrap_name, self._get_pf_chain_name("},{"line_number":148,"context_line":"                                    port_forward.id))))"},{"line_number":149,"context_line":"        floating_ip_address \u003d str(port_forward.floating_ip_address)"},{"line_number":150,"context_line":"        protocol \u003d port_forward.protocol"},{"line_number":151,"context_line":"        internal_ip_address \u003d str(port_forward.internal_ip_address)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_477507f9","line":148,"range":{"start_line":147,"start_character":44,"end_line":148,"end_character":51},"in_reply_to":"5f7c97a3_d065541f","updated":"2018-05-15 08:58:51.000000000","message":"Done","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        internal_ip_address \u003d str(port_forward.internal_ip_address)"},{"line_number":152,"context_line":"        internal_port \u003d port_forward.internal_port"},{"line_number":153,"context_line":"        external_port \u003d port_forward.external_port"},{"line_number":154,"context_line":"        chain_rule \u003d (self._get_pf_chain_name(port_forward[\u0027id\u0027]),"},{"line_number":155,"context_line":"                      \u0027-d %s/32 -p %s -m %s --dport %s \u0027"},{"line_number":156,"context_line":"                      \u0027-j DNAT --to-destination %s:%s\u0027 % ("},{"line_number":157,"context_line":"                          floating_ip_address, protocol, protocol,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_507944c5","line":154,"range":{"start_line":154,"start_character":22,"end_line":154,"end_character":65},"updated":"2018-05-15 08:01:33.000000000","message":"See L148","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        internal_ip_address \u003d str(port_forward.internal_ip_address)"},{"line_number":152,"context_line":"        internal_port \u003d port_forward.internal_port"},{"line_number":153,"context_line":"        external_port \u003d port_forward.external_port"},{"line_number":154,"context_line":"        chain_rule \u003d (self._get_pf_chain_name(port_forward[\u0027id\u0027]),"},{"line_number":155,"context_line":"                      \u0027-d %s/32 -p %s -m %s --dport %s \u0027"},{"line_number":156,"context_line":"                      \u0027-j DNAT --to-destination %s:%s\u0027 % ("},{"line_number":157,"context_line":"                          floating_ip_address, protocol, protocol,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_0765cf45","line":154,"range":{"start_line":154,"start_character":22,"end_line":154,"end_character":65},"in_reply_to":"5f7c97a3_507944c5","updated":"2018-05-15 08:58:51.000000000","message":"Done","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _rule_apply(self, iptables_manager, port_forwarding, rule_tag):"},{"line_number":164,"context_line":"        iptables_manager.ipv4[\u0027nat\u0027].clear_rules_by_tag(rule_tag)"},{"line_number":165,"context_line":"        if \u0027fip-pf\u0027 not in iptables_manager.ipv4[\u0027nat\u0027].chains:"},{"line_number":166,"context_line":"            self._install_default_rules(iptables_manager)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        for chain, rule in self._get_fip_rules("}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_b03c58e1","line":165,"range":{"start_line":165,"start_character":11,"end_line":165,"end_character":19},"updated":"2018-05-15 08:01:33.000000000","message":"Please see L145","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _rule_apply(self, iptables_manager, port_forwarding, rule_tag):"},{"line_number":164,"context_line":"        iptables_manager.ipv4[\u0027nat\u0027].clear_rules_by_tag(rule_tag)"},{"line_number":165,"context_line":"        if \u0027fip-pf\u0027 not in iptables_manager.ipv4[\u0027nat\u0027].chains:"},{"line_number":166,"context_line":"            self._install_default_rules(iptables_manager)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        for chain, rule in self._get_fip_rules("}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_c75a7781","line":165,"range":{"start_line":165,"start_character":11,"end_line":165,"end_character":19},"in_reply_to":"5f7c97a3_b03c58e1","updated":"2018-05-15 08:58:51.000000000","message":"Done","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"},{"line_number":181,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":182,"context_line":"        fip_statuses \u003d {}"},{"line_number":183,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":184,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":185,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_a46739e9","line":182,"range":{"start_line":182,"start_character":12,"end_line":182,"end_character":20},"updated":"2018-05-15 08:01:33.000000000","message":"Use `status` as the plural seems more common.\n\nLet\u0027s find a native English speaker to judge.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"},{"line_number":181,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":182,"context_line":"        fip_statuses \u003d {}"},{"line_number":183,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":184,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":185,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_a7017b3a","line":182,"range":{"start_line":182,"start_character":12,"end_line":182,"end_character":20},"in_reply_to":"5f7c97a3_a46739e9","updated":"2018-05-15 08:58:51.000000000","message":"hmm, I want to claim it will store some fip status..","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":196,"context_line":"                                interface_name, device)"},{"line_number":197,"context_line":"                    else:"},{"line_number":198,"context_line":"                        if not ha_port:"},{"line_number":199,"context_line":"                            device.addr.add(fip_cidr)"},{"line_number":200,"context_line":"                            ip_lib.send_ip_addr_adv_notif(namespace,"},{"line_number":201,"context_line":"                                                          interface_name,"},{"line_number":202,"context_line":"                                                          fip_ip)"},{"line_number":203,"context_line":"                        else:"},{"line_number":204,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":205,"context_line":"                        fip_statuses["},{"line_number":206,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":207,"context_line":"                except Exception:"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floating_ip_id] \u003d \u0027ERROR\u0027"},{"line_number":209,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_e429b136","line":206,"range":{"start_line":198,"start_character":0,"end_line":206,"end_character":70},"updated":"2018-05-15 08:01:33.000000000","message":"Seems you are adding the floating IP to the HA router related device. This beyond the extension behavior area.\n\nCan we make this simple, just install the iptables rules to the namespace no matter the device status or IP status?","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":196,"context_line":"                                interface_name, device)"},{"line_number":197,"context_line":"                    else:"},{"line_number":198,"context_line":"                        if not ha_port:"},{"line_number":199,"context_line":"                            device.addr.add(fip_cidr)"},{"line_number":200,"context_line":"                            ip_lib.send_ip_addr_adv_notif(namespace,"},{"line_number":201,"context_line":"                                                          interface_name,"},{"line_number":202,"context_line":"                                                          fip_ip)"},{"line_number":203,"context_line":"                        else:"},{"line_number":204,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":205,"context_line":"                        fip_statuses["},{"line_number":206,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":207,"context_line":"                except Exception:"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floating_ip_id] \u003d \u0027ERROR\u0027"},{"line_number":209,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_9a3e16b6","line":206,"range":{"start_line":198,"start_character":0,"end_line":206,"end_character":70},"in_reply_to":"5f7c97a3_e429b136","updated":"2018-05-15 08:58:51.000000000","message":"Yeah, I make this extension to manage the floating ip status and ip device configuration. Currently, the default router_info process will remove the fip address which not owned by this router, such as router[constrants.FloatingIP], so I have to merge the code every where. From my opinion, that\u0027s so bad. Then I think it\u0027s better to split these 2 processes, port forwarding extension maintain its own fips which port forwarding used. For the fip status, the reason is the fip had been actually configured on the qg port and bind to a router, I have no reason to leave it as \u0027Down\u0027.","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d4592bf236cbf90743adec1291967f25a0ea1788","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            ri.enable_keepalived()"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":220,"context_line":"            rule_tag \u003d \u0027fip_portforwarding-\u0027 + port_forwarding.id"},{"line_number":221,"context_line":"            self._rule_apply(iptables_manager, port_forwarding, rule_tag)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        iptables_manager.apply()"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_44b7453b","line":220,"range":{"start_line":220,"start_character":23,"end_line":220,"end_character":44},"updated":"2018-05-15 08:01:33.000000000","message":"make it constant","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ce98441c98439f6dd5b912a0d3b2683db58eaa0a","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            ri.enable_keepalived()"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":220,"context_line":"            rule_tag \u003d \u0027fip_portforwarding-\u0027 + port_forwarding.id"},{"line_number":221,"context_line":"            self._rule_apply(iptables_manager, port_forwarding, rule_tag)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        iptables_manager.apply()"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_279b2b18","line":220,"range":{"start_line":220,"start_character":23,"end_line":220,"end_character":44},"in_reply_to":"5f7c97a3_44b7453b","updated":"2018-05-15 08:58:51.000000000","message":"Done","commit_id":"832540c3f87bed3af46d4fa3c5eb73d2d745c0c9"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4ae34363482d281d5980b8f08c08c6d5047017b3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_c03361aa","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2018-05-31 08:59:43.000000000","message":"2018?","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"9d3c8851cdcfd1ab41a2d02a22e983d1ee3d6c12","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_c45cba7e","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"5f7c97a3_c03361aa","updated":"2018-05-31 09:36:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            self.managed_port_forwardings[port_forwarding.id] \u003d port_forwarding"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def get_port_forwarding(self, port_forwarding_id):"},{"line_number":64,"context_line":"        return self.managed_port_forwardings[port_forwarding_id]"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_c8dab6e7","line":64,"updated":"2018-05-29 14:16:34.000000000","message":"Are You sure that port_forwarding_id will always be in this dict? Maybe better is to use get() method called on dict?","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            self.managed_port_forwardings[port_forwarding.id] \u003d port_forwarding"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def get_port_forwarding(self, port_forwarding_id):"},{"line_number":64,"context_line":"        return self.managed_port_forwardings[port_forwarding_id]"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_e64b1aae","line":64,"in_reply_to":"5f7c97a3_c8dab6e7","updated":"2018-05-30 01:58:11.000000000","message":"Hmm, actually, this method is called by \"check_port_forwarding_changes\", and that method will be called by \"_process_update\" and \"check_local_port_forwardings\", both of them own the synchronized lock. If the first start, the logical will sync the full port forwarding resources towards each router by normal \u0027add_router\u0027/\u0027update_router\u0027 from l3 agent extension mechnism. Then if we create a single port forwrading, it will use the OVO rpc to call \"_process_create/update/delete\", and maintain them in local memory of agent host. Standing on this side, it would be not None in the dict. But you are right, the cases may be not enough. It\u0027s necessary to use get()","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":68,"context_line":"            if not self.managed_port_forwardings.get(port_forwarding.id, None):"},{"line_number":69,"context_line":"                continue"},{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_68f5a256","line":68,"updated":"2018-05-29 14:16:34.000000000","message":"You already have get_port_fowarding method so maybe You should used it here?","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":68,"context_line":"            if not self.managed_port_forwardings.get(port_forwarding.id, None):"},{"line_number":69,"context_line":"                continue"},{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_3c6835f3","line":68,"range":{"start_line":68,"start_character":73,"end_line":68,"end_character":77},"updated":"2018-05-30 17:36:27.000000000","message":"nit: the None can be removed because the default value of .get() is None if it is not specified.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":68,"context_line":"            if not self.managed_port_forwardings.get(port_forwarding.id, None):"},{"line_number":69,"context_line":"                continue"},{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_c0deeb6b","line":68,"range":{"start_line":68,"start_character":73,"end_line":68,"end_character":77},"in_reply_to":"5f7c97a3_3c6835f3","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def del_port_forwardings(self, port_forwardings):"},{"line_number":67,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":68,"context_line":"            if not self.managed_port_forwardings.get(port_forwarding.id, None):"},{"line_number":69,"context_line":"                continue"},{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_66cdca2e","line":68,"in_reply_to":"5f7c97a3_68f5a256","updated":"2018-05-30 01:58:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":72,"context_line":"                port_forwarding.id)"},{"line_number":73,"context_line":"            if len(self.fip_port_forwarding["},{"line_number":74,"context_line":"                       port_forwarding.floating_ip_id]) \u003d\u003d 0:"},{"line_number":75,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":76,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":77,"context_line":"                    port_forwarding.floating_ip_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_9c614908","line":74,"range":{"start_line":73,"start_character":12,"end_line":74,"end_character":61},"updated":"2018-05-30 17:36:27.000000000","message":"Nit: a slightly less verbose version:\n\n  if self.fip_port_forwarding[port_forwarding.floating_ip_id]:\n      ...","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":71,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":72,"context_line":"                port_forwarding.id)"},{"line_number":73,"context_line":"            if len(self.fip_port_forwarding["},{"line_number":74,"context_line":"                       port_forwarding.floating_ip_id]) \u003d\u003d 0:"},{"line_number":75,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":76,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":77,"context_line":"                    port_forwarding.floating_ip_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_00caa39f","line":74,"range":{"start_line":73,"start_character":12,"end_line":74,"end_character":61},"in_reply_to":"5f7c97a3_9c614908","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":76,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":77,"context_line":"                    port_forwarding.floating_ip_id)"},{"line_number":78,"context_line":"                if len(self.router_fip_mapping["},{"line_number":79,"context_line":"                           port_forwarding.router_id]) \u003d\u003d 0:"},{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_5c05f112","line":80,"range":{"start_line":78,"start_character":0,"end_line":80,"end_character":74},"updated":"2018-05-30 17:36:27.000000000","message":"Nit: a shorter version:\n\n  self.router_fip_mapping.pop(port_forwarding.router_id, None)","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":76,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":77,"context_line":"                    port_forwarding.floating_ip_id)"},{"line_number":78,"context_line":"                if len(self.router_fip_mapping["},{"line_number":79,"context_line":"                           port_forwarding.router_id]) \u003d\u003d 0:"},{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_003f0387","line":80,"range":{"start_line":78,"start_character":0,"end_line":80,"end_character":74},"in_reply_to":"5f7c97a3_5c05f112","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4ae34363482d281d5980b8f08c08c6d5047017b3","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                           port_forwarding.router_id]) \u003d\u003d 0:"},{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_80dec93b","line":82,"range":{"start_line":82,"start_character":19,"end_line":82,"end_character":21},"updated":"2018-05-31 08:59:43.000000000","message":"There are methods named with `port_forwardings` or `port_forwarding`,  and also some methods with name `_fp_`. Please you make these name consistent. It\u0027s better to use `port_forwarding` for all the methods.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"9d3c8851cdcfd1ab41a2d02a22e983d1ee3d6c12","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                           port_forwarding.router_id]) \u003d\u003d 0:"},{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_84d7a2bf","line":82,"range":{"start_line":82,"start_character":19,"end_line":82,"end_character":21},"in_reply_to":"5f7c97a3_80dec93b","updated":"2018-05-31 09:36:11.000000000","message":"Ha, just for shorter method name. Remove it.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"},{"line_number":86,"context_line":"        return self.fip_port_forwarding[fip_id]"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_686842f4","line":83,"range":{"start_line":83,"start_character":39,"end_line":83,"end_character":48},"updated":"2018-05-29 14:16:34.000000000","message":"same question here, are You sure that it will always be there?","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                    del self.router_fip_mapping[port_forwarding.router_id]"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_router_pf_fips(self, router_id):"},{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"},{"line_number":86,"context_line":"        return self.fip_port_forwarding[fip_id]"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_064976b5","line":83,"range":{"start_line":83,"start_character":39,"end_line":83,"end_character":48},"in_reply_to":"5f7c97a3_686842f4","updated":"2018-05-30 01:58:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"},{"line_number":86,"context_line":"        return self.fip_port_forwarding[fip_id]"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def set_fip_pf(self, fip_id, pf, router_id):"},{"line_number":89,"context_line":"        self.router_fip_mapping[router_id].add(fip_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_286ecaff","line":86,"updated":"2018-05-29 14:16:34.000000000","message":"and same here","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return self.router_fip_mapping[router_id]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_fip_pfs(self, fip_id):"},{"line_number":86,"context_line":"        return self.fip_port_forwarding[fip_id]"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def set_fip_pf(self, fip_id, pf, router_id):"},{"line_number":89,"context_line":"        self.router_fip_mapping[router_id].add(fip_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_c6ccde36","line":86,"in_reply_to":"5f7c97a3_286ecaff","updated":"2018-05-30 01:58:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def check_port_forwarding_changes(self, new_pf):"},{"line_number":102,"context_line":"        old_pf \u003d self.get_port_forwarding(new_pf.id)"},{"line_number":103,"context_line":"        if old_pf !\u003d new_pf:"},{"line_number":104,"context_line":"            return True"},{"line_number":105,"context_line":"        return False"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"class PortForwardingAgentExtension(l3_extension.L3AgentExtension):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_68512236","line":105,"range":{"start_line":103,"start_character":8,"end_line":105,"end_character":20},"updated":"2018-05-29 14:16:34.000000000","message":"can be just:\n    return old_pf !\u003d new_pf","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def check_port_forwarding_changes(self, new_pf):"},{"line_number":102,"context_line":"        old_pf \u003d self.get_port_forwarding(new_pf.id)"},{"line_number":103,"context_line":"        if old_pf !\u003d new_pf:"},{"line_number":104,"context_line":"            return True"},{"line_number":105,"context_line":"        return False"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"class PortForwardingAgentExtension(l3_extension.L3AgentExtension):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_266d9231","line":105,"range":{"start_line":103,"start_character":8,"end_line":105,"end_character":20},"in_reply_to":"5f7c97a3_68512236","updated":"2018-05-30 01:58:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                continue"},{"line_number":190,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":191,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"},{"line_number":192,"context_line":"            fip_cidr \u003d fip_ip + \u0027/32\u0027"},{"line_number":193,"context_line":"            if fip_cidr not in existing_cidrs:"},{"line_number":194,"context_line":"                try:"},{"line_number":195,"context_line":"                    if not is_distributed:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_eb0f6c2b","line":192,"updated":"2018-05-29 14:16:34.000000000","message":"You could do something like:\n\n    fip_cidr \u003d netaddr.IPNetwork(fip_ip)","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                continue"},{"line_number":190,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":191,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"},{"line_number":192,"context_line":"            fip_cidr \u003d fip_ip + \u0027/32\u0027"},{"line_number":193,"context_line":"            if fip_cidr not in existing_cidrs:"},{"line_number":194,"context_line":"                try:"},{"line_number":195,"context_line":"                    if not is_distributed:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_2656f25d","line":192,"in_reply_to":"5f7c97a3_eb0f6c2b","updated":"2018-05-30 01:58:11.000000000","message":"Right. I just think it\u0027s just a IP with 32 bit netmask before.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4ae34363482d281d5980b8f08c08c6d5047017b3","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                    if not is_distributed:"},{"line_number":196,"context_line":"                        fip_statuses["},{"line_number":197,"context_line":"                            port_forwarding.floating_ip_id] \u003d \\"},{"line_number":198,"context_line":"                            ri.add_floating_ip("},{"line_number":199,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":200,"context_line":"                                interface_name, device)"},{"line_number":201,"context_line":"                    else:"},{"line_number":202,"context_line":"                        if not ha_port:"},{"line_number":203,"context_line":"                            device.addr.add(fip_cidr)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_84cc8289","line":200,"range":{"start_line":198,"start_character":28,"end_line":200,"end_character":55},"updated":"2018-05-31 08:59:43.000000000","message":"See my comments Line 208.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4ae34363482d281d5980b8f08c08c6d5047017b3","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                                                          interface_name,"},{"line_number":206,"context_line":"                                                          fip_ip)"},{"line_number":207,"context_line":"                        else:"},{"line_number":208,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":209,"context_line":"                        fip_statuses["},{"line_number":210,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":211,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_00c39958","line":208,"range":{"start_line":208,"start_character":28,"end_line":208,"end_character":65},"updated":"2018-05-31 08:59:43.000000000","message":"Again, here should not call such method. This extension should only take care the iptables rules. No matter the IP is set or not, the rules can be installed there.\nSo if this is a bug from HA router, fix it in the proper way.\nIf this extension introduces such issue, then you should recheck the code logical to provent it.\n\nDoes this extension allow creating one floating IP port forwarings to  different router internal ports? Someting like this:\n1) floating_ip_1 is binding to `port_1 under router_1`;\n2) port_forwarding_1 is created for floating_ip_1 and point to `port2 under rouer_2`;\n2) port_forwarding_2 is created for floating_ip_1 and point to `port3 under rouer_3`;\nIf not, here should only take care the iptables rule. The IPs for router devices should not be configured here.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"9d3c8851cdcfd1ab41a2d02a22e983d1ee3d6c12","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                                                          interface_name,"},{"line_number":206,"context_line":"                                                          fip_ip)"},{"line_number":207,"context_line":"                        else:"},{"line_number":208,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":209,"context_line":"                        fip_statuses["},{"line_number":210,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":211,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_44274ac8","line":208,"range":{"start_line":208,"start_character":28,"end_line":208,"end_character":65},"in_reply_to":"5f7c97a3_00c39958","updated":"2018-05-31 09:36:11.000000000","message":"Why \"This extension should only take care the iptables rules\"? Who will take care the fip used by port forwardings? Coupling the code the exsiting L3 router info even we do not enable port forwarding extension? \n\nOne floating IP just can be installed by the centralized router. if we have a floatingIPA, and there is 1 port forwarding resource association, then the server select a router for it to install the floatingip, for example, Router X, then if the following port forwarding resources which want to based on floating IP A, it must be in Router X to do that.\n\nDNAT must be the centralized cases.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":209,"context_line":"                        fip_statuses["},{"line_number":210,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":211,"context_line":"                except Exception:"},{"line_number":212,"context_line":"                    fip_statuses[port_forwarding.floating_ip_id] \u003d \u0027ERROR\u0027"},{"line_number":213,"context_line":"            else:"},{"line_number":214,"context_line":"                if not ha_port:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_075ba2f5","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":32},"updated":"2018-05-30 17:36:27.000000000","message":"Perhaps you can catch a more specific exception? In addition, adding some logging of the exception would be nice.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"9d3c8851cdcfd1ab41a2d02a22e983d1ee3d6c12","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":209,"context_line":"                        fip_statuses["},{"line_number":210,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":211,"context_line":"                except Exception:"},{"line_number":212,"context_line":"                    fip_statuses[port_forwarding.floating_ip_id] \u003d \u0027ERROR\u0027"},{"line_number":213,"context_line":"            else:"},{"line_number":214,"context_line":"                if not ha_port:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_8469e225","line":211,"range":{"start_line":211,"start_character":23,"end_line":211,"end_character":32},"in_reply_to":"5f7c97a3_075ba2f5","updated":"2018-05-31 09:36:11.000000000","message":"I think any errors raise would be catch here, please see every router\u0027s \"add_floating_ip\" method. But the logging, it\u0027s necessary here. Thanks.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                                                  interface_name,"},{"line_number":217,"context_line":"                                                  fip_ip)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        if ha_port and ha_port["},{"line_number":220,"context_line":"            \u0027status\u0027] \u003d\u003d lib_constants.PORT_STATUS_ACTIVE:"},{"line_number":221,"context_line":"            ri.enable_keepalived()"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_2b2324a9","line":219,"updated":"2018-05-29 14:16:34.000000000","message":"nit: You can move this part to line below, IMO it would looks better","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                                                  interface_name,"},{"line_number":217,"context_line":"                                                  fip_ip)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        if ha_port and ha_port["},{"line_number":220,"context_line":"            \u0027status\u0027] \u003d\u003d lib_constants.PORT_STATUS_ACTIVE:"},{"line_number":221,"context_line":"            ri.enable_keepalived()"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_06709607","line":219,"in_reply_to":"5f7c97a3_2b2324a9","updated":"2018-05-30 01:58:11.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"26317c5ac30efe714f3daa475666b0454551bc3c","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        if (is_distributed and"},{"line_number":261,"context_line":"                agent_mode in [lib_constants.L3_AGENT_MODE_DVR_NO_EXTERNAL,"},{"line_number":262,"context_line":"                               lib_constants.L3_AGENT_MODE_DVR]):"},{"line_number":263,"context_line":"            # just support centrilized cases"},{"line_number":264,"context_line":"            return False"},{"line_number":265,"context_line":"        return True"},{"line_number":266,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_8c8a7261","line":263,"range":{"start_line":263,"start_character":27,"end_line":263,"end_character":38},"updated":"2018-05-30 21:31:19.000000000","message":"nit: centralized","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        if (is_distributed and"},{"line_number":261,"context_line":"                agent_mode in [lib_constants.L3_AGENT_MODE_DVR_NO_EXTERNAL,"},{"line_number":262,"context_line":"                               lib_constants.L3_AGENT_MODE_DVR]):"},{"line_number":263,"context_line":"            # just support centrilized cases"},{"line_number":264,"context_line":"            return False"},{"line_number":265,"context_line":"        return True"},{"line_number":266,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_e047671c","line":263,"range":{"start_line":263,"start_character":27,"end_line":263,"end_character":38},"in_reply_to":"5f7c97a3_8c8a7261","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    def _sync_and_remove_fip(self, context, fip_id_cidrs, device, ri):"},{"line_number":332,"context_line":"        if not fip_id_cidrs:"},{"line_number":333,"context_line":"            return"},{"line_number":334,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":335,"context_line":"        fip_ids \u003d [item[0] for item in fip_id_cidrs]"},{"line_number":336,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":337,"context_line":"                                          filter_kwargs\u003d{"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_47a67ac3","line":334,"range":{"start_line":334,"start_character":64,"end_line":334,"end_character":68},"updated":"2018-05-30 17:36:27.000000000","message":"Nit: None can be removed.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    def _sync_and_remove_fip(self, context, fip_id_cidrs, device, ri):"},{"line_number":332,"context_line":"        if not fip_id_cidrs:"},{"line_number":333,"context_line":"            return"},{"line_number":334,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":335,"context_line":"        fip_ids \u003d [item[0] for item in fip_id_cidrs]"},{"line_number":336,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":337,"context_line":"                                          filter_kwargs\u003d{"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_805233dd","line":334,"range":{"start_line":334,"start_character":64,"end_line":334,"end_character":68},"in_reply_to":"5f7c97a3_47a67ac3","updated":"2018-05-31 02:25:05.000000000","message":"Done","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"26317c5ac30efe714f3daa475666b0454551bc3c","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            self.mapping.clear_by_fip(fip_id, ri.router_id)"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def _get_router_info(self, router_id):"},{"line_number":359,"context_line":"        router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":360,"context_line":"        if router_info:"},{"line_number":361,"context_line":"            return router_info"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _get_pf_chain_name(self, pf_id):"},{"line_number":364,"context_line":"        chain_name \u003d PORT_FORWARDING_CHAIN_PREFIX + pf_id"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_cc3dcabb","line":361,"range":{"start_line":359,"start_character":0,"end_line":361,"end_character":30},"updated":"2018-05-30 21:31:19.000000000","message":"The method you are calling here (https://github.com/openstack/neutron/blob/master/neutron/agent/l3/l3_agent_extension_api.py#L70) returns None anyway. So these 3 lines can be reduced to just:\n\nreturn self.agent_api.get_router_info(router_id)\n\nIn fact, the entire method can be eliminated and you can call self.agent_api.get_router_info(router_id) directly from where you call this one.\n\nAn alternative is what they do in the QoS extension (https://github.com/openstack/neutron/blob/master/neutron/agent/l3/extensions/qos/base.py#L164), where a message is logged if the router is not found","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":356,"context_line":"            self.mapping.clear_by_fip(fip_id, ri.router_id)"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def _get_router_info(self, router_id):"},{"line_number":359,"context_line":"        router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":360,"context_line":"        if router_info:"},{"line_number":361,"context_line":"            return router_info"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _get_pf_chain_name(self, pf_id):"},{"line_number":364,"context_line":"        chain_name \u003d PORT_FORWARDING_CHAIN_PREFIX + pf_id"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_806b1383","line":361,"range":{"start_line":359,"start_character":0,"end_line":361,"end_character":30},"in_reply_to":"5f7c97a3_cc3dcabb","updated":"2018-05-31 02:25:05.000000000","message":"Thanks, Miguel. And the log is necessary. I will rework here.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _get_pf_chain_name(self, pf_id):"},{"line_number":364,"context_line":"        chain_name \u003d PORT_FORWARDING_CHAIN_PREFIX + pf_id"},{"line_number":365,"context_line":"        return chain_name[:11]"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    def _install_default_rules(self, iptables_manager):"},{"line_number":368,"context_line":"        default_rule \u003d \u0027-j %s-%s\u0027 % (iptables_manager.wrap_name,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_47943a37","line":365,"range":{"start_line":365,"start_character":27,"end_line":365,"end_character":29},"updated":"2018-05-30 17:36:27.000000000","message":"Could we use this constant instead: MAX_CHAIN_LEN_WRAP","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c502a28f4b18700cf23ef96e82a61608ed27c7fd","unresolved":false,"context_lines":[{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _get_pf_chain_name(self, pf_id):"},{"line_number":364,"context_line":"        chain_name \u003d PORT_FORWARDING_CHAIN_PREFIX + pf_id"},{"line_number":365,"context_line":"        return chain_name[:11]"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    def _install_default_rules(self, iptables_manager):"},{"line_number":368,"context_line":"        default_rule \u003d \u0027-j %s-%s\u0027 % (iptables_manager.wrap_name,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_603357ac","line":365,"range":{"start_line":365,"start_character":27,"end_line":365,"end_character":29},"in_reply_to":"5f7c97a3_47943a37","updated":"2018-05-31 02:25:05.000000000","message":"Yeah, thanks, actually, this part is from iptables_fw.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":73,"context_line":"            if not self.get_port_forwarding(port_forwarding.id):"},{"line_number":74,"context_line":"                continue"},{"line_number":75,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":76,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":77,"context_line":"                port_forwarding.id)"},{"line_number":78,"context_line":"            if not self.fip_port_forwarding[port_forwarding.floating_ip_id]:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_74b638df","line":75,"updated":"2018-06-06 22:12:38.000000000","message":"Nit: Why not pop()?","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":73,"context_line":"            if not self.get_port_forwarding(port_forwarding.id):"},{"line_number":74,"context_line":"                continue"},{"line_number":75,"context_line":"            del self.managed_port_forwardings[port_forwarding.id]"},{"line_number":76,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":77,"context_line":"                port_forwarding.id)"},{"line_number":78,"context_line":"            if not self.fip_port_forwarding[port_forwarding.floating_ip_id]:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_40cd72b5","line":75,"in_reply_to":"5f7c97a3_74b638df","updated":"2018-06-07 07:15:39.000000000","message":"Done","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":77,"context_line":"                port_forwarding.id)"},{"line_number":78,"context_line":"            if not self.fip_port_forwarding[port_forwarding.floating_ip_id]:"},{"line_number":79,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":80,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":81,"context_line":"                    port_forwarding.floating_ip_id)"},{"line_number":82,"context_line":"                if not self.router_fip_mapping[port_forwarding.router_id]:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_34b0c0dd","line":79,"updated":"2018-06-06 22:12:38.000000000","message":"Ditto","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            self.fip_port_forwarding[port_forwarding.floating_ip_id].remove("},{"line_number":77,"context_line":"                port_forwarding.id)"},{"line_number":78,"context_line":"            if not self.fip_port_forwarding[port_forwarding.floating_ip_id]:"},{"line_number":79,"context_line":"                del self.fip_port_forwarding[port_forwarding.floating_ip_id]"},{"line_number":80,"context_line":"                self.router_fip_mapping[port_forwarding.router_id].remove("},{"line_number":81,"context_line":"                    port_forwarding.floating_ip_id)"},{"line_number":82,"context_line":"                if not self.router_fip_mapping[port_forwarding.router_id]:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_e0c35e89","line":79,"in_reply_to":"5f7c97a3_34b0c0dd","updated":"2018-06-07 07:15:39.000000000","message":"Done","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def _process_create(self, port_forwardings, ri, interface_name, namespace,"},{"line_number":174,"context_line":"                        iptables_manager):"},{"line_number":175,"context_line":"        if not port_forwardings:"},{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_7435d8a7","line":175,"updated":"2018-06-06 22:12:38.000000000","message":"Similar comment as in L290","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def _process_create(self, port_forwardings, ri, interface_name, namespace,"},{"line_number":174,"context_line":"                        iptables_manager):"},{"line_number":175,"context_line":"        if not port_forwardings:"},{"line_number":176,"context_line":"            return"},{"line_number":177,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_c0ec22bd","line":175,"in_reply_to":"5f7c97a3_7435d8a7","updated":"2018-06-07 07:15:39.000000000","message":"hmmm, thanks miguel for this. I just want to make the code stronger. As this function will be called by 2 ways, such as, generic router_create/router_update and OVO rpc \"PortForwarding\" resource, which will be sent by server side. But yeah, I agree with u, I follow u now. :)","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":181,"context_line":"        fip_statuses \u003d {}"},{"line_number":182,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":183,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":184,"context_line":"                continue"},{"line_number":185,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":186,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_f471e878","line":183,"updated":"2018-06-06 22:12:38.000000000","message":"Didn\u0027t you check this already in L389? Why check it again here?","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"4404b3adac3d7f1d3c4241295a8a4540d457c904","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":181,"context_line":"        fip_statuses \u003d {}"},{"line_number":182,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":183,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":184,"context_line":"                continue"},{"line_number":185,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":186,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_8fa15f98","line":183,"in_reply_to":"5f7c97a3_ca52fcde","updated":"2018-06-07 21:17:50.000000000","message":"Thanks for the detailed explanation! Dumb me gets it now ;-) Let\u0027s keep it this way.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY, None)"},{"line_number":181,"context_line":"        fip_statuses \u003d {}"},{"line_number":182,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":183,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":184,"context_line":"                continue"},{"line_number":185,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":186,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_ca52fcde","line":183,"in_reply_to":"5f7c97a3_f471e878","updated":"2018-06-07 07:15:39.000000000","message":"This block is for floatingip processing. This function is called by 2 places, 1 is \"check_local_port_forwardings\" by router_create/router_update, the other is \"_process_port_forwarding_event\", these 2 functions will called in race condition. If we create a port forwarding resource and update a router at the same time in server side, the server will send out 2 rpcs, 1 is \u0027router_update\u0027(which will call \"check_local_port_forwarding\"),the other is OVO PortForwarding resource with Created event. In this extension, the 2 rpc will be locked by \u0027synchronized lock\u0027(see functions \"_handle_notification\" and \"add/update_router\"). For this case, we assumpt the update_router arrived first, the OVO rpc block at this time, then the process of \u0027check_local_port_forwarding\u0027 figure out the new created port forwarding in L393, and call _process_create, at this time the check in L183 will do the whole thing for this new port forwarding resource, including fip addition if the fip is new, and ipatbles rules. OK, \u0027update_router\u0027 finish, the port forwarding resouces OVO rpc continue to process, it will call \"_process_create\" again, for not process the fip again, I add this check in L183. the new created port forwarding won\u0027t do the most of work which had been done in the last \"update_router\" rpc, except restart keepalived process for now. Sorry, miguel, this description may looks very tedious, but it is true that the situation exists. And the agent side race condition is hard to handle than server side. My though about these 2 rpc, \"router_add/update\" rpc, I treat it like a maintainer role, maintain the associated port forwarding resources, so I create a full sync function in server side. the OVO port forwarding resource event, I treat it as the new things(new port forwarding resources) to process. Please feel free to correct.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                try:"},{"line_number":190,"context_line":"                    if not is_distributed:"},{"line_number":191,"context_line":"                        fip_statuses["},{"line_number":192,"context_line":"                            port_forwarding.floating_ip_id] \u003d \\"},{"line_number":193,"context_line":"                            ri.add_floating_ip("},{"line_number":194,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":195,"context_line":"                                interface_name, device)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_b40050ad","line":192,"range":{"start_line":192,"start_character":61,"end_line":192,"end_character":63},"updated":"2018-06-06 22:12:38.000000000","message":"I would use ( to extend the line. That is the preferred way in OpenStack","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                try:"},{"line_number":190,"context_line":"                    if not is_distributed:"},{"line_number":191,"context_line":"                        fip_statuses["},{"line_number":192,"context_line":"                            port_forwarding.floating_ip_id] \u003d \\"},{"line_number":193,"context_line":"                            ri.add_floating_ip("},{"line_number":194,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":195,"context_line":"                                interface_name, device)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_c0b8a212","line":192,"range":{"start_line":192,"start_character":61,"end_line":192,"end_character":63},"in_reply_to":"5f7c97a3_b40050ad","updated":"2018-06-07 07:15:39.000000000","message":"Thanks, Miguel, will rework here. :)","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4bbc3f32f76f515b1d5e638c75204d3a0ef24d89","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                    if not is_distributed:"},{"line_number":191,"context_line":"                        fip_statuses["},{"line_number":192,"context_line":"                            port_forwarding.floating_ip_id] \u003d \\"},{"line_number":193,"context_line":"                            ri.add_floating_ip("},{"line_number":194,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":195,"context_line":"                                interface_name, device)"},{"line_number":196,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_e0011e3b","line":193,"range":{"start_line":193,"start_character":31,"end_line":193,"end_character":46},"updated":"2018-06-07 03:23:43.000000000","message":"Accoring to the discuss in `neutron server` side patch, because of the race condition, the floating IP may exist in two different router namespaces if this extension handle the IP here?","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                    if not is_distributed:"},{"line_number":191,"context_line":"                        fip_statuses["},{"line_number":192,"context_line":"                            port_forwarding.floating_ip_id] \u003d \\"},{"line_number":193,"context_line":"                            ri.add_floating_ip("},{"line_number":194,"context_line":"                                {\u0027floating_ip_address\u0027: fip_ip},"},{"line_number":195,"context_line":"                                interface_name, device)"},{"line_number":196,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_742393a8","line":193,"range":{"start_line":193,"start_character":31,"end_line":193,"end_character":46},"in_reply_to":"5f7c97a3_e0011e3b","updated":"2018-06-07 07:15:39.000000000","message":"Your cases, I will work on the valid ones. Every process(router_update/router_create/delete_fip_for_portforwarding) will get the fresh db info from server side. Any suggests for the correct way to process the fip?","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4bbc3f32f76f515b1d5e638c75204d3a0ef24d89","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                                                          interface_name,"},{"line_number":201,"context_line":"                                                          fip_ip)"},{"line_number":202,"context_line":"                        else:"},{"line_number":203,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":204,"context_line":"                        fip_statuses["},{"line_number":205,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_6093ce01","line":203,"range":{"start_line":203,"start_character":31,"end_line":203,"end_character":39},"updated":"2018-06-07 03:23:43.000000000","message":"ditto","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                                                          interface_name,"},{"line_number":201,"context_line":"                                                          fip_ip)"},{"line_number":202,"context_line":"                        else:"},{"line_number":203,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":204,"context_line":"                        fip_statuses["},{"line_number":205,"context_line":"                            port_forwarding.floating_ip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_34351bdc","line":203,"range":{"start_line":203,"start_character":31,"end_line":203,"end_character":39},"in_reply_to":"5f7c97a3_6093ce01","updated":"2018-06-07 07:15:39.000000000","message":"like above.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def _check_if_need_process(self, ri):"},{"line_number":253,"context_line":"        if not ri or not ri.get_ex_gw_port():"},{"line_number":254,"context_line":"            # agent not hold the router. pass"},{"line_number":255,"context_line":"            # This router doesn\u0027t own a gw port. pass"},{"line_number":256,"context_line":"            return False"},{"line_number":257,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_51f46ef1","line":254,"range":{"start_line":254,"start_character":20,"end_line":254,"end_character":23},"updated":"2018-06-06 22:12:38.000000000","message":"Nit: doesn\u0027t","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def _check_if_need_process(self, ri):"},{"line_number":253,"context_line":"        if not ri or not ri.get_ex_gw_port():"},{"line_number":254,"context_line":"            # agent not hold the router. pass"},{"line_number":255,"context_line":"            # This router doesn\u0027t own a gw port. pass"},{"line_number":256,"context_line":"            return False"},{"line_number":257,"context_line":"        is_distributed \u003d ri.router.get(\u0027distributed\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_80386a9f","line":254,"range":{"start_line":254,"start_character":20,"end_line":254,"end_character":23},"in_reply_to":"5f7c97a3_51f46ef1","updated":"2018-06-07 07:15:39.000000000","message":"Done","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def _process_update(self, port_forwardings, iptables_manager,"},{"line_number":289,"context_line":"                        interface_name, namespace):"},{"line_number":290,"context_line":"        if not port_forwardings:"},{"line_number":291,"context_line":"            return"},{"line_number":292,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":293,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_34a3e002","line":290,"updated":"2018-06-06 22:12:38.000000000","message":"You check this in line 401. Why do it again here? Alternatively, you can remove the if in line 401 and the call to _store_local in 404. You do the check here and call _store_local at the end of this method. That would simplify the method in L375","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def _process_update(self, port_forwardings, iptables_manager,"},{"line_number":289,"context_line":"                        interface_name, namespace):"},{"line_number":290,"context_line":"        if not port_forwardings:"},{"line_number":291,"context_line":"            return"},{"line_number":292,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":293,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_ea66d8bb","line":290,"in_reply_to":"5f7c97a3_34a3e002","updated":"2018-06-07 07:15:39.000000000","message":"Thanks, Miguel. I get u, I know this could enhance. Let me try to fix it. :)","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _process_delete(self, context, port_forwardings, ri, interface_name,"},{"line_number":309,"context_line":"                        namespace, iptables_manager):"},{"line_number":310,"context_line":"        if not port_forwardings:"},{"line_number":311,"context_line":"            return"},{"line_number":312,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":313,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_d4b14c46","line":310,"updated":"2018-06-06 22:12:38.000000000","message":"Similar comment as in L290","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _process_delete(self, context, port_forwardings, ri, interface_name,"},{"line_number":309,"context_line":"                        namespace, iptables_manager):"},{"line_number":310,"context_line":"        if not port_forwardings:"},{"line_number":311,"context_line":"            return"},{"line_number":312,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dnamespace)"},{"line_number":313,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_aa06a0cc","line":310,"in_reply_to":"5f7c97a3_d4b14c46","updated":"2018-06-07 07:15:39.000000000","message":"Agree","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        self._sync_and_remove_fip(context, fip_id_cidrs, device, ri)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _sync_and_remove_fip(self, context, fip_id_cidrs, device, ri):"},{"line_number":331,"context_line":"        if not fip_id_cidrs:"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY)"},{"line_number":334,"context_line":"        fip_ids \u003d [item[0] for item in fip_id_cidrs]"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_347c4071","line":331,"updated":"2018-06-06 22:12:38.000000000","message":"Similar comment as in L290","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        self._sync_and_remove_fip(context, fip_id_cidrs, device, ri)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def _sync_and_remove_fip(self, context, fip_id_cidrs, device, ri):"},{"line_number":331,"context_line":"        if not fip_id_cidrs:"},{"line_number":332,"context_line":"            return"},{"line_number":333,"context_line":"        ha_port \u003d ri.router.get(lib_constants.HA_INTERFACE_KEY)"},{"line_number":334,"context_line":"        fip_ids \u003d [item[0] for item in fip_id_cidrs]"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_4a0d8ce6","line":331,"in_reply_to":"5f7c97a3_347c4071","updated":"2018-06-07 07:15:39.000000000","message":"Oh, this is not same with L290, it\u0027s fip_id_cidrs, not port_forwardings.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        iptables_manager.ipv4[\u0027nat\u0027].add_rule(\u0027PREROUTING\u0027, default_rule)"},{"line_number":373,"context_line":"        iptables_manager.apply()"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def check_local_port_forwardings(self, context, ri, sync_mappings):"},{"line_number":376,"context_line":"        fip_ids \u003d [id[0] for id in sync_mappings["},{"line_number":377,"context_line":"            \u0027floatingip_port_forwarding_mapping\u0027]]"},{"line_number":378,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_313f7288","line":375,"range":{"start_line":375,"start_character":8,"end_line":375,"end_character":36},"updated":"2018-06-06 22:12:38.000000000","message":"This is where you actually process the port forwardings, once you know it is managed by the local agent. Why not call this method _process_local_forwardings","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        iptables_manager.ipv4[\u0027nat\u0027].add_rule(\u0027PREROUTING\u0027, default_rule)"},{"line_number":373,"context_line":"        iptables_manager.apply()"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def check_local_port_forwardings(self, context, ri, sync_mappings):"},{"line_number":376,"context_line":"        fip_ids \u003d [id[0] for id in sync_mappings["},{"line_number":377,"context_line":"            \u0027floatingip_port_forwarding_mapping\u0027]]"},{"line_number":378,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_6a85e806","line":375,"range":{"start_line":375,"start_character":8,"end_line":375,"end_character":36},"in_reply_to":"5f7c97a3_313f7288","updated":"2018-06-07 07:15:39.000000000","message":"Hmmm, Miguel, I\u0027m afraid that we cover the whole cases, and very need your suggest about this. Please read the comment I left in L183. I treat this process like a maintainer role. But I\u0027m Ok with the new name. So I hope that you could read the comment first and consider my thought, then we can talk in deep level. Thank you.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"4404b3adac3d7f1d3c4241295a8a4540d457c904","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        iptables_manager.ipv4[\u0027nat\u0027].add_rule(\u0027PREROUTING\u0027, default_rule)"},{"line_number":373,"context_line":"        iptables_manager.apply()"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def check_local_port_forwardings(self, context, ri, sync_mappings):"},{"line_number":376,"context_line":"        fip_ids \u003d [id[0] for id in sync_mappings["},{"line_number":377,"context_line":"            \u0027floatingip_port_forwarding_mapping\u0027]]"},{"line_number":378,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_ef01f36b","line":375,"range":{"start_line":375,"start_character":8,"end_line":375,"end_character":36},"in_reply_to":"5f7c97a3_6a85e806","updated":"2018-06-07 21:17:50.000000000","message":"I understand your explanation. Thanks!. Don\u0027t change it","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    def process_port_forwarding(self, context, data):"},{"line_number":415,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":416,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":417,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_8ebf415f","line":416,"updated":"2018-06-06 22:12:38.000000000","message":"What if ri is None. _get_router_info can return None. In fact, _check_if_need process, which you call in the next line, checks if ri is None","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    def process_port_forwarding(self, context, data):"},{"line_number":415,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"},{"line_number":416,"context_line":"        mappings \u003d ri.port_forwarding_mappings"},{"line_number":417,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_2aca9045","line":416,"in_reply_to":"5f7c97a3_8ebf415f","updated":"2018-06-07 07:15:39.000000000","message":"Oh, yeah. Correct. I rework here. Thanks, Miguel.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":423,"context_line":"    def add_router(self, context, data):"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_9161a6ab","line":420,"updated":"2018-06-06 22:12:38.000000000","message":"See my comment to L375","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        if not self._check_if_need_process(ri) or not mappings:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        self.check_local_port_forwardings(context, ri, mappings)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    @lockutils.synchronized(\u0027port-forwarding\u0027)"},{"line_number":423,"context_line":"    def add_router(self, context, data):"}],"source_content_type":"text/x-python","patch_set":18,"id":"5f7c97a3_2a77f03d","line":420,"in_reply_to":"5f7c97a3_9161a6ab","updated":"2018-06-07 07:15:39.000000000","message":"Yeah, need you suggestion, Miguel. :)","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            router_id_1: set(fip_id_3, fip_id_4)"},{"line_number":54,"context_line":"        }"},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.router_fip_mapping \u003d collections.defaultdict(set)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def set_port_forwardings(self, port_forwardings):"},{"line_number":59,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_898b6d1c","line":56,"range":{"start_line":56,"start_character":8,"end_line":56,"end_character":31},"updated":"2018-07-17 23:26:15.000000000","message":"where is this used other than to set and clear it up?","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            router_id_1: set(fip_id_3, fip_id_4)"},{"line_number":54,"context_line":"        }"},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.router_fip_mapping \u003d collections.defaultdict(set)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def set_port_forwardings(self, port_forwardings):"},{"line_number":59,"context_line":"        for port_forwarding in port_forwardings:"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_2fd5791a","line":56,"range":{"start_line":56,"start_character":8,"end_line":56,"end_character":31},"in_reply_to":"5f7c97a3_898b6d1c","updated":"2018-07-18 03:21:21.000000000","message":"Honestly, it seems not used by any code now, but I just want to cache the router and fip mapping as we just know the fip-pf mapping, we can just treat it as a copy in memory from server side, so you suggests that remove it? Hmmm..","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        internal_port \u003d port_forward.internal_port"},{"line_number":150,"context_line":"        external_port \u003d port_forward.external_port"},{"line_number":151,"context_line":"        chain_rule \u003d (pf_chain_name,"},{"line_number":152,"context_line":"                      \u0027-d %s/32 -p %s -m %s --dport %s \u0027"},{"line_number":153,"context_line":"                      \u0027-j DNAT --to-destination %s:%s\u0027 % ("},{"line_number":154,"context_line":"                          floating_ip_address, protocol, protocol,"},{"line_number":155,"context_line":"                          external_port, internal_ip_address,"},{"line_number":156,"context_line":"                          internal_port))"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_41a3efb1","line":153,"range":{"start_line":152,"start_character":0,"end_line":153,"end_character":58},"updated":"2018-07-17 23:26:15.000000000","message":"IIUC, this rule covers inbound traffic to the internal port. Don\u0027t we need another rule for outbound traffic from the port to the outside world?","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        internal_port \u003d port_forward.internal_port"},{"line_number":150,"context_line":"        external_port \u003d port_forward.external_port"},{"line_number":151,"context_line":"        chain_rule \u003d (pf_chain_name,"},{"line_number":152,"context_line":"                      \u0027-d %s/32 -p %s -m %s --dport %s \u0027"},{"line_number":153,"context_line":"                      \u0027-j DNAT --to-destination %s:%s\u0027 % ("},{"line_number":154,"context_line":"                          floating_ip_address, protocol, protocol,"},{"line_number":155,"context_line":"                          external_port, internal_ip_address,"},{"line_number":156,"context_line":"                          internal_port))"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_b2149243","line":153,"range":{"start_line":152,"start_character":0,"end_line":153,"end_character":58},"in_reply_to":"5f7c97a3_41a3efb1","updated":"2018-07-18 03:21:21.000000000","message":"As neutron namespace already enable nf_conntrack kernel module, so it will store the socket connection in conntrack, if the outgoing traffic arrives the router, it will check the connection and return the packet to client side(outside) based on the existing connection, because it store the traffic as src_ip:sport-dst_ip:dport during the ingress traffic arrived. So I think we don\u0027t need other rules. It\u0027s my thought, please feel free to correct. :)","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":296,"context_line":"                continue"},{"line_number":297,"context_line":"            current_chain \u003d self._get_port_forwarding_chain_name("},{"line_number":298,"context_line":"                port_forwarding.id)"},{"line_number":299,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].empty_chain(current_chain)"},{"line_number":300,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].remove_chain(current_chain)"},{"line_number":301,"context_line":"            ori_pf \u003d self.mapping.managed_port_forwardings[port_forwarding.id]"},{"line_number":302,"context_line":"            device.delete_socket_conntrack_state("}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_016e57c7","line":299,"range":{"start_line":299,"start_character":12,"end_line":299,"end_character":67},"updated":"2018-07-17 23:26:15.000000000","message":"Do you need to empty the chain first? Please look at https://github.com/openstack/neutron/blob/master/neutron/agent/linux/iptables_manager.py#L172-L173","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":296,"context_line":"                continue"},{"line_number":297,"context_line":"            current_chain \u003d self._get_port_forwarding_chain_name("},{"line_number":298,"context_line":"                port_forwarding.id)"},{"line_number":299,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].empty_chain(current_chain)"},{"line_number":300,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].remove_chain(current_chain)"},{"line_number":301,"context_line":"            ori_pf \u003d self.mapping.managed_port_forwardings[port_forwarding.id]"},{"line_number":302,"context_line":"            device.delete_socket_conntrack_state("}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_72cfda8a","line":299,"range":{"start_line":299,"start_character":12,"end_line":299,"end_character":67},"in_reply_to":"5f7c97a3_016e57c7","updated":"2018-07-18 03:21:21.000000000","message":"Let me show u a sample here. :). Then it would be clear.\nFor better iptables rules management, I introduces a basic chain from PREROUTING(fip-pf). And each port forwarding resource will own a sperate chain(such as pf-\u003cPF_ID\u003e, and cut the whole length is 11). So the real iptables rules would be like:\n\n-P PREROUTING ACCEPT\n-N pf-pf-id1\n-N pf-pf-id2\n-A PREROUTING -j fip-pf\n-A fip-pf -j pf-pf-id1\n-A fip-pf -j pf-pf-id2\n-A pf-pf-id1 balabala DNAT\n-A pf-pf-id2 balabala DNAT\n\nFor example, here the cleaned chain is pf-pf-id1 which only owns 1 rule, we just delete the single rule in it. Each pf-\u003cpf-id\u003e chain own only 1 rule. If there is still some established traffics, it won\u0027t be effected until L302-L303.\n\nBut you are right, it\u0027s good to just remove it. Thanks","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":316,"context_line":"            current_chain \u003d self._get_port_forwarding_chain_name("},{"line_number":317,"context_line":"                port_forwarding.id)"},{"line_number":318,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].empty_chain(current_chain)"},{"line_number":319,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].remove_chain(current_chain)"},{"line_number":320,"context_line":"            fip_address \u003d str(port_forwarding.floating_ip_address)"},{"line_number":321,"context_line":"            device.delete_socket_conntrack_state("}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_411c4f76","line":318,"updated":"2018-07-17 23:26:15.000000000","message":"Same question as in L299","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":316,"context_line":"            current_chain \u003d self._get_port_forwarding_chain_name("},{"line_number":317,"context_line":"                port_forwarding.id)"},{"line_number":318,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].empty_chain(current_chain)"},{"line_number":319,"context_line":"            iptables_manager.ipv4[\u0027nat\u0027].remove_chain(current_chain)"},{"line_number":320,"context_line":"            fip_address \u003d str(port_forwarding.floating_ip_address)"},{"line_number":321,"context_line":"            device.delete_socket_conntrack_state("}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_d26cae6c","line":318,"in_reply_to":"5f7c97a3_411c4f76","updated":"2018-07-18 03:21:21.000000000","message":"Yeah, you are right, thanks Miguel","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":339,"context_line":"                                          filter_kwargs\u003d{"},{"line_number":340,"context_line":"                                              \u0027floatingip_id\u0027: fip_ids})"},{"line_number":341,"context_line":"        exist_fips \u003d collections.defaultdict(set)"},{"line_number":342,"context_line":"        fip_status \u003d {}"},{"line_number":343,"context_line":"        for pf in pfs:"},{"line_number":344,"context_line":"            exist_fips[pf.floatingip_id].add(pf.id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_89bdadd8","line":341,"range":{"start_line":341,"start_character":8,"end_line":341,"end_character":18},"updated":"2018-07-17 23:26:15.000000000","message":"can\u0027t this just be a set of fips ids?","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":339,"context_line":"                                          filter_kwargs\u003d{"},{"line_number":340,"context_line":"                                              \u0027floatingip_id\u0027: fip_ids})"},{"line_number":341,"context_line":"        exist_fips \u003d collections.defaultdict(set)"},{"line_number":342,"context_line":"        fip_status \u003d {}"},{"line_number":343,"context_line":"        for pf in pfs:"},{"line_number":344,"context_line":"            exist_fips[pf.floatingip_id].add(pf.id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_b2d252fd","line":341,"range":{"start_line":341,"start_character":8,"end_line":341,"end_character":18},"in_reply_to":"5f7c97a3_89bdadd8","updated":"2018-07-18 03:21:21.000000000","message":"Yeah, nice catch. Thank you","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":390,"context_line":"        current_pfs \u003d set()"},{"line_number":391,"context_line":"        for pf in pfs:"},{"line_number":392,"context_line":"            if pf.id in self.mapping.managed_port_forwardings:"},{"line_number":393,"context_line":"                if self.mapping.check_port_forwarding_changes(pf):"},{"line_number":394,"context_line":"                    updated_pfs.append(pf)"},{"line_number":395,"context_line":"            else:"},{"line_number":396,"context_line":"                new_pfs.append(pf)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_5de21404","line":393,"range":{"start_line":393,"start_character":16,"end_line":393,"end_character":66},"updated":"2018-07-17 23:26:15.000000000","message":"Why check this here if it is going to be checked again in L295 above?","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":390,"context_line":"        current_pfs \u003d set()"},{"line_number":391,"context_line":"        for pf in pfs:"},{"line_number":392,"context_line":"            if pf.id in self.mapping.managed_port_forwardings:"},{"line_number":393,"context_line":"                if self.mapping.check_port_forwarding_changes(pf):"},{"line_number":394,"context_line":"                    updated_pfs.append(pf)"},{"line_number":395,"context_line":"            else:"},{"line_number":396,"context_line":"                new_pfs.append(pf)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_9d85e75b","line":393,"range":{"start_line":393,"start_character":16,"end_line":393,"end_character":66},"in_reply_to":"5f7c97a3_5de21404","updated":"2018-07-18 03:21:21.000000000","message":"As this func just called by router_update/create, L295 could be called by 2 ways, 1 is generic router_update/create, the other is OVO rpc for single port forwarding process. I copy the explain from previous patchset.:). I will add some comments here. Thanks \n\n \u003e This block is for floatingip processing. This function is called by\n \u003e 2 places, 1 is \"check_local_port_forwardings\" by router_create/router_update,\n \u003e the other is \"_process_port_forwarding_event\", these 2 functions\n \u003e will called in race condition. If we create a port forwarding\n \u003e resource and update a router at the same time in server side, the\n \u003e server will send out 2 rpcs, 1 is \u0027router_update\u0027(which will call\n \u003e \"check_local_port_forwarding\"),the other is OVO PortForwarding\n \u003e resource with Created event. In this extension, the 2 rpc will be\n \u003e locked by \u0027synchronized lock\u0027(see functions \"_handle_notification\"\n \u003e and \"add/update_router\"). For this case, we assumpt the\n \u003e update_router arrived first, the OVO rpc block at this time, then\n \u003e the process of \u0027check_local_port_forwarding\u0027 figure out the new\n \u003e created port forwarding in L393, and call _process_create, at this\n \u003e time the check in L183 will do the whole thing for this new port\n \u003e forwarding resource, including fip addition if the fip is new, and\n \u003e ipatbles rules. OK, \u0027update_router\u0027 finish, the port forwarding\n \u003e resouces OVO rpc continue to process, it will call\n \u003e \"_process_create\" again, for not process the fip again, I add this\n \u003e check in L183. the new created port forwarding won\u0027t do the most of\n \u003e work which had been done in the last \"update_router\" rpc, except\n \u003e restart keepalived process for now. Sorry, miguel, this description\n \u003e may looks very tedious, but it is true that the situation exists.\n \u003e And the agent side race condition is hard to handle than server\n \u003e side. My though about these 2 rpc, \"router_add/update\" rpc, I treat\n \u003e it like a maintainer role, maintain the associated port forwarding\n \u003e resources, so I create a full sync function in server side. the OVO\n \u003e port forwarding resource event, I treat it as the new things(new\n \u003e port forwarding resources) to process. Please feel free to correct.","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eca28f1bdf86d8eda983cfb729a896033239ca51","unresolved":false,"context_lines":[{"line_number":396,"context_line":"                new_pfs.append(pf)"},{"line_number":397,"context_line":"            current_pfs.add(pf.id)"},{"line_number":398,"context_line":"        remove_pf_ids_set \u003d local_pfs - current_pfs"},{"line_number":399,"context_line":"        remove_pfs \u003d []"},{"line_number":400,"context_line":"        for local_pf_id in local_pfs:"},{"line_number":401,"context_line":"            if local_pf_id in remove_pf_ids_set:"},{"line_number":402,"context_line":"                remove_pfs.append("},{"line_number":403,"context_line":"                    self.mapping.managed_port_forwardings[local_pf_id])"},{"line_number":404,"context_line":"        self._process_update(updated_pfs, iptable_manager,"},{"line_number":405,"context_line":"                             interface_name, namespace)"},{"line_number":406,"context_line":"        self._process_create(new_pfs, ri, interface_name,"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_c23f2184","line":403,"range":{"start_line":399,"start_character":0,"end_line":403,"end_character":71},"updated":"2018-07-17 23:26:15.000000000","message":"From L398 we know that remove_pf_ids_set is a subset of local_pfs. So these lines can become:\n\nremove_pfs \u003d [self.mapping.managed_port_forwardings[pfid] for pfid in remove_pf_ids_set]","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":396,"context_line":"                new_pfs.append(pf)"},{"line_number":397,"context_line":"            current_pfs.add(pf.id)"},{"line_number":398,"context_line":"        remove_pf_ids_set \u003d local_pfs - current_pfs"},{"line_number":399,"context_line":"        remove_pfs \u003d []"},{"line_number":400,"context_line":"        for local_pf_id in local_pfs:"},{"line_number":401,"context_line":"            if local_pf_id in remove_pf_ids_set:"},{"line_number":402,"context_line":"                remove_pfs.append("},{"line_number":403,"context_line":"                    self.mapping.managed_port_forwardings[local_pf_id])"},{"line_number":404,"context_line":"        self._process_update(updated_pfs, iptable_manager,"},{"line_number":405,"context_line":"                             interface_name, namespace)"},{"line_number":406,"context_line":"        self._process_create(new_pfs, ri, interface_name,"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_5d7bcf78","line":403,"range":{"start_line":399,"start_character":0,"end_line":403,"end_character":71},"in_reply_to":"5f7c97a3_c23f2184","updated":"2018-07-18 03:21:21.000000000","message":"Correct, I will change it. Thanks.","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":33,"context_line":"PORT_FORWARDING_PREFIX \u003d \u0027fip_portforwarding-\u0027"},{"line_number":34,"context_line":"PORT_FORWARDING_CHAIN_PREFIX \u003d \u0027pf-\u0027"},{"line_number":35,"context_line":"# This is the same with iptables_manager constant value, but as the value is"},{"line_number":36,"context_line":"# not move to constants file. So define it for port forwarding here."},{"line_number":37,"context_line":"MAX_CHAIN_LEN_WRAP \u003d 11"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_66ecf391","line":36,"updated":"2018-07-18 11:07:22.000000000","message":"just a question, if it\u0027s used in more than one file, why not move it to constants and reuse where it\u0027s needed?","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":33,"context_line":"PORT_FORWARDING_PREFIX \u003d \u0027fip_portforwarding-\u0027"},{"line_number":34,"context_line":"PORT_FORWARDING_CHAIN_PREFIX \u003d \u0027pf-\u0027"},{"line_number":35,"context_line":"# This is the same with iptables_manager constant value, but as the value is"},{"line_number":36,"context_line":"# not move to constants file. So define it for port forwarding here."},{"line_number":37,"context_line":"MAX_CHAIN_LEN_WRAP \u003d 11"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_e1ad4d32","line":36,"in_reply_to":"5f7c97a3_66ecf391","updated":"2018-07-18 12:02:42.000000000","message":"Because I found it just be used by iptables_manager. And \"Not change too much existing code\" in my head, this maybe a general effect, so I leave the comment and constants value here for waiting the suggest from kind reviewers. Thanks. :). If we agree to change, I will post a new patch for this.","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                        else:"},{"line_number":203,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":204,"context_line":"                        fip_statuses["},{"line_number":205,"context_line":"                            port_forwarding.floatingip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"},{"line_number":207,"context_line":"                    # Any error will causes the fip status to be set \u0027ERROR\u0027"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floatingip_id] \u003d \u0027ERROR\u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_263efbe2","line":205,"updated":"2018-07-18 11:07:22.000000000","message":"nit: there is constant for it in https://github.com/openstack/neutron-lib/blob/master/neutron_lib/constants.py#L29","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                        else:"},{"line_number":203,"context_line":"                            ri._add_vip(fip_cidr, interface_name)"},{"line_number":204,"context_line":"                        fip_statuses["},{"line_number":205,"context_line":"                            port_forwarding.floatingip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"},{"line_number":207,"context_line":"                    # Any error will causes the fip status to be set \u0027ERROR\u0027"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floatingip_id] \u003d \u0027ERROR\u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_c175b1ca","line":205,"in_reply_to":"5f7c97a3_263efbe2","updated":"2018-07-18 12:02:42.000000000","message":"Yes, will change. Thank you","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                            port_forwarding.floatingip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"},{"line_number":207,"context_line":"                    # Any error will causes the fip status to be set \u0027ERROR\u0027"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floatingip_id] \u003d \u0027ERROR\u0027"},{"line_number":209,"context_line":"                    LOG.warning(\"Unable to configure floating IP %(fip_id)s \""},{"line_number":210,"context_line":"                                \"for port forwarding %(pf_id)s\","},{"line_number":211,"context_line":"                                {\u0027fip_id\u0027: port_forwarding.floatingip_id,"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_06597f59","line":208,"range":{"start_line":208,"start_character":67,"end_line":208,"end_character":72},"updated":"2018-07-18 11:07:22.000000000","message":"same here","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                            port_forwarding.floatingip_id] \u003d \u0027ACTIVE\u0027"},{"line_number":206,"context_line":"                except Exception:"},{"line_number":207,"context_line":"                    # Any error will causes the fip status to be set \u0027ERROR\u0027"},{"line_number":208,"context_line":"                    fip_statuses[port_forwarding.floatingip_id] \u003d \u0027ERROR\u0027"},{"line_number":209,"context_line":"                    LOG.warning(\"Unable to configure floating IP %(fip_id)s \""},{"line_number":210,"context_line":"                                \"for port forwarding %(pf_id)s\","},{"line_number":211,"context_line":"                                {\u0027fip_id\u0027: port_forwarding.floatingip_id,"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_213ee5e2","line":208,"range":{"start_line":208,"start_character":67,"end_line":208,"end_character":72},"in_reply_to":"5f7c97a3_06597f59","updated":"2018-07-18 12:02:42.000000000","message":"Done","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1e51b315dd20245511201adb34a072332da13cd8","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        iptables_manager.apply()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def check_local_port_forwardings(self, context, ri, sync_mappings):"},{"line_number":384,"context_line":"        fip_ids \u003d [id[0] for id in sync_mappings["},{"line_number":385,"context_line":"            \u0027floatingip_port_forwarding_mapping\u0027]]"},{"line_number":386,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":387,"context_line":"                                          filter_kwargs\u003d{"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_b9078081","line":384,"range":{"start_line":384,"start_character":35,"end_line":384,"end_character":48},"updated":"2018-07-18 21:07:17.000000000","message":"Please see my comment to https://review.openstack.org/#/c/579910/5/neutron/services/portforwarding/pf_plugin.py@339. As far as I can tell, this could be just a list of fip ids, instead of a list of tuples. It doesn\u0027t seem you use the other half of the tuple","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c8b9b2c1492eff50e2b2fdd1b227e8ddbe9d2cb6","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        iptables_manager.apply()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def check_local_port_forwardings(self, context, ri, sync_mappings):"},{"line_number":384,"context_line":"        fip_ids \u003d [id[0] for id in sync_mappings["},{"line_number":385,"context_line":"            \u0027floatingip_port_forwarding_mapping\u0027]]"},{"line_number":386,"context_line":"        pfs \u003d self.resource_rpc.bulk_pull(context, resources.PORTFORWARDING,"},{"line_number":387,"context_line":"                                          filter_kwargs\u003d{"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_adf2d599","line":384,"range":{"start_line":384,"start_character":35,"end_line":384,"end_character":48},"in_reply_to":"5f7c97a3_b9078081","updated":"2018-07-19 01:36:57.000000000","message":"Yes, thanks, Miguel. That\u0027s right. As we would always sync the whole port forwarding resources according to fip_ids.  I will update the whole patch list today.","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# TODO(bzhao) If there are other files use this constant, and move it into"},{"line_number":36,"context_line":"# constants file. This line will be removed and get the value from constants"},{"line_number":37,"context_line":"# file."},{"line_number":38,"context_line":"MAX_CHAIN_LEN_WRAP \u003d 11"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class RouterFipPortForwardingMapping(object):"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_5b8272a8","line":38,"updated":"2018-07-24 09:25:45.000000000","message":"This constant is already defined in iptables_manager module.\nAs it is now useful here also, I just sent small patch: https://review.openstack.org/585180 to move it to common constant. You will be able to use it from there.","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c84f47499d5bcb3545403ef1b3bf4750f5082a94","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# TODO(bzhao) If there are other files use this constant, and move it into"},{"line_number":36,"context_line":"# constants file. This line will be removed and get the value from constants"},{"line_number":37,"context_line":"# file."},{"line_number":38,"context_line":"MAX_CHAIN_LEN_WRAP \u003d 11"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class RouterFipPortForwardingMapping(object):"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_e7c2bc35","line":38,"in_reply_to":"5f7c97a3_5b8272a8","updated":"2018-07-24 12:27:45.000000000","message":"Good patch, I will update to use it. Thank you. :)","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                         port_forwarding.router_id)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_port_forwardings(self, port_forwardings):"},{"line_number":66,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":67,"context_line":"            self.managed_port_forwardings[port_forwarding.id] \u003d port_forwarding"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_port_forwarding(self, port_forwarding_id):"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_9b66ca28","line":66,"updated":"2018-07-24 09:25:45.000000000","message":"just a question: don\u0027t You need to update self.fip_port_forwarding and self.router_fip_mapping during update_port_forwarding?","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                         port_forwarding.router_id)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_port_forwardings(self, port_forwardings):"},{"line_number":66,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":67,"context_line":"            self.managed_port_forwardings[port_forwarding.id] \u003d port_forwarding"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_port_forwarding(self, port_forwarding_id):"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_3b9bed79","line":66,"in_reply_to":"5f7c97a3_0a9fbdb3","updated":"2018-07-24 14:23:37.000000000","message":"For router rpc(router_add/router_update), we decide which one is create/update/delete totally based on memory managed_port_forwardings, please see L397-405 .\n\nFor OVO rpc(port forwarding create/update/delete), set port forwarding into memory based on event types(create/update/delete), also we need to think, if agent receives a port forwarding update, and it is managed by agent side, that means the fip won\u0027t change(as we don\u0027t allow to change associated fip in server side). The fip still be configured in the managed router namespace. So router_fip_mapping not change at this moment, just update the managed port forwardings, that\u0027s OK.","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c84f47499d5bcb3545403ef1b3bf4750f5082a94","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                         port_forwarding.router_id)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_port_forwardings(self, port_forwardings):"},{"line_number":66,"context_line":"        for port_forwarding in port_forwardings:"},{"line_number":67,"context_line":"            self.managed_port_forwardings[port_forwarding.id] \u003d port_forwarding"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_port_forwarding(self, port_forwarding_id):"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_0a9fbdb3","line":66,"in_reply_to":"5f7c97a3_9b66ca28","updated":"2018-07-24 12:27:45.000000000","message":"Let me try to check and explain.\n\nSo the source of the managed_port_forwarding, it comes from 2 ways. One is the generic router rpc in L386, the other is from OVO push notification.","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            # check if the port forwarding is managed in this agent from"},{"line_number":184,"context_line":"            # OVO and router rpc."},{"line_number":185,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":186,"context_line":"                continue"},{"line_number":187,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":188,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"},{"line_number":189,"context_line":"            fip_cidr \u003d str(netaddr.IPNetwork(fip_ip))"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_f62115a3","line":186,"updated":"2018-07-24 09:25:45.000000000","message":"maybe You should log something in such case? Is it \"expected\" case that there is attempt to create already created port_forwarding?","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            # check if the port forwarding is managed in this agent from"},{"line_number":184,"context_line":"            # OVO and router rpc."},{"line_number":185,"context_line":"            if port_forwarding.id in self.mapping.managed_port_forwardings:"},{"line_number":186,"context_line":"                continue"},{"line_number":187,"context_line":"            existing_cidrs \u003d ri.get_router_cidrs(device)"},{"line_number":188,"context_line":"            fip_ip \u003d str(port_forwarding.floating_ip_address)"},{"line_number":189,"context_line":"            fip_cidr \u003d str(netaddr.IPNetwork(fip_ip))"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_7b2f2589","line":186,"in_reply_to":"5f7c97a3_f62115a3","updated":"2018-07-24 14:23:37.000000000","message":"Log it. :).\n\nFor router rpc, there is no reason to create an existing port forwarding, as the agent side just decide to process some port forwardings based on the memory managed_port_forwardings, if the memory had contain, we won\u0027t process them again.\n\nFor OVO rpc, the process must pass through CREATE -\u003e UPDATE/DELETE, so the CREATE event must be the first set into the managed_port_forwardings, once the memory store it and we process it. We don\u0027t need to process it again.\n\nThe \"if\" here is just for forbidding duplicate operation for these 2 rpcs....","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"6515a7b9e54fa94c002fc102baa919852f7a2ba2","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        \"\"\""},{"line_number":52,"context_line":"        router_fip_mapping \u003d {"},{"line_number":53,"context_line":"            router_id_1: set(fip_id_1, fip_id_2),"},{"line_number":54,"context_line":"            router_id_1: set(fip_id_3, fip_id_4)"},{"line_number":55,"context_line":"        }"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        self.router_fip_mapping \u003d collections.defaultdict(set)"}],"source_content_type":"text/x-python","patch_set":34,"id":"5f7c97a3_8c408006","line":54,"range":{"start_line":54,"start_character":22,"end_line":54,"end_character":23},"updated":"2018-07-27 00:48:33.000000000","message":"do you mean 2 here ?","commit_id":"a103ec22ee8af79d6f1c03fea87f4908d64a533f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01923ccc420dee62cac7d3269beeb8ba1336bb02","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        \"\"\""},{"line_number":52,"context_line":"        router_fip_mapping \u003d {"},{"line_number":53,"context_line":"            router_id_1: set(fip_id_1, fip_id_2),"},{"line_number":54,"context_line":"            router_id_1: set(fip_id_3, fip_id_4)"},{"line_number":55,"context_line":"        }"},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        self.router_fip_mapping \u003d collections.defaultdict(set)"}],"source_content_type":"text/x-python","patch_set":34,"id":"5f7c97a3_2271350e","line":54,"range":{"start_line":54,"start_character":22,"end_line":54,"end_character":23},"in_reply_to":"5f7c97a3_8c408006","updated":"2018-07-27 09:38:01.000000000","message":"Yeah, my bad here, let me fix. Thank you","commit_id":"a103ec22ee8af79d6f1c03fea87f4908d64a533f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"6515a7b9e54fa94c002fc102baa919852f7a2ba2","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        remove_pf_ids_set \u003d local_pfs - current_pfs"},{"line_number":412,"context_line":"        remove_pfs \u003d [self.mapping.managed_port_forwardings[pf_id]"},{"line_number":413,"context_line":"                      for pf_id in remove_pf_ids_set]"},{"line_number":414,"context_line":"        self._process_update(updated_pfs, iptable_manager,"},{"line_number":415,"context_line":"                             interface_name, namespace)"},{"line_number":416,"context_line":"        self._process_create(new_pfs, ri, interface_name,"},{"line_number":417,"context_line":"                             namespace, iptable_manager)"},{"line_number":418,"context_line":"        self._process_delete(context, remove_pfs, ri, interface_name,"},{"line_number":419,"context_line":"                             namespace, iptable_manager)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def process_port_forwarding(self, context, data):"},{"line_number":422,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":34,"id":"5f7c97a3_2cd5ace6","line":419,"range":{"start_line":414,"start_character":8,"end_line":419,"end_character":56},"updated":"2018-07-27 00:48:33.000000000","message":"suggestion on this the new_pfs, updated_pfs or remove_pfs, if any of those are empty would calling _process_xyz be even required ? wouldn\u0027t it make sense to add a check like\nif len(new_pfs) \u003e\u003d 1:\n    self._process_create(new_pfs, ri, interface_name,\n                         namespace, iptable_manager)\n\nand likewise for other operations ?\n\nI see that\u0027s been done in respective _process_xyz, but I think it would make more sense here, IMO because rather than calling all then jumping to 3 new methods for a conditional that list is empty sounds inefficient.","commit_id":"a103ec22ee8af79d6f1c03fea87f4908d64a533f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01923ccc420dee62cac7d3269beeb8ba1336bb02","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        remove_pf_ids_set \u003d local_pfs - current_pfs"},{"line_number":412,"context_line":"        remove_pfs \u003d [self.mapping.managed_port_forwardings[pf_id]"},{"line_number":413,"context_line":"                      for pf_id in remove_pf_ids_set]"},{"line_number":414,"context_line":"        self._process_update(updated_pfs, iptable_manager,"},{"line_number":415,"context_line":"                             interface_name, namespace)"},{"line_number":416,"context_line":"        self._process_create(new_pfs, ri, interface_name,"},{"line_number":417,"context_line":"                             namespace, iptable_manager)"},{"line_number":418,"context_line":"        self._process_delete(context, remove_pfs, ri, interface_name,"},{"line_number":419,"context_line":"                             namespace, iptable_manager)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def process_port_forwarding(self, context, data):"},{"line_number":422,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":34,"id":"5f7c97a3_39be47ce","line":419,"range":{"start_line":414,"start_character":8,"end_line":419,"end_character":56},"in_reply_to":"5f7c97a3_2cd5ace6","updated":"2018-07-27 09:38:01.000000000","message":"Hmmm, I wrote the code like you said before. Please see PS18. But the beginning of each func has a:\nif not pfs:\n    return\nSo, looks like the logic would pass the same setences..Right?\nI\u0027m honest to say, I have no idea about the code style. :-(","commit_id":"a103ec22ee8af79d6f1c03fea87f4908d64a533f"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"396e9ba2badf8451e1d903354341b6bc11e71cfb","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        remove_pf_ids_set \u003d local_pfs - current_pfs"},{"line_number":412,"context_line":"        remove_pfs \u003d [self.mapping.managed_port_forwardings[pf_id]"},{"line_number":413,"context_line":"                      for pf_id in remove_pf_ids_set]"},{"line_number":414,"context_line":"        self._process_update(updated_pfs, iptable_manager,"},{"line_number":415,"context_line":"                             interface_name, namespace)"},{"line_number":416,"context_line":"        self._process_create(new_pfs, ri, interface_name,"},{"line_number":417,"context_line":"                             namespace, iptable_manager)"},{"line_number":418,"context_line":"        self._process_delete(context, remove_pfs, ri, interface_name,"},{"line_number":419,"context_line":"                             namespace, iptable_manager)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def process_port_forwarding(self, context, data):"},{"line_number":422,"context_line":"        ri \u003d self._get_router_info(data[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":34,"id":"5f7c97a3_f8c20002","line":419,"range":{"start_line":414,"start_character":8,"end_line":419,"end_character":56},"in_reply_to":"5f7c97a3_39be47ce","updated":"2018-07-27 18:32:59.000000000","message":"yes, L401-L410 from PS18 looks good to me","commit_id":"a103ec22ee8af79d6f1c03fea87f4908d64a533f"}],"neutron/agent/l3/router_info.py":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"        # Process static routes for router"},{"line_number":1155,"context_line":"        self.routes_updated(self.routes, self.router[\u0027routes\u0027])"},{"line_number":1156,"context_line":"        self.routes \u003d self.router[\u0027routes\u0027]"},{"line_number":1157,"context_line":""},{"line_number":1158,"context_line":"        # Update ex_gw_port on the router info cache"},{"line_number":1159,"context_line":"        self.ex_gw_port \u003d self.get_ex_gw_port()"},{"line_number":1160,"context_line":"        self.fip_map \u003d dict([(fip[\u0027floating_ip_address\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_108b156e","side":"PARENT","line":1157,"updated":"2018-04-20 09:24:09.000000000","message":"Unnecessary change.","commit_id":"7d6d277e408250b5a738fabfb169733cb369a849"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"        # Process static routes for router"},{"line_number":1155,"context_line":"        self.routes_updated(self.routes, self.router[\u0027routes\u0027])"},{"line_number":1156,"context_line":"        self.routes \u003d self.router[\u0027routes\u0027]"},{"line_number":1157,"context_line":""},{"line_number":1158,"context_line":"        # Update ex_gw_port on the router info cache"},{"line_number":1159,"context_line":"        self.ex_gw_port \u003d self.get_ex_gw_port()"},{"line_number":1160,"context_line":"        self.fip_map \u003d dict([(fip[\u0027floating_ip_address\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_295274df","side":"PARENT","line":1157,"in_reply_to":"9f6a8fd7_108b156e","updated":"2018-04-21 07:09:12.000000000","message":"OH, thanks. I miss it.","commit_id":"7d6d277e408250b5a738fabfb169733cb369a849"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"6046021f1603fbfa93698be26e3235aff7c6262a","unresolved":false,"context_lines":[{"line_number":1177,"context_line":"                              fip[\u0027fixed_ip_address\u0027])"},{"line_number":1178,"context_line":"                             for fip in self.get_floating_ips()])"},{"line_number":1179,"context_line":"        self.port_forwarding_mappings \u003d self.router.get("},{"line_number":1180,"context_line":"            \u0027port_forwarding_mappings\u0027, None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_87ec92bb","line":1180,"range":{"start_line":1180,"start_character":40,"end_line":1180,"end_character":44},"updated":"2018-05-30 17:36:27.000000000","message":"Nit: this can be removed.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0c9bd7e879f231d9aaa4d7a7d194c400e6f6aec1","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                # that\u0027s how the caller determines that it was removed"},{"line_number":381,"context_line":"                fip_statuses[fip[\u0027id\u0027]] \u003d FLOATINGIP_STATUS_NOCHANGE"},{"line_number":382,"context_line":"        fips_to_remove \u003d ("},{"line_number":383,"context_line":"            ip_cidr for ip_cidr in existing_cidrs - new_cidrs - gw_cidrs -"},{"line_number":384,"context_line":"            self.centralized_port_forwarding_fip_set"},{"line_number":385,"context_line":"            if common_utils.is_cidr_host(ip_cidr))"},{"line_number":386,"context_line":"        for ip_cidr in fips_to_remove:"},{"line_number":387,"context_line":"            LOG.debug(\"Removing floating ip %s from interface %s in \""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_f95546c3","line":384,"range":{"start_line":383,"start_character":35,"end_line":384,"end_character":52},"updated":"2018-07-16 09:19:07.000000000","message":"can we add brackets here to make this more readable?","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"afc106457038a77f2f0e6503ec16c59c74f72418","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                # that\u0027s how the caller determines that it was removed"},{"line_number":381,"context_line":"                fip_statuses[fip[\u0027id\u0027]] \u003d FLOATINGIP_STATUS_NOCHANGE"},{"line_number":382,"context_line":"        fips_to_remove \u003d ("},{"line_number":383,"context_line":"            ip_cidr for ip_cidr in existing_cidrs - new_cidrs - gw_cidrs -"},{"line_number":384,"context_line":"            self.centralized_port_forwarding_fip_set"},{"line_number":385,"context_line":"            if common_utils.is_cidr_host(ip_cidr))"},{"line_number":386,"context_line":"        for ip_cidr in fips_to_remove:"},{"line_number":387,"context_line":"            LOG.debug(\"Removing floating ip %s from interface %s in \""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f7c97a3_4fe795ac","line":384,"range":{"start_line":383,"start_character":35,"end_line":384,"end_character":52},"in_reply_to":"5f7c97a3_f95546c3","updated":"2018-07-18 03:21:21.000000000","message":"Thanks for review, will add. Sorry for confused.","commit_id":"d74ad446b7a94f12fe3c33e84b6674983506556b"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            ip_wrapper.netns.execute(cmd, check_exit_code\u003dTrue,"},{"line_number":334,"context_line":"                                     extra_ok_codes\u003d[1])"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        except RuntimeError:"},{"line_number":337,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":338,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":339,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_70b05144","line":336,"range":{"start_line":336,"start_character":8,"end_line":336,"end_character":28},"updated":"2018-04-20 09:24:09.000000000","message":"What will happen if do not re-raise such exception?","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            ip_wrapper.netns.execute(cmd, check_exit_code\u003dTrue,"},{"line_number":334,"context_line":"                                     extra_ok_codes\u003d[1])"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        except RuntimeError:"},{"line_number":337,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":338,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":339,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_47321f61","line":336,"range":{"start_line":336,"start_character":8,"end_line":336,"end_character":28},"in_reply_to":"9f6a8fd7_70b05144","updated":"2018-04-21 07:09:12.000000000","message":"if delete fail, the exsiting connection will still alive and affect new request configuration with the same parameters. just like the above function, we just Log the error.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a45d98fb57de19d8b667e1367f4584ef745485c4","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        except RuntimeError:"},{"line_number":337,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":338,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def disable_ipv6(self):"},{"line_number":341,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_80519c11","line":338,"range":{"start_line":338,"start_character":27,"end_line":338,"end_character":28},"updated":"2018-04-15 06:56:51.000000000","message":"space at the end of the line","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"2adf37c99dd7716628bca368fd5ecbb56472255d","unresolved":false,"context_lines":[{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        except RuntimeError:"},{"line_number":337,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":338,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def disable_ipv6(self):"},{"line_number":341,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_00210cb5","line":338,"range":{"start_line":338,"start_character":27,"end_line":338,"end_character":28},"in_reply_to":"9f6a8fd7_80519c11","updated":"2018-04-15 10:15:01.000000000","message":"You are right. Will update it. Thanks.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            LOG.exception(\"Failed deleting egress connection state of\""},{"line_number":332,"context_line":"                          \" floatingip %s\", ip_str)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    def delete_socket_conntrack_state(self, cidr, dport, protocol):"},{"line_number":335,"context_line":"        ip_str \u003d str(netaddr.IPNetwork(cidr).ip)"},{"line_number":336,"context_line":"        ip_wrapper \u003d IPWrapper(namespace\u003dself.namespace)"},{"line_number":337,"context_line":"        cmd \u003d [\"conntrack\", \"-D\", \"-d\", ip_str, \u0027-p\u0027, protocol,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_ab43b43e","line":334,"updated":"2018-05-29 14:16:34.000000000","message":"I think there is already some conntrack manager class which can be used to such things like delete contrack state","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            LOG.exception(\"Failed deleting egress connection state of\""},{"line_number":332,"context_line":"                          \" floatingip %s\", ip_str)"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    def delete_socket_conntrack_state(self, cidr, dport, protocol):"},{"line_number":335,"context_line":"        ip_str \u003d str(netaddr.IPNetwork(cidr).ip)"},{"line_number":336,"context_line":"        ip_wrapper \u003d IPWrapper(namespace\u003dself.namespace)"},{"line_number":337,"context_line":"        cmd \u003d [\"conntrack\", \"-D\", \"-d\", ip_str, \u0027-p\u0027, protocol,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_f1e2f62f","line":334,"in_reply_to":"5f7c97a3_ab43b43e","updated":"2018-05-30 01:58:11.000000000","message":"ip_conntrack class doesn\u0027t support dport which based on the L4 port num. And this function just support the specific traffic which is  \u0027ingress\u0027 with protocol and destination port num, means based on \u0027ingress\u0027 socket to delete conntrack. So for simple and specific usecase, I decide to make it like this like below \"delete_addr_and_conntrack_state\". Did you suggest to extend the ip_conntrack class?","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ed864756267acd17e11d3173a5c1aac1a207525","unresolved":false,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        except RuntimeError:"},{"line_number":344,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":345,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def disable_ipv6(self):"},{"line_number":348,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_cb407038","line":345,"range":{"start_line":345,"start_character":27,"end_line":345,"end_character":28},"updated":"2018-05-29 14:16:34.000000000","message":"nitty nit: please move this space at the end of line above","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"5b5ffe2b04cf83b82bc2cc4dc22c1229d9b374c5","unresolved":false,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        except RuntimeError:"},{"line_number":344,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of\""},{"line_number":345,"context_line":"                          \" socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def disable_ipv6(self):"},{"line_number":348,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_910aa21d","line":345,"range":{"start_line":345,"start_character":27,"end_line":345,"end_character":28},"in_reply_to":"5f7c97a3_cb407038","updated":"2018-05-30 01:58:11.000000000","message":"Oh, thanks.","commit_id":"686b6c17a8f6799800b600fb9b1d33cf98f162d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        except RuntimeError:"},{"line_number":344,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of \""},{"line_number":345,"context_line":"                          \"socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def disable_ipv6(self):"},{"line_number":348,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_b6771d8f","line":345,"range":{"start_line":345,"start_character":34,"end_line":345,"end_character":59},"updated":"2018-07-24 09:25:45.000000000","message":"nit: maybe something like:\n\n\"%s:%s\", ip_str, dport","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        except RuntimeError:"},{"line_number":344,"context_line":"            LOG.exception(\"Failed deleting ingress connection state of \""},{"line_number":345,"context_line":"                          \"socket %s\", ip_str + \u0027:\u0027 + dport)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def disable_ipv6(self):"},{"line_number":348,"context_line":"        if not ipv6_utils.is_enabled_and_bind_by_default():"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_90a5404b","line":345,"range":{"start_line":345,"start_character":34,"end_line":345,"end_character":59},"in_reply_to":"5f7c97a3_b6771d8f","updated":"2018-07-24 14:23:37.000000000","message":"Done","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"}],"neutron/api/rpc/callbacks/resources.py":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.objects import securitygroup"},{"line_number":19,"context_line":"from neutron.objects import subnet"},{"line_number":20,"context_line":"from neutron.objects import trunk"},{"line_number":21,"context_line":"from neutron.objects import port_forwarding"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# Supported types"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_b06d89cd","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":43},"updated":"2018-04-20 09:24:09.000000000","message":"Such change should be put in neutron-server side patch. Right?","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.objects import securitygroup"},{"line_number":19,"context_line":"from neutron.objects import subnet"},{"line_number":20,"context_line":"from neutron.objects import trunk"},{"line_number":21,"context_line":"from neutron.objects import port_forwarding"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# Supported types"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_a90c44ec","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":43},"in_reply_to":"9f6a8fd7_b06d89cd","updated":"2018-04-21 07:09:12.000000000","message":"hmm, why I set in agent side, the reason is the agent side called \"resources.PORTFORWARDING\", it needs the resource name to register rpc, etc..","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET \u003d subnet.Subnet.obj_name()"},{"line_number":32,"context_line":"SECURITYGROUP \u003d securitygroup.SecurityGroup.obj_name()"},{"line_number":33,"context_line":"SECURITYGROUPRULE \u003d securitygroup.SecurityGroupRule.obj_name()"},{"line_number":34,"context_line":"PORTFORWARDING \u003d port_forwarding.PortForwarding.obj_name()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"_VALID_CLS \u003d ("},{"line_number":37,"context_line":"    policy.QosPolicy,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_d0727dad","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":58},"updated":"2018-04-20 09:24:09.000000000","message":"ditto","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":31,"context_line":"SUBNET \u003d subnet.Subnet.obj_name()"},{"line_number":32,"context_line":"SECURITYGROUP \u003d securitygroup.SecurityGroup.obj_name()"},{"line_number":33,"context_line":"SECURITYGROUPRULE \u003d securitygroup.SecurityGroupRule.obj_name()"},{"line_number":34,"context_line":"PORTFORWARDING \u003d port_forwarding.PortForwarding.obj_name()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"_VALID_CLS \u003d ("},{"line_number":37,"context_line":"    policy.QosPolicy,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_a729bbe6","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":58},"in_reply_to":"9f6a8fd7_d0727dad","updated":"2018-04-21 07:09:12.000000000","message":"The right way is like you said. This depends on the server side code.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"}],"neutron/objects/port_forwarding.py":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 Intel Corporation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_7014d144","line":1,"range":{"start_line":1,"start_character":2,"end_line":1,"end_character":39},"updated":"2018-04-20 09:24:09.000000000","message":"This is right?","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 Intel Corporation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_c7262f16","line":1,"range":{"start_line":1,"start_character":2,"end_line":1,"end_character":39},"in_reply_to":"9f6a8fd7_7014d144","updated":"2018-04-21 07:09:12.000000000","message":"No, I just copy from other file. Will correct it.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ff84d7ecff4053dca43562e02c517f065a67a68e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from neutron.objects import base"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"@base.NeutronObjectRegistry.register"},{"line_number":19,"context_line":"class PortForwarding(base.NeutronDbObject):"},{"line_number":20,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_102f958e","line":20,"range":{"start_line":15,"start_character":0,"end_line":20,"end_character":8},"updated":"2018-04-20 09:24:09.000000000","message":"Such object definition should put in server-side patch.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c85db43549e0077644415c3949a0092062c94156","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from neutron.objects import base"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"@base.NeutronObjectRegistry.register"},{"line_number":19,"context_line":"class PortForwarding(base.NeutronDbObject):"},{"line_number":20,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f6a8fd7_871cb7c1","line":20,"range":{"start_line":15,"start_character":0,"end_line":20,"end_character":8},"in_reply_to":"9f6a8fd7_102f958e","updated":"2018-04-21 07:09:12.000000000","message":"Yeah, I will change the patch order list and depend on the server-side.","commit_id":"f20bc622f631afbab42dcea48d5cd17a76029432"}],"neutron/services/portforwarding/common/exceptions.py~930f2786a... Neutron server side Floating IP port forwarding":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"5f7c97a3_31a3f202","updated":"2018-06-06 22:12:38.000000000","message":"The name of this file seems wrong","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"16711bc88065ded4f3362700e866218fc1ad5d61","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"5f7c97a3_2a2130fd","in_reply_to":"5f7c97a3_31a3f202","updated":"2018-06-07 07:20:40.000000000","message":"Oh , this is my bad, this file should be removed, it looks like a server part code.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"5f7c97a3_85c87c21","in_reply_to":"5f7c97a3_31a3f202","updated":"2018-06-07 07:15:39.000000000","message":"Oh, sorry. But where this strang name come from. I will check it. Thank you. Miguel.","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"636523c3b850ae34e61d5176b7c5ea3953748b8d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Fujitsu Limited."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"application/octet-stream","patch_set":18,"id":"5f7c97a3_f1ac9aef","line":1,"range":{"start_line":1,"start_character":2,"end_line":1,"end_character":33},"updated":"2018-06-06 22:12:38.000000000","message":"You don\u0027t work for Fujitsu","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"01b81d0cd1de6a9a0651c8a61adf2cc0df1a131f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Fujitsu Limited."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"application/octet-stream","patch_set":18,"id":"5f7c97a3_c548b4b4","line":1,"range":{"start_line":1,"start_character":2,"end_line":1,"end_character":33},"in_reply_to":"5f7c97a3_f1ac9aef","updated":"2018-06-07 07:15:39.000000000","message":"Done","commit_id":"1c9a7b67ece8990e37590d0331aa0ff911020fe0"}],"neutron/tests/functional/agent/l3/extensions/test_port_forwarding_extension.py":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fbbb0a5ae4a87f3dd5c71b89805e4c8b8ae3311b","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        common_utils.wait_until_true(check_harouter_fip_is_set)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def _test_centralized_routers(self, router_info, enable_ha\u003dFalse):"},{"line_number":156,"context_line":"        router_id \u003d router_info[\u0027id\u0027]"},{"line_number":157,"context_line":"        for pfobj in self.port_forwardings:"},{"line_number":158,"context_line":"            pfobj.router_id \u003d router_id"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_7d523ddc","line":155,"range":{"start_line":155,"start_character":14,"end_line":155,"end_character":25},"updated":"2018-07-18 14:17:55.000000000","message":"Maybe you can remove this word because this method are using by legacy, ha, and dvr.","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c8b9b2c1492eff50e2b2fdd1b227e8ddbe9d2cb6","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        common_utils.wait_until_true(check_harouter_fip_is_set)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def _test_centralized_routers(self, router_info, enable_ha\u003dFalse):"},{"line_number":156,"context_line":"        router_id \u003d router_info[\u0027id\u0027]"},{"line_number":157,"context_line":"        for pfobj in self.port_forwardings:"},{"line_number":158,"context_line":"            pfobj.router_id \u003d router_id"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_4ded41b6","line":155,"range":{"start_line":155,"start_character":14,"end_line":155,"end_character":25},"in_reply_to":"5f7c97a3_7d523ddc","updated":"2018-07-19 01:36:57.000000000","message":"What I want to say that the all agent modes, only the centralized case would be work for this feature, as this whole feature is a centralized function. :).","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                 self.portforwarding3, self.portforwarding4]"},{"line_number":70,"context_line":"        self._set_bulk_pull_mock()"},{"line_number":71,"context_line":"        self.managed_fips \u003d ["},{"line_number":72,"context_line":"            self.floatingip1, self.floatingip2, self.floatingip3]"},{"line_number":73,"context_line":"        self.fip_list_for_pf \u003d [\u0027111.111.111.111/32\u0027, \u0027111.222.111.222/32\u0027,"},{"line_number":74,"context_line":"                                \u0027222.222.222.222/32\u0027]"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_f6591500","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":64},"updated":"2018-07-24 09:25:45.000000000","message":"those names suggests that those are objects like for portforwarding{1,2,3,4} above. Maybe You can change it to something like \"fip_id1,2,3\" or something like that?","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                 self.portforwarding3, self.portforwarding4]"},{"line_number":70,"context_line":"        self._set_bulk_pull_mock()"},{"line_number":71,"context_line":"        self.managed_fips \u003d ["},{"line_number":72,"context_line":"            self.floatingip1, self.floatingip2, self.floatingip3]"},{"line_number":73,"context_line":"        self.fip_list_for_pf \u003d [\u0027111.111.111.111/32\u0027, \u0027111.222.111.222/32\u0027,"},{"line_number":74,"context_line":"                                \u0027222.222.222.222/32\u0027]"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_908c60d9","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":64},"in_reply_to":"5f7c97a3_f6591500","updated":"2018-07-24 14:23:37.000000000","message":"Done","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        def check_existing_cidrs():"},{"line_number":99,"context_line":"            existing_cidrs \u003d router_info.get_router_cidrs(device)"},{"line_number":100,"context_line":"            if pf_fip_cidr in existing_cidrs:"},{"line_number":101,"context_line":"                return True"},{"line_number":102,"context_line":"            return False"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        common_utils.wait_until_true(check_existing_cidrs)"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_566489b3","line":102,"range":{"start_line":100,"start_character":12,"end_line":102,"end_character":24},"updated":"2018-07-24 09:25:45.000000000","message":"return pf_fip_cidr in existing_cidrs\n\nwill be enough","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        def check_existing_cidrs():"},{"line_number":99,"context_line":"            existing_cidrs \u003d router_info.get_router_cidrs(device)"},{"line_number":100,"context_line":"            if pf_fip_cidr in existing_cidrs:"},{"line_number":101,"context_line":"                return True"},{"line_number":102,"context_line":"            return False"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        common_utils.wait_until_true(check_existing_cidrs)"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_70bd0466","line":102,"range":{"start_line":100,"start_character":12,"end_line":102,"end_character":24},"in_reply_to":"5f7c97a3_566489b3","updated":"2018-07-24 14:23:37.000000000","message":"Done","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            if chain_name not in existing_chains:"},{"line_number":122,"context_line":"                return False"},{"line_number":123,"context_line":"            existing_rules \u003d iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":124,"context_line":"            if rule_obj in existing_rules:"},{"line_number":125,"context_line":"                return True"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        common_utils.wait_until_true(check_chain_rules_set)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_56f9e9c2","line":126,"range":{"start_line":124,"start_character":12,"end_line":126,"end_character":24},"updated":"2018-07-24 09:25:45.000000000","message":"return rule_obj in existing_rules\n\nwill be enough","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            if chain_name not in existing_chains:"},{"line_number":122,"context_line":"                return False"},{"line_number":123,"context_line":"            existing_rules \u003d iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":124,"context_line":"            if rule_obj in existing_rules:"},{"line_number":125,"context_line":"                return True"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        common_utils.wait_until_true(check_chain_rules_set)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_d0abb81c","line":126,"range":{"start_line":124,"start_character":12,"end_line":126,"end_character":24},"in_reply_to":"5f7c97a3_56f9e9c2","updated":"2018-07-24 14:23:37.000000000","message":"Done","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"}],"neutron/tests/unit/agent/l3/extensions/test_port_forwarding.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"18efd1c569f5faf2ba3ab5878fad03396103f76a","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TEST_QOS_FIP \u003d \u002710.100.2.45\u0027"},{"line_number":37,"context_line":"BINARY_NAME \u003d iptables_manager.get_binary_name()"},{"line_number":38,"context_line":"DEFAULT_RULE \u003d (\u0027PREROUTING\u0027, \u0027-j %s-fip-pf\u0027 % BINARY_NAME)"},{"line_number":39,"context_line":"DEFAULT_CHAIN \u003d \u0027fip-pf\u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_615cddef","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"updated":"2018-07-18 11:07:22.000000000","message":"QOS?","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1f56f70f5c374e3574b79e58fca6e0d4fcaa56ee","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TEST_QOS_FIP \u003d \u002710.100.2.45\u0027"},{"line_number":37,"context_line":"BINARY_NAME \u003d iptables_manager.get_binary_name()"},{"line_number":38,"context_line":"DEFAULT_RULE \u003d (\u0027PREROUTING\u0027, \u0027-j %s-fip-pf\u0027 % BINARY_NAME)"},{"line_number":39,"context_line":"DEFAULT_CHAIN \u003d \u0027fip-pf\u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"5f7c97a3_c12371ba","line":36,"range":{"start_line":36,"start_character":0,"end_line":36,"end_character":12},"in_reply_to":"5f7c97a3_615cddef","updated":"2018-07-18 12:02:42.000000000","message":"Oh, nice catch. My bad here.","commit_id":"128a63896804cafe760c5f887d8f5c92d24ce816"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c8e39eb4e758b429dcfc6f2189b081f19ad9f498","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self.get_router_info \u003d mock.patch("},{"line_number":92,"context_line":"            \u0027neutron.agent.l3.l3_agent_extension_api.\u0027"},{"line_number":93,"context_line":"            \u0027L3AgentExtensionAPI.get_router_info\u0027).start()"},{"line_number":94,"context_line":"        self.get_router_info.side_effect \u003d _mock_get_router_info"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        self.agent_api \u003d l3_ext_api.L3AgentExtensionAPI(None)"},{"line_number":97,"context_line":"        self.fip_pf_ext.consume_api(self.agent_api)"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_b6af1d9c","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":64},"updated":"2018-07-24 09:25:45.000000000","message":"why not just:\n\n    self.get_router_info.return_value \u003d self.router_info","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fc456cc51f238288c6368eb80ea7e2b679091fe4","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        self.get_router_info \u003d mock.patch("},{"line_number":92,"context_line":"            \u0027neutron.agent.l3.l3_agent_extension_api.\u0027"},{"line_number":93,"context_line":"            \u0027L3AgentExtensionAPI.get_router_info\u0027).start()"},{"line_number":94,"context_line":"        self.get_router_info.side_effect \u003d _mock_get_router_info"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        self.agent_api \u003d l3_ext_api.L3AgentExtensionAPI(None)"},{"line_number":97,"context_line":"        self.fip_pf_ext.consume_api(self.agent_api)"}],"source_content_type":"text/x-python","patch_set":31,"id":"5f7c97a3_508fa8d2","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":64},"in_reply_to":"5f7c97a3_b6af1d9c","updated":"2018-07-24 14:23:37.000000000","message":"Done","commit_id":"96d02e99799583be4937213ea9be5a4b126a5aff"}]}
