)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"02d0278fc150a3ce11990e03a7b55cd77f22d829","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa32b979_7b18c3d3","line":14,"updated":"2015-06-23 13:34:03.000000000","message":"From bug description it seems we can just handle concurrent port deletion (there are several places with similar handling). Thoughts?","commit_id":"e831f8fbf5ecb763805a13270f97afd7e87398fa"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2d4729694a0b43198c513bfcfcd999e1df90d810","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa32b979_7e83c656","line":14,"in_reply_to":"fa32b979_7b18c3d3","updated":"2015-06-23 16:49:08.000000000","message":"Oleg, the proposal is to get rid of all these deletes when association and disassociation.\nI have created a separate bug that addresses this issue. \nI will attach that bug id with these changes.","commit_id":"e831f8fbf5ecb763805a13270f97afd7e87398fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"02d0278fc150a3ce11990e03a7b55cd77f22d829","unresolved":false,"context_lines":[{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external network associated with the Agent port is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I6637a771e6a6ce74e848cb74b779043e16a54a84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa32b979_5bc85f22","line":18,"updated":"2015-06-23 13:34:03.000000000","message":"So does it mean that we\u0027ll have compute nodes with no floating ips on them but still consuming public ip address for no good reason?","commit_id":"e831f8fbf5ecb763805a13270f97afd7e87398fa"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2d4729694a0b43198c513bfcfcd999e1df90d810","unresolved":false,"context_lines":[{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external network associated with the Agent port is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I6637a771e6a6ce74e848cb74b779043e16a54a84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa32b979_9ed6ca4d","line":18,"in_reply_to":"fa32b979_5bc85f22","updated":"2015-06-23 16:49:08.000000000","message":"No, this patch is a dependent patch on the RPC patch that I have posted.\n\nThe suggestion here is, the agent will delete the FloatingIP Agent gateway port, when not required and the server will only clean it up when the external gateway port is removed.\n\nSo there won\u0027t be consumption of public ip address when there is no good reason.","commit_id":"e831f8fbf5ecb763805a13270f97afd7e87398fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2ae2ba5c19f384f024d1d8cca75a9468cccbd47a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external network associated with the Agent port is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa32b979_7800a234","line":17,"updated":"2015-06-24 07:55:35.000000000","message":"Based on your reply in PS1 I think we better reword commit message as now it\u0027s confusing: \"patch will delete the FIP agent gateway port when external network associated with the Agent port is deleted\" which is not quite what this patch is doing. Am I missing something?","commit_id":"c4fbfcb3a9ca5002ed45dcfe1808407072b928da"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d63eef218e2e69d420f74afa998ea16d0e50aac0","unresolved":false,"context_lines":[{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external network associated with the Agent port is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa32b979_bf94b336","line":17,"in_reply_to":"fa32b979_7800a234","updated":"2015-06-24 17:20:32.000000000","message":"Done","commit_id":"c4fbfcb3a9ca5002ed45dcfe1808407072b928da"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2d3d46d797523f10e9faf01bd164c47e6605e137","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-06-24 17:19:58 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Delete FIP agent gateway port with external-net-delete"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa32b979_f50c7eed","line":7,"updated":"2015-06-25 09:30:48.000000000","message":"This has to be updated as well","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"36e5273ee7e9fd48bb0233fcf332415345177927","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-06-24 17:19:58 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Delete FIP agent gateway port with external-net-delete"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa32b979_51fa0976","line":7,"in_reply_to":"fa32b979_f50c7eed","updated":"2015-06-25 16:11:54.000000000","message":"Sure will update this.","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2d3d46d797523f10e9faf01bd164c47e6605e137","unresolved":false,"context_lines":[{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external gateway port associated with the router is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa32b979_b5227650","line":17,"updated":"2015-06-25 09:30:48.000000000","message":"Can you please clarify why this is needed given the next patch where the agent will delete fip port itself when it\u0027s not needed?","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"40341f32b5760db0e1cea4063764e237e6a1e244","unresolved":false,"context_lines":[{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external gateway port associated with the router is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa32b979_34d413e7","line":17,"in_reply_to":"fa32b979_b1fef567","updated":"2015-06-25 16:32:28.000000000","message":"Makes sense, thanks for clarification. It\u0027s better to be included in the commit message as well","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"36e5273ee7e9fd48bb0233fcf332415345177927","unresolved":false,"context_lines":[{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external gateway port associated with the router is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa32b979_b1fef567","line":17,"in_reply_to":"fa32b979_b5227650","updated":"2015-06-25 16:11:54.000000000","message":"These fip agent gateway ports are internal admin managed ports, so if for some reason the agent died and could not delete this port, then there is no direct port-delete command to delete this port.\n\nSo it has to be deleted based on the context. This ensures like cleaning up the ports created by the server when the external gateway port is deleted for that particular router.","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6788b0aff79b80d3068809763ccd4b9e94061ef9","unresolved":false,"context_lines":[{"line_number":15,"context_line":"un-necessary access to the db."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch will delete the FIP agent gateway port when"},{"line_number":18,"context_line":"external gateway port associated with the router is"},{"line_number":19,"context_line":"deleted."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I6637a771e6a6ce74e848cb74b779043e16a54a84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"ba3cc151_04a87d1e","line":18,"updated":"2015-06-30 08:52:38.000000000","message":".. when the last gateway port is deleted from external network. This should cover the case when an agent for some reason was unable to request agent gw port deletion (agent died).","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b50eb29ab86a9f27ca04a7e33195b2a5301da475","unresolved":false,"context_lines":[{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ba3cc151_8a24cc0e","line":12,"updated":"2015-07-10 05:38:29.000000000","message":"Isn\u0027t this still true?  I expected this patch to remove this code to delete on floatingip (dis)associate.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d222c59ab09609d1f1ba3220d9056fd900d4777","unresolved":false,"context_lines":[{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ba3cc151_033de9ba","line":12,"in_reply_to":"ba3cc151_8a24cc0e","updated":"2015-07-10 16:51:39.000000000","message":"Yes I have cleaned up the delete on floatingip disassociate in the child patch.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d3592936128d4e1fc6687d4c887f63fa83f95405","unresolved":false,"context_lines":[{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9a41bdd9_6dd93bf3","line":12,"updated":"2015-07-13 07:37:55.000000000","message":"To the discussion in PS 18, saying \"Previously\" is confusing since this patch is not changing this, so better to reword to clearly state that this will be cleaned up later","commit_id":"71d5830669cdd2d392a6bdbc566c73ef44abb986"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"be86025e93d7bd26dafbb66e12a1750819fa1e7a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"FIP agent gateway ports are associated with external"},{"line_number":10,"context_line":"networks and specific host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Previously the FIP agent gateway port was deleted for"},{"line_number":13,"context_line":"every floatingip associate and disassociate. This was"},{"line_number":14,"context_line":"causing race conditions in the port delete and also"},{"line_number":15,"context_line":"un-necessary access to the db."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9a41bdd9_ec052dc2","line":12,"in_reply_to":"9a41bdd9_6dd93bf3","updated":"2015-07-13 16:56:15.000000000","message":"will fix this in the next patch.","commit_id":"71d5830669cdd2d392a6bdbc566c73ef44abb986"},{"author":{"_account_id":17096,"name":"Aditi Rajagopal","email":"arajagopal@us.ibm.com","username":"aditirajagopal"},"change_message_id":"b30fe92bd8fffaef1d10dd24094f7eb96659e691","unresolved":false,"context_lines":[{"line_number":18,"context_line":"the last gateway port of the external network is deleted."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"The child patch linked to this parent patch will clean"},{"line_number":21,"context_line":"up the FIP agent gateway port delete when associate, "},{"line_number":22,"context_line":"disassociate and delete of floatingip happens."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"This should also cover the case when an agent for some"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"9a41bdd9_415657d3","line":21,"updated":"2015-07-13 21:44:06.000000000","message":"nit: if you are going to submit another patch, try to delete this unnecessary whitespace","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"d82f65eab7ca8aab6b8f59aacd37d27dc9fea607","unresolved":false,"context_lines":[{"line_number":25,"context_line":"reason was unable to request agent gw port delete."},{"line_number":26,"context_line":"(agent died)."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Related-Bug: #1408855"},{"line_number":29,"context_line":"Related-Bug: #1468007"},{"line_number":30,"context_line":"Related-Bug: $1450982"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":59,"id":"da20952f_36067a86","line":28,"updated":"2015-09-07 12:05:08.000000000","message":"Related-Bug-\u003eCloses-Bug","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"680597512797b43321cfacc9c19566b335247c6b","unresolved":false,"context_lines":[{"line_number":25,"context_line":"reason was unable to request agent gw port delete."},{"line_number":26,"context_line":"(agent died)."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Related-Bug: #1408855"},{"line_number":29,"context_line":"Related-Bug: #1468007"},{"line_number":30,"context_line":"Related-Bug: $1450982"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":59,"id":"da20952f_0c28fe84","line":28,"in_reply_to":"da20952f_36067a86","updated":"2015-09-08 12:50:15.000000000","message":"Bug is completely fixed by the third patch in the row","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"835ecffb291459e8be68d5add90abeafcf68a77b","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Related-Bug: #1408855"},{"line_number":29,"context_line":"Related-Bug: #1468007"},{"line_number":30,"context_line":"Related-Bug: $1450982"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: I6637a771e6a6ce74e848cb74b779043e16a54a84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":59,"id":"da20952f_7d3f0a87","line":30,"updated":"2015-09-06 06:57:15.000000000","message":"$-\u003e#","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"19e69c03ee8f03221f6823616ffe42ac6684d8e3","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Related-Bug: #1408855"},{"line_number":29,"context_line":"Related-Bug: #1468007"},{"line_number":30,"context_line":"Related-Bug: $1450982"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: I6637a771e6a6ce74e848cb74b779043e16a54a84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":59,"id":"da20952f_49fd5607","line":30,"in_reply_to":"da20952f_7d3f0a87","updated":"2015-09-08 18:46:02.000000000","message":"Done","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"be1ed06a526d8cbca81077368ea79da70c6101c7","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_2c2e2343","line":167,"updated":"2015-06-25 08:30:36.000000000","message":"What if there are other distributerd routers with floating ips? This will delete all fip agent gw ports if delete gw port of only one router","commit_id":"9e69529ac732fb79ddf12d811b2516cd2b3cdead"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"398eb4ea1ae51b4602ecd36d3c8b452b1190adc0","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_d4efe784","line":167,"updated":"2015-06-25 16:32:37.000000000","message":"comment from the previos patchset was not answered, I\u0027d like to understand how this won\u0027t delete fip agent gw port if there are several routers and gateway is deleted for only one router?","commit_id":"1973be6914f639b9ed81363ffee0d89dc10a6872"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"4b9d9ecdd88e1019ce69666132f81437ac5af260","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_45df9f68","line":167,"in_reply_to":"fa32b979_2ae02a25","updated":"2015-06-25 17:18:19.000000000","message":"Let me check this out and get back to you.","commit_id":"1973be6914f639b9ed81363ffee0d89dc10a6872"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"64a8176695317b02da49a89da092cfda4f7b56f7","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_5f0199ae","line":167,"in_reply_to":"fa32b979_2ae02a25","updated":"2015-06-26 06:49:56.000000000","message":"Yeah, but other routers may have gateways on the same ext net..","commit_id":"1973be6914f639b9ed81363ffee0d89dc10a6872"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"dba434ddaf47ac41cf2292353153104ba3441ffe","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_0bd2e500","line":167,"in_reply_to":"fa32b979_5f0199ae","updated":"2015-06-29 18:33:19.000000000","message":"addressed review comments.","commit_id":"1973be6914f639b9ed81363ffee0d89dc10a6872"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f61009f4edc3effd2f999a17210b4888fdc486e9","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when the gateway port is deleted."},{"line_number":167,"context_line":"            self._delete_floatingip_agent_gateway_port("},{"line_number":168,"context_line":"                context.elevated(), None, gw_ext_net_id)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_2ae02a25","line":167,"in_reply_to":"fa32b979_d4efe784","updated":"2015-06-25 17:00:07.000000000","message":"Hi Oleg,\nThe delete_gateway_port will only delete the fip agent gateway port based on the external net. So the if the router gateway that you are deleting has an external net id of \"xyz\", then it would only delete the fip agent gateway ports that are residing on the external network that this gateway port was also residing on.","commit_id":"1973be6914f639b9ed81363ffee0d89dc10a6872"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6788b0aff79b80d3068809763ccd4b9e94061ef9","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"},{"line_number":147,"context_line":"        \"\"\""},{"line_number":148,"context_line":"        Override this function to handle deletion of dvr internal ports."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        If there is a valid router update with gateway port to be deleted,"},{"line_number":151,"context_line":"        then go ahead and delete the csnat ports and the floatingip"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_a431910d","line":148,"updated":"2015-06-30 08:52:38.000000000","message":"This doesn\u0027t suggest to overide, right? It just describes why it is overriden here. Then for clarity I think it\u0027s better to say \"Overriden here to handle...\"","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"05ce9c6915bae475e11bd17406329ded343ef212","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"},{"line_number":147,"context_line":"        \"\"\""},{"line_number":148,"context_line":"        Override this function to handle deletion of dvr internal ports."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        If there is a valid router update with gateway port to be deleted,"},{"line_number":151,"context_line":"        then go ahead and delete the csnat ports and the floatingip"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_7bcf867f","line":148,"in_reply_to":"ba3cc151_a431910d","updated":"2015-06-30 19:15:35.000000000","message":"Will fix it.","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6788b0aff79b80d3068809763ccd4b9e94061ef9","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        then go ahead and delete the csnat ports and the floatingip"},{"line_number":152,"context_line":"        agent gateway port associated with the dvr router."},{"line_number":153,"context_line":"        \"\"\""},{"line_number":154,"context_line":"        port_requires_deletion \u003d ("},{"line_number":155,"context_line":"            router.gw_port and router.gw_port[\u0027network_id\u0027] !\u003d new_network)"},{"line_number":156,"context_line":"        gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":157,"context_line":"        if gw_port_id:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_7f88f2e7","line":154,"updated":"2015-06-30 08:52:38.000000000","message":"This is a duplication from parent class, I believe this should better be checked by the caller of this function. Seems it\u0027s already done in parent\u0027s _update_router_gw_info(), the only thing that might be added is to verify there is something to delete (gw port exists). However it might go beyond the scope of this patch, I\u0027m ready to come up with a follow-up patch after this one is merged","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"05ce9c6915bae475e11bd17406329ded343ef212","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        then go ahead and delete the csnat ports and the floatingip"},{"line_number":152,"context_line":"        agent gateway port associated with the dvr router."},{"line_number":153,"context_line":"        \"\"\""},{"line_number":154,"context_line":"        port_requires_deletion \u003d ("},{"line_number":155,"context_line":"            router.gw_port and router.gw_port[\u0027network_id\u0027] !\u003d new_network)"},{"line_number":156,"context_line":"        gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":157,"context_line":"        if gw_port_id:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_bbb42ef2","line":154,"in_reply_to":"ba3cc151_7f88f2e7","updated":"2015-06-30 19:15:35.000000000","message":"Yes I knew this is a duplicate.\nAs you mentioned we can fix it in the follow up patch by the super class  function returning if \"port_requires_deletion\" or not.","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6788b0aff79b80d3068809763ccd4b9e94061ef9","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":554,"context_line":"        else:"},{"line_number":555,"context_line":"            for p in ports:"},{"line_number":556,"context_line":"                if self._get_vm_port_hostid(context, p[\u0027id\u0027], p) \u003d\u003d host_id:"},{"line_number":557,"context_line":"                    self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":558,"context_line":"                    return"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_bf367a01","line":556,"updated":"2015-06-30 08:52:38.000000000","message":"we already filtered needed ports, so no need to call self._get_vm_port_hostid(), can just compare p[portbindings.HOST_ID] to make code more clear.","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"05ce9c6915bae475e11bd17406329ded343ef212","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":554,"context_line":"        else:"},{"line_number":555,"context_line":"            for p in ports:"},{"line_number":556,"context_line":"                if self._get_vm_port_hostid(context, p[\u0027id\u0027], p) \u003d\u003d host_id:"},{"line_number":557,"context_line":"                    self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":558,"context_line":"                    return"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_5b9ba272","line":556,"in_reply_to":"ba3cc151_bf367a01","updated":"2015-06-30 19:15:35.000000000","message":"will fix it.","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ce69f7048f9e47e617aeeebc7e739093d964447d","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            router.gw_port and router.gw_port[\u0027network_id\u0027] !\u003d new_network)"},{"line_number":161,"context_line":"        gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":162,"context_line":"        if gw_port_id:"},{"line_number":163,"context_line":"            gw_ext_net_id \u003d router.gw_port.get(\u0027network_id\u0027)"},{"line_number":164,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"},{"line_number":165,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":166,"context_line":"                                            router, new_network)"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba3cc151_2556262a","line":163,"updated":"2015-07-09 19:17:03.000000000","message":"I think these three lines are equivalent to this:\n\ngw_ext_net_id \u003d router.gw_port[\u0027network_id\u0027] if router.gw_port else None\n\nThen you could remove the port_requires_deletion check and just use this below:\n\nif gw_ext_net_id and gw_ext_net_id !\u003d new_network\n\nI understand it\u0027s duplicating what _delete_current_gw_port() does, but it seems strange to me to have it return something (like the net_id) if it decides to remove the port.","commit_id":"e8c336d4b663ccda4945655ab76afc29812044b8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"54c42575493663533959696850b75c2090c70794","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            router.gw_port and router.gw_port[\u0027network_id\u0027] !\u003d new_network)"},{"line_number":161,"context_line":"        gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":162,"context_line":"        if gw_port_id:"},{"line_number":163,"context_line":"            gw_ext_net_id \u003d router.gw_port.get(\u0027network_id\u0027)"},{"line_number":164,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"},{"line_number":165,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":166,"context_line":"                                            router, new_network)"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba3cc151_eb61ef39","line":163,"in_reply_to":"ba3cc151_2556262a","updated":"2015-07-09 19:55:51.000000000","message":"Done","commit_id":"e8c336d4b663ccda4945655ab76afc29812044b8"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ce69f7048f9e47e617aeeebc7e739093d964447d","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":559,"context_line":"        else:"},{"line_number":560,"context_line":"            for p in ports:"},{"line_number":561,"context_line":"                if p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":562,"context_line":"                    self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":563,"context_line":"                    return"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ba3cc151_99cbe171","line":561,"updated":"2015-07-09 19:17:03.000000000","message":"I\u0027m sure there\u0027s some fancier way to not duplicate code here, I think this might work:\n\nfor p in ports:\n    if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:\n        delete()\n        return if host_id","commit_id":"e8c336d4b663ccda4945655ab76afc29812044b8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"54c42575493663533959696850b75c2090c70794","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":559,"context_line":"        else:"},{"line_number":560,"context_line":"            for p in ports:"},{"line_number":561,"context_line":"                if p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":562,"context_line":"                    self._core_plugin._delete_port(context, p[\u0027id\u0027])"},{"line_number":563,"context_line":"                    return"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ba3cc151_ab576758","line":561,"in_reply_to":"ba3cc151_99cbe171","updated":"2015-07-09 19:55:51.000000000","message":"Done","commit_id":"e8c336d4b663ccda4945655ab76afc29812044b8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bf7ded39da9f0a0ef4d2774da01a322feb880ebd","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when it is the last gateway port in the"},{"line_number":167,"context_line":"            # given external network."},{"line_number":168,"context_line":"            filters \u003d {\u0027network_id\u0027: [gw_ext_net_id],"},{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_aac9907b","line":167,"updated":"2015-07-10 05:32:01.000000000","message":"In practice, I would never expect this to happen.  You might consider deleting the ports when the network is deleted.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d222c59ab09609d1f1ba3220d9056fd900d4777","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                context.elevated(), router)"},{"line_number":165,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"},{"line_number":166,"context_line":"            # on all hosts when it is the last gateway port in the"},{"line_number":167,"context_line":"            # given external network."},{"line_number":168,"context_line":"            filters \u003d {\u0027network_id\u0027: [gw_ext_net_id],"},{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_435bf1f6","line":167,"in_reply_to":"ba3cc151_aac9907b","updated":"2015-07-10 16:51:39.000000000","message":"I don\u0027t see any difference between handling it here and handling it in external network delete.\nBecause when we delete the external network naturally we will be removing the gateway port and when gateway port is removed, this condition will be staisfied.\nAm I missing something here?","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b50eb29ab86a9f27ca04a7e33195b2a5301da475","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                            vm_hostid))"},{"line_number":250,"context_line":"                    LOG.debug(\"FIP Agent gateway port: %s\", fip_agent_port)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def _clear_unused_fip_agent_gw_port("},{"line_number":253,"context_line":"            self, context, floatingip_db):"},{"line_number":254,"context_line":"        \"\"\"Helper function to check for fip agent gw port and delete."},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_ca8094c2","line":252,"updated":"2015-07-10 05:38:29.000000000","message":"The commit message makes me think that this should have gone away.  I\u0027m a little confused.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d222c59ab09609d1f1ba3220d9056fd900d4777","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                            vm_hostid))"},{"line_number":250,"context_line":"                    LOG.debug(\"FIP Agent gateway port: %s\", fip_agent_port)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def _clear_unused_fip_agent_gw_port("},{"line_number":253,"context_line":"            self, context, floatingip_db):"},{"line_number":254,"context_line":"        \"\"\"Helper function to check for fip agent gw port and delete."},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_03d96983","line":252,"in_reply_to":"ba3cc151_ca8094c2","updated":"2015-07-10 16:51:39.000000000","message":"This function is removed in the child patch. This is the parent patch were I introduce deleting based on the last gateway port being deleted on the external network.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bf7ded39da9f0a0ef4d2774da01a322feb880ebd","unresolved":false,"context_lines":[{"line_number":545,"context_line":"        \"\"\"Function to delete FIP gateway port with given ext_net_id.\"\"\""},{"line_number":546,"context_line":"        # delete any fip agent gw port"},{"line_number":547,"context_line":"        device_filter \u003d {\u0027device_owner\u0027: [DEVICE_OWNER_AGENT_GW],"},{"line_number":548,"context_line":"                         \u0027network_id\u0027: [ext_net_id]}"},{"line_number":549,"context_line":"        ports \u003d self._core_plugin.get_ports(context,"},{"line_number":550,"context_line":"                                            filters\u003ddevice_filter)"},{"line_number":551,"context_line":"        for p in ports:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_4a748435","line":548,"updated":"2015-07-10 05:32:01.000000000","message":"We should be able to include the host in the query to avoid getting all ports back when only deleting for a given host.  Given that the original was this way too, I guess it is out of the scope of this patch.  It would make a good follow-on.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d222c59ab09609d1f1ba3220d9056fd900d4777","unresolved":false,"context_lines":[{"line_number":545,"context_line":"        \"\"\"Function to delete FIP gateway port with given ext_net_id.\"\"\""},{"line_number":546,"context_line":"        # delete any fip agent gw port"},{"line_number":547,"context_line":"        device_filter \u003d {\u0027device_owner\u0027: [DEVICE_OWNER_AGENT_GW],"},{"line_number":548,"context_line":"                         \u0027network_id\u0027: [ext_net_id]}"},{"line_number":549,"context_line":"        ports \u003d self._core_plugin.get_ports(context,"},{"line_number":550,"context_line":"                                            filters\u003ddevice_filter)"},{"line_number":551,"context_line":"        for p in ports:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ba3cc151_839ed9b6","line":548,"in_reply_to":"ba3cc151_4a748435","updated":"2015-07-10 16:51:39.000000000","message":"Good suggestion. We submit a follow on patch.","commit_id":"fce0efd77d54fa8894171b1a76c8805d71ea80a3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0220da170859c043b174d04c1ba743a7043a4985","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a41bdd9_3ff6bed7","line":172,"updated":"2015-07-14 04:19:00.000000000","message":"Should this be \u003d\u003d 0?  Already called delete_current_gw_port and delete_csnat_router_interface_ports.  So, if this query finds one, wouldn\u0027t it be for a different router?","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"049e1fcb097fb7c7b917a370123c160b7c7653cd","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a41bdd9_b1193124","line":172,"in_reply_to":"9a41bdd9_2d8e58d0","updated":"2015-07-15 23:37:06.000000000","message":"Yes you are right, if the super class have already deleted it, then we can only check for \u003d\u003d 0.","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"049e1fcb097fb7c7b917a370123c160b7c7653cd","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a41bdd9_d114f5e9","line":172,"in_reply_to":"9a41bdd9_3ff6bed7","updated":"2015-07-15 23:37:06.000000000","message":"Yes I understood what you are saying.\nWe only need to delete the agent gateway port when the count \u003d\u003d 0 and not when count\u003d\u003d1.","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e46e0f468042ded8f8301a16b6ad2c8209ea785","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a41bdd9_5deb6678","line":172,"in_reply_to":"9a41bdd9_3ff6bed7","updated":"2015-07-14 18:11:42.000000000","message":"Yes for this given router, the gateway ports are already deleted, but the check here is making sure that this is the last gateway port for the given external_network irrespective of the router.\nSo the length\u003d\u003d1 makes sense here.","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b382cbe088fdfcebb9fd998af315462f2ba7af12","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a41bdd9_2d8e58d0","line":172,"in_reply_to":"9a41bdd9_5deb6678","updated":"2015-07-15 07:28:55.000000000","message":"Not sure I understood the answer: which port is it (\u003d\u003d1) if for current routrer  gw port was deleted already?","commit_id":"64c8dfe0c26acc2a35d3c3d97fc2b272b56295ec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"24567b30d18b76b863b77d062f00996cda2dea1d","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_ed6950fa","line":172,"updated":"2015-07-15 07:29:27.000000000","message":"please see comment in PS 21","commit_id":"e3ab440f0096f4ff341e3d52b4b59707d117c901"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"704ef42e06b2573f799d47366979be040f17b117","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if len(ext_net_gw_ports) \u003d\u003d 1:"},{"line_number":173,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"9a41bdd9_91a74dbc","line":172,"in_reply_to":"9a41bdd9_ed6950fa","updated":"2015-07-15 23:37:54.000000000","message":"Yes addressed the PS21 review comments in the latest patch.","commit_id":"e3ab440f0096f4ff341e3d52b4b59707d117c901"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e0e03bbf2b4f18822e675425eeb06974751eaa3e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if not len(ext_net_gw_ports):"},{"line_number":173,"context_line":"                self.delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a41bdd9_04989d69","line":172,"updated":"2015-07-17 02:13:19.000000000","message":"nit: calling len here is redundant.","commit_id":"d1b832c95cffebee4f8425532c59908753873c10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a02522f197e52b491c511a088cf28444b6c4199e","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                       \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":170,"context_line":"            ext_net_gw_ports \u003d self._core_plugin.get_ports("},{"line_number":171,"context_line":"                context.elevated(), filters)"},{"line_number":172,"context_line":"            if not len(ext_net_gw_ports):"},{"line_number":173,"context_line":"                self.delete_floatingip_agent_gateway_port("},{"line_number":174,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a41bdd9_b1d1c8fd","line":172,"in_reply_to":"9a41bdd9_04989d69","updated":"2015-07-17 16:58:16.000000000","message":"Done","commit_id":"d1b832c95cffebee4f8425532c59908753873c10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e0e03bbf2b4f18822e675425eeb06974751eaa3e","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            context, fip_hostid, floatingip_db[\u0027floating_network_id\u0027]):"},{"line_number":266,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port for ext-net: \u0027"},{"line_number":267,"context_line":"                      \u0027%s\u0027, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":268,"context_line":"            self.delete_floatingip_agent_gateway_port("},{"line_number":269,"context_line":"                context, fip_hostid, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def delete_floatingip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a41bdd9_84da6d16","line":268,"updated":"2015-07-17 02:13:19.000000000","message":"I don\u0027t understand why you\u0027re removing the _ from the name of this method.  From what I can see, it is still only called from within this class.  Is that correct?  Changing it creates noise in the patch.","commit_id":"d1b832c95cffebee4f8425532c59908753873c10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a02522f197e52b491c511a088cf28444b6c4199e","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            context, fip_hostid, floatingip_db[\u0027floating_network_id\u0027]):"},{"line_number":266,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port for ext-net: \u0027"},{"line_number":267,"context_line":"                      \u0027%s\u0027, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":268,"context_line":"            self.delete_floatingip_agent_gateway_port("},{"line_number":269,"context_line":"                context, fip_hostid, floatingip_db[\u0027floating_network_id\u0027])"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def delete_floatingip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a41bdd9_71db401c","line":268,"in_reply_to":"9a41bdd9_84da6d16","updated":"2015-07-17 16:58:16.000000000","message":"Done","commit_id":"d1b832c95cffebee4f8425532c59908753873c10"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"609d5f0fdef089a811c559e0e6b60882f586f65c","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        for p in ports:"},{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"            if host_id:"},{"line_number":570,"context_line":"                return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("}],"source_content_type":"text/x-python","patch_set":39,"id":"fa1b9901_0562a6ad","line":569,"updated":"2015-08-18 21:35:08.000000000","message":"This doesn\u0027t seem correct, looks like this needs to be indented to only be checked in the delete_port() case.\n\nSay there are three compute nodes involved here, called c1, c2 and c3, and this method is called with host_id\u003dc3\n\nThis loop should go through all the ports, calling delete_port() on c3, then return.  But if the first port[\u0027host_id\u0027] value is c1, it will return early because host_id was passed.\n\nYou should also add a test to catch this, or modify an existing one to have multiple ports.","commit_id":"20447e910eaac447e4fcb0707bfd257b051a0fed"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"baf1280b724f0fc5ceb6ba93be1742b67d1d3bc2","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        for p in ports:"},{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"            if host_id:"},{"line_number":570,"context_line":"                return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("}],"source_content_type":"text/x-python","patch_set":39,"id":"fa1b9901_8d27bc11","line":569,"in_reply_to":"fa1b9901_0562a6ad","updated":"2015-08-18 23:11:11.000000000","message":"brain thanks I suspected some issue in this code, but this was your recommendation that you did early.\nI will try to fix it.","commit_id":"20447e910eaac447e4fcb0707bfd257b051a0fed"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"bd1451155b1b5feb0ba9dfa42306917d3500c597","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        for p in ports:"},{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"            if host_id:"},{"line_number":570,"context_line":"                return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("}],"source_content_type":"text/x-python","patch_set":39,"id":"fa1b9901_5035bbd7","line":569,"in_reply_to":"fa1b9901_8d27bc11","updated":"2015-08-18 23:25:01.000000000","message":"Yes in patch set 17 your comments have the right indent, and I have missed it.","commit_id":"20447e910eaac447e4fcb0707bfd257b051a0fed"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"bc3389a0ab768d4e184f7905f5e4e7fb387aed56","unresolved":false,"context_lines":[{"line_number":45,"context_line":"FLOATINGIP_AGENT_INTF_KEY \u003d l3_const.FLOATINGIP_AGENT_INTF_KEY"},{"line_number":46,"context_line":"DEVICE_OWNER_AGENT_GW \u003d l3_const.DEVICE_OWNER_AGENT_GW"},{"line_number":47,"context_line":"SNAT_ROUTER_INTF_KEY \u003d l3_const.SNAT_ROUTER_INTF_KEY"},{"line_number":48,"context_line":"DEVICE_OWNER_ROUTER_GW \u003d l3_const.DEVICE_OWNER_ROUTER_GW"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"router_distributed_opts \u003d ["},{"line_number":51,"context_line":"    cfg.BoolOpt(\u0027router_distributed\u0027,"}],"source_content_type":"text/x-python","patch_set":45,"id":"fa1b9901_3457ad5b","line":48,"updated":"2015-08-25 16:12:32.000000000","message":"There\u0027s another change that\u0027s removing all these, so lets not add new ones.  https://review.openstack.org/#/c/213563/","commit_id":"6d744a2000e34ab634f536d589cbb273e21e086e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f8b9f0548804380882e8526aaa00588777ce56cd","unresolved":false,"context_lines":[{"line_number":45,"context_line":"FLOATINGIP_AGENT_INTF_KEY \u003d l3_const.FLOATINGIP_AGENT_INTF_KEY"},{"line_number":46,"context_line":"DEVICE_OWNER_AGENT_GW \u003d l3_const.DEVICE_OWNER_AGENT_GW"},{"line_number":47,"context_line":"SNAT_ROUTER_INTF_KEY \u003d l3_const.SNAT_ROUTER_INTF_KEY"},{"line_number":48,"context_line":"DEVICE_OWNER_ROUTER_GW \u003d l3_const.DEVICE_OWNER_ROUTER_GW"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"router_distributed_opts \u003d ["},{"line_number":51,"context_line":"    cfg.BoolOpt(\u0027router_distributed\u0027,"}],"source_content_type":"text/x-python","patch_set":45,"id":"fa1b9901_f82e038b","line":48,"in_reply_to":"fa1b9901_3457ad5b","updated":"2015-08-25 18:26:18.000000000","message":"Ok I will fix here to just use the l3_const instead of the local variable.","commit_id":"6d744a2000e34ab634f536d589cbb273e21e086e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c4d6deb3c2401236ab699c685200f0b611b3f579","unresolved":false,"context_lines":[{"line_number":161,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":162,"context_line":"                                            router, new_network)"},{"line_number":163,"context_line":"        if (gw_ext_net_id and gw_ext_net_id !\u003d new_network and"},{"line_number":164,"context_line":"            router.extra_attributes.distributed):"},{"line_number":165,"context_line":"            self.delete_csnat_router_interface_ports("},{"line_number":166,"context_line":"                context.elevated(), router)"},{"line_number":167,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_f4d97184","line":164,"updated":"2015-08-27 20:52:45.000000000","message":"nit:  I think I\u0027d keep the check for distributed first in the boolean to make it clear up front that this only applies to distributed.\n\nBut, it is just a nit.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8bde470b39e0f03fafec92be197d32d4ffced9bc","unresolved":false,"context_lines":[{"line_number":161,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":162,"context_line":"                                            router, new_network)"},{"line_number":163,"context_line":"        if (gw_ext_net_id and gw_ext_net_id !\u003d new_network and"},{"line_number":164,"context_line":"            router.extra_attributes.distributed):"},{"line_number":165,"context_line":"            self.delete_csnat_router_interface_ports("},{"line_number":166,"context_line":"                context.elevated(), router)"},{"line_number":167,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_e304507f","line":164,"in_reply_to":"da20952f_f4d97184","updated":"2015-08-27 23:16:34.000000000","message":"Done","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a94f3ee98ebb8da0e7f3c62fa0b51bbc3bf8fc53","unresolved":false,"context_lines":[{"line_number":161,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":162,"context_line":"                                            router, new_network)"},{"line_number":163,"context_line":"        if (gw_ext_net_id and gw_ext_net_id !\u003d new_network and"},{"line_number":164,"context_line":"            router.extra_attributes.distributed):"},{"line_number":165,"context_line":"            self.delete_csnat_router_interface_ports("},{"line_number":166,"context_line":"                context.elevated(), router)"},{"line_number":167,"context_line":"            # NOTE(Swami): Delete the Floatingip agent gateway port"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_af9ba071","line":164,"in_reply_to":"da20952f_f4d97184","updated":"2015-08-27 21:00:30.000000000","message":"can fix it.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c4d6deb3c2401236ab699c685200f0b611b3f579","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                context.elevated(), filters)"},{"line_number":174,"context_line":"            if not ext_net_gw_ports:"},{"line_number":175,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":176,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"},{"line_number":179,"context_line":"                        ext_ips):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_f4fe5137","line":176,"updated":"2015-08-27 20:52:45.000000000","message":"nit:  Seeing None as a positional argument isn\u0027t helpful.  Could you convert to named arguments for clarity?\n\n  self._delete_floatingip_agent_gateway_port(\n      context.elevated,\n      host_id\u003dNone,\n      ext_net_id\u003dgw_ext_net_id)","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b57ea172c2ebb246dfbf189152e874b2cfcf2853","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                context.elevated(), filters)"},{"line_number":174,"context_line":"            if not ext_net_gw_ports:"},{"line_number":175,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":176,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"},{"line_number":179,"context_line":"                        ext_ips):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_b9a66051","line":176,"in_reply_to":"da20952f_03086490","updated":"2015-08-28 16:51:46.000000000","message":"No need to change the order of the arguments or add a default value to the argument to address this comment.  All I meant was to suggest changing this call to look like the sample I provided above.  Being a nit, I wouldn\u0027t even insist.\n\nI find that a lot of python developers are under the mistaken impression that optional arguments with default values and keyword arguments are the same thing.  They aren\u0027t.  Any argument mentioned explicitly in the method signature can be passed as either positional or keyword.  The only restriction is that the positional ones need to come first starting with the first argument followed by the keyword arguments.  I prefer to pass arguments as keyword arguments in many places.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8bde470b39e0f03fafec92be197d32d4ffced9bc","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                context.elevated(), filters)"},{"line_number":174,"context_line":"            if not ext_net_gw_ports:"},{"line_number":175,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":176,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"},{"line_number":179,"context_line":"                        ext_ips):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_03086490","line":176,"in_reply_to":"da20952f_f4fe5137","updated":"2015-08-27 23:16:34.000000000","message":"Done","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a94f3ee98ebb8da0e7f3c62fa0b51bbc3bf8fc53","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                context.elevated(), filters)"},{"line_number":174,"context_line":"            if not ext_net_gw_ports:"},{"line_number":175,"context_line":"                self._delete_floatingip_agent_gateway_port("},{"line_number":176,"context_line":"                    context.elevated(), None, gw_ext_net_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _create_gw_port(self, context, router_id, router, new_network,"},{"line_number":179,"context_line":"                        ext_ips):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_cf96144c","line":176,"in_reply_to":"da20952f_f4fe5137","updated":"2015-08-27 21:00:30.000000000","message":"will fix this.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c4d6deb3c2401236ab699c685200f0b611b3f579","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"                if host_id:"},{"line_number":570,"context_line":"                    return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("},{"line_number":573,"context_line":"        self, context, network_id, host):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_af47204a","line":570,"updated":"2015-08-27 20:52:45.000000000","message":"nit:  This method is a bit difficult to understand.  Do we really need to return or could we just let the loop complete.  It might save some code readers from wondering \"why do we want to terminate the loop early only if host_id is set?\"  I wonder if the following is clearer:\n\n  if not host_id:\n      # If host_id isn\u0027t set, delete them all\n      for p in ports:\n          self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])\n  else:\n      # If host_id is set, only delete the one associated with it\n      for p in ports:\n          self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])\n          return\n\nI don\u0027t know, just thinking out loud.  I certainly won\u0027t hold you to taking this.  It is the same logic just presented in a little bit different way.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"3de799c0c66d3d37b0ebdd3d784939471710b255","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"                if host_id:"},{"line_number":570,"context_line":"                    return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("},{"line_number":573,"context_line":"        self, context, network_id, host):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_199e1507","line":570,"in_reply_to":"da20952f_5932a411","updated":"2015-08-31 19:33:06.000000000","message":"Yeah, this changed in PS10 based on someone\u0027s comment, I think I found a bug in a later patchset.  Either way, I\u0027ve gotten used to it 45 reviews later so am fine with it :)","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b57ea172c2ebb246dfbf189152e874b2cfcf2853","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"                if host_id:"},{"line_number":570,"context_line":"                    return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("},{"line_number":573,"context_line":"        self, context, network_id, host):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_5932a411","line":570,"in_reply_to":"da20952f_a3fe5869","updated":"2015-08-28 16:51:46.000000000","message":"I marked it a nit and so I won\u0027t insist or hold up the patch for this.  If Brian feels differently, that is fine.  I\u0027m all for making Brian happy when I get the chance.  :)","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8bde470b39e0f03fafec92be197d32d4ffced9bc","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"                if host_id:"},{"line_number":570,"context_line":"                    return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("},{"line_number":573,"context_line":"        self, context, network_id, host):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_a3fe5869","line":570,"in_reply_to":"da20952f_af47204a","updated":"2015-08-27 23:16:34.000000000","message":"Done","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a94f3ee98ebb8da0e7f3c62fa0b51bbc3bf8fc53","unresolved":false,"context_lines":[{"line_number":567,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":568,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":569,"context_line":"                if host_id:"},{"line_number":570,"context_line":"                    return"},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def create_fip_agent_gw_port_if_not_exists("},{"line_number":573,"context_line":"        self, context, network_id, host):"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_4fa204b0","line":570,"in_reply_to":"da20952f_af47204a","updated":"2015-08-27 21:00:30.000000000","message":"carl, I had it originally like this and it was based on brian haley\u0027s comment I have to change it to the existing format.\nDo you think I should revert back to where it was.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2812a77ea3a8cdf2ed1b651ad808b30bcf89dc52","unresolved":false,"context_lines":[{"line_number":557,"context_line":"            return False"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _delete_floatingip_agent_gateway_port("},{"line_number":560,"context_line":"        self, context, ext_net_id, host_id\u003dNone):"},{"line_number":561,"context_line":"        \"\"\"Function to delete FIP gateway port with given ext_net_id.\"\"\""},{"line_number":562,"context_line":"        # delete any fip agent gw port"},{"line_number":563,"context_line":"        device_filter \u003d {\u0027device_owner\u0027: [DEVICE_OWNER_AGENT_GW],"}],"source_content_type":"text/x-python","patch_set":53,"id":"da20952f_19d2ecd2","line":560,"updated":"2015-08-28 16:52:34.000000000","message":"No need to go through all of this in order to address my comment on PS52 L176.  See my follow-up comment there.","commit_id":"a2864fd60422487f127e9dc00100e9d10e15f536"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7ce4b2b6a32c9a175070b3e71e36046ae97c3fad","unresolved":false,"context_lines":[{"line_number":557,"context_line":"            return False"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _delete_floatingip_agent_gateway_port("},{"line_number":560,"context_line":"        self, context, ext_net_id, host_id\u003dNone):"},{"line_number":561,"context_line":"        \"\"\"Function to delete FIP gateway port with given ext_net_id.\"\"\""},{"line_number":562,"context_line":"        # delete any fip agent gw port"},{"line_number":563,"context_line":"        device_filter \u003d {\u0027device_owner\u0027: [DEVICE_OWNER_AGENT_GW],"}],"source_content_type":"text/x-python","patch_set":53,"id":"da20952f_d2fe85ad","line":560,"in_reply_to":"da20952f_19d2ecd2","updated":"2015-08-28 19:55:03.000000000","message":"Done","commit_id":"a2864fd60422487f127e9dc00100e9d10e15f536"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"680597512797b43321cfacc9c19566b335247c6b","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"},{"line_number":167,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":168,"context_line":"                                            router, new_network)"},{"line_number":169,"context_line":"        if (router.extra_attributes.distributed and"},{"line_number":170,"context_line":"            gw_ext_net_id !\u003d new_network):"},{"line_number":171,"context_line":"            self.delete_csnat_router_interface_ports("},{"line_number":172,"context_line":"                context.elevated(), router)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da20952f_05619511","line":169,"updated":"2015-09-08 12:50:15.000000000","message":"consider is_distributed_router(router)","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"19e69c03ee8f03221f6823616ffe42ac6684d8e3","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"},{"line_number":167,"context_line":"              self)._delete_current_gw_port(context, router_id,"},{"line_number":168,"context_line":"                                            router, new_network)"},{"line_number":169,"context_line":"        if (router.extra_attributes.distributed and"},{"line_number":170,"context_line":"            gw_ext_net_id !\u003d new_network):"},{"line_number":171,"context_line":"            self.delete_csnat_router_interface_ports("},{"line_number":172,"context_line":"                context.elevated(), router)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da20952f_4616a559","line":169,"in_reply_to":"da20952f_05619511","updated":"2015-09-08 18:46:02.000000000","message":"Done","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":16053,"name":"Pengtao Huang","email":"huangpengtao@huawei.com","username":"huangpengtao"},"change_message_id":"d2c5b2b32a2327a2abf613035d01418c11aac20b","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        for p in ports:"},{"line_number":573,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":574,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":575,"context_line":"                if host_id:"},{"line_number":576,"context_line":"                    return"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"    def create_fip_agent_gw_port_if_not_exists("}],"source_content_type":"text/x-python","patch_set":59,"id":"da20952f_76c63269","line":575,"updated":"2015-09-07 12:01:53.000000000","message":"if host_id is None, then the first port is deleted and return,what about the following ports?","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"19e69c03ee8f03221f6823616ffe42ac6684d8e3","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        for p in ports:"},{"line_number":573,"context_line":"            if not host_id or p[portbindings.HOST_ID] \u003d\u003d host_id:"},{"line_number":574,"context_line":"                self._core_plugin.ipam.delete_port(context, p[\u0027id\u0027])"},{"line_number":575,"context_line":"                if host_id:"},{"line_number":576,"context_line":"                    return"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"    def create_fip_agent_gw_port_if_not_exists("}],"source_content_type":"text/x-python","patch_set":59,"id":"da20952f_c60ab527","line":575,"in_reply_to":"da20952f_76c63269","updated":"2015-09-08 18:46:02.000000000","message":"If host_id is None, it deletes all ports.","commit_id":"96f97d4195ee4662c3ea60fe312f657732d1e07d"}],"neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7b694afe400951af58ca654efbc2dd22cc9c2f5b","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                net_id, agent_gw_port \u003d ("},{"line_number":195,"context_line":"                    self.setup_create_agent_gw_port_for_network("},{"line_number":196,"context_line":"                        network\u003dext_net))"},{"line_number":197,"context_line":"                return router1, router2, ext_net"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":200,"context_line":"        router1, router2, ext_net \u003d self._setup_routers_with_gateway()"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_dedc8ce6","line":197,"updated":"2015-08-27 20:21:03.000000000","message":"ext_net is used as a context guard variable in the with statement on L176.  What does it mean to return that from the method?  Normally, context variables don\u0027t live outside of with statements.  I\u0027m having trouble figuring out why these are created as context guards if it isn\u0027t to ensure the network gets cleaned up when the with statement exits.\n\nIt just looks odd to me.  I tried to verify if it was in fact wrong or not but I got a bit lost in the test framework.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a94f3ee98ebb8da0e7f3c62fa0b51bbc3bf8fc53","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                net_id, agent_gw_port \u003d ("},{"line_number":195,"context_line":"                    self.setup_create_agent_gw_port_for_network("},{"line_number":196,"context_line":"                        network\u003dext_net))"},{"line_number":197,"context_line":"                return router1, router2, ext_net"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":200,"context_line":"        router1, router2, ext_net \u003d self._setup_routers_with_gateway()"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_8fe81c12","line":197,"in_reply_to":"da20952f_dedc8ce6","updated":"2015-08-27 21:00:30.000000000","message":"Done","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c4d6deb3c2401236ab699c685200f0b611b3f579","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                net_id, agent_gw_port \u003d ("},{"line_number":195,"context_line":"                    self.setup_create_agent_gw_port_for_network("},{"line_number":196,"context_line":"                        network\u003dext_net))"},{"line_number":197,"context_line":"                return router1, router2, ext_net"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":200,"context_line":"        router1, router2, ext_net \u003d self._setup_routers_with_gateway()"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_f9d72abd","line":197,"in_reply_to":"da20952f_dedc8ce6","updated":"2015-08-27 20:52:45.000000000","message":"I just talked to amuller about this who shed some light on it.  These context guards formally tried to clean up by deleting resources on __exit__ but they no longer do [1].  Given this, it doesn\u0027t make sense to me to add more code that looks like it is using them as context guards.\n\nIn this case, it looks worse to use these like context guards and it makes the method confusing by return a context guard.  Please remove the use of the with statements and just assign local variables directly.\n\n  subnet1 \u003d self.subnet()\n  subnet2 \u003d self.subnet(...)\n  ...\n\n [1] https://github.com/openstack/neutron/blob/498d1c03c4/neutron/tests/unit/db/test_db_base_plugin_v2.py#L569","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"052bfd2654e0a8759bde5b4449113cadd9ee7c4e","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                net_id, agent_gw_port \u003d ("},{"line_number":195,"context_line":"                    self.setup_create_agent_gw_port_for_network("},{"line_number":196,"context_line":"                        network\u003dext_net))"},{"line_number":197,"context_line":"                return router1, router2, ext_net"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":200,"context_line":"        router1, router2, ext_net \u003d self._setup_routers_with_gateway()"}],"source_content_type":"text/x-python","patch_set":52,"id":"da20952f_d4422d3e","line":197,"in_reply_to":"da20952f_dedc8ce6","updated":"2015-08-27 20:30:24.000000000","message":"Ya I am supposed to return the external_net_id from this function.\nBut I was accidentally returning the context guard variable.\nWill fix it.","commit_id":"498d1c03c4250cffb399e02be72629bff4846405"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c33877194c107e160a69d9c640afc9f123dfc350","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":172,"context_line":"        with self.subnet() as subnet1, \\"},{"line_number":173,"context_line":"                self.subnet(cidr\u003d\u002720.0.0.0/24\u0027) as subnet2:"},{"line_number":174,"context_line":"            kwargs \u003d {\u0027arg_list\u0027: (external_net.EXTERNAL,),"},{"line_number":175,"context_line":"                      external_net.EXTERNAL: True}"},{"line_number":176,"context_line":"            with self.network(**kwargs) as ext_net, \\"}],"source_content_type":"text/x-python","patch_set":53,"id":"da20952f_895309e2","line":173,"updated":"2015-08-28 16:53:30.000000000","message":"I still don\u0027t think that new code should use these as context guards.","commit_id":"a2864fd60422487f127e9dc00100e9d10e15f536"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7ce4b2b6a32c9a175070b3e71e36046ae97c3fad","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_agent_gw_port_delete_when_last_gateway_for_ext_net_removed(self):"},{"line_number":172,"context_line":"        with self.subnet() as subnet1, \\"},{"line_number":173,"context_line":"                self.subnet(cidr\u003d\u002720.0.0.0/24\u0027) as subnet2:"},{"line_number":174,"context_line":"            kwargs \u003d {\u0027arg_list\u0027: (external_net.EXTERNAL,),"},{"line_number":175,"context_line":"                      external_net.EXTERNAL: True}"},{"line_number":176,"context_line":"            with self.network(**kwargs) as ext_net, \\"}],"source_content_type":"text/x-python","patch_set":53,"id":"da20952f_3224a15e","line":173,"in_reply_to":"da20952f_895309e2","updated":"2015-08-28 19:55:03.000000000","message":"Done","commit_id":"a2864fd60422487f127e9dc00100e9d10e15f536"}],"neutron/tests/unit/db/test_l3_dvr_db.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6788b0aff79b80d3068809763ccd4b9e94061ef9","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            self.assertTrue(cfips.called)"},{"line_number":245,"context_line":"            self.assertTrue(gvm.called)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _helper_delete_floatingip_agent_gateway_port(self, port_host):"},{"line_number":248,"context_line":"        port \u003d {"},{"line_number":249,"context_line":"            \u0027id\u0027: \u0027my_port_id\u0027,"},{"line_number":250,"context_line":"            \u0027binding:host_id\u0027: \u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_ba1d2875","line":247,"updated":"2015-06-30 08:52:38.000000000","message":"The tests below continue to use wrong testing pattern: mocking everything and then checking assert_called_onceю  I\u0027d ask to break this pattern here. DB tests should simply test db logic by inspecting proper db objects are created and deleted at certain moments.","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"05ce9c6915bae475e11bd17406329ded343ef212","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            self.assertTrue(cfips.called)"},{"line_number":245,"context_line":"            self.assertTrue(gvm.called)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _helper_delete_floatingip_agent_gateway_port(self, port_host):"},{"line_number":248,"context_line":"        port \u003d {"},{"line_number":249,"context_line":"            \u0027id\u0027: \u0027my_port_id\u0027,"},{"line_number":250,"context_line":"            \u0027binding:host_id\u0027: \u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_db01f26b","line":247,"in_reply_to":"ba3cc151_ba1d2875","updated":"2015-06-30 19:15:35.000000000","message":"Oleg, I think I mentioned this in my other patch review comment.\nAssaf has a patch that creates a class for running the db functional tests for DVR.\nOnce it goes in we can add test cases there to handle these tests.\n\nhttps://review.openstack.org/#/c/178880/","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2e8a38c4ca843a67525ffb7cfc369ab04c761392","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            self.assertTrue(cfips.called)"},{"line_number":245,"context_line":"            self.assertTrue(gvm.called)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _helper_delete_floatingip_agent_gateway_port(self, port_host):"},{"line_number":248,"context_line":"        port \u003d {"},{"line_number":249,"context_line":"            \u0027id\u0027: \u0027my_port_id\u0027,"},{"line_number":250,"context_line":"            \u0027binding:host_id\u0027: \u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_fc9ff04d","line":247,"in_reply_to":"ba3cc151_db01f26b","updated":"2015-07-01 10:07:11.000000000","message":"I don\u0027t see the value in adding tests that should be rewritten anyway. Will add Assaf to this review","commit_id":"2a33393ae04d3ba94b839e04c51fc43c4747b5b5"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c3293ac836738e45746022113e85efe1a331d961","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        plugin.get_ports.assert_called_with(self.ctx, filters\u003d{"},{"line_number":286,"context_line":"            \u0027network_id\u0027: [\u0027network_id\u0027],"},{"line_number":287,"context_line":"            \u0027device_owner\u0027: [l3_const.DEVICE_OWNER_AGENT_GW]})"},{"line_number":288,"context_line":"        plugin.ipam.delete_port.assert_called_with(self.ctx, \u0027my_port_id\u0027)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def test__delete_floatingip_agent_gateway_port_without_host_id(self):"},{"line_number":291,"context_line":"        self._helper_delete_floatingip_agent_gateway_port(None)"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a50d1a3_3457af03","line":288,"updated":"2015-07-27 16:19:35.000000000","message":"the port has network_id\u003d\u0027ext_network_id\u0027 while the _delete_floatingip_agent_gateway_port() is called with \u0027network_id\u0027 and still the tests pass. I believe this is the consequence of \u0027mock all\u0027 testing approach. I can make this one as parent -  https://review.openstack.org/#/c/205531  - and come up with tests which will check proper ports creation and deletion in DB so we don\u0027t need to mock much. Will this be ok with you?","commit_id":"0b32137fb56c5fb3c51b0835a274b77dda600169"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"af4aaf8d69544492b82082ddd0902a6cead144b7","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        plugin.get_ports.assert_called_with(self.ctx, filters\u003d{"},{"line_number":286,"context_line":"            \u0027network_id\u0027: [\u0027network_id\u0027],"},{"line_number":287,"context_line":"            \u0027device_owner\u0027: [l3_const.DEVICE_OWNER_AGENT_GW]})"},{"line_number":288,"context_line":"        plugin.ipam.delete_port.assert_called_with(self.ctx, \u0027my_port_id\u0027)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def test__delete_floatingip_agent_gateway_port_without_host_id(self):"},{"line_number":291,"context_line":"        self._helper_delete_floatingip_agent_gateway_port(None)"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa1b9901_b2c57f5c","line":288,"in_reply_to":"3a50d1a3_3457af03","updated":"2015-08-17 19:30:33.000000000","message":"yes it would be ok with me.","commit_id":"0b32137fb56c5fb3c51b0835a274b77dda600169"}]}
