)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":16,"context_line":"delete the namespace when the gateway is cleared."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Icb00297208813436c2a9e9a003275462293ad643"},{"line_number":19,"context_line":"Closes-Bug: #1590041"},{"line_number":20,"context_line":"Closes-Bug: #1557909"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_b1c5da0b","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":20},"updated":"2016-06-09 10:23:49.000000000","message":"this was closed with revert already","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":16,"context_line":"delete the namespace when the gateway is cleared."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Icb00297208813436c2a9e9a003275462293ad643"},{"line_number":19,"context_line":"Closes-Bug: #1590041"},{"line_number":20,"context_line":"Closes-Bug: #1557909"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_1b4b0b5b","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":20},"in_reply_to":"7aa08908_b1c5da0b","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"47ae6410504d69553e8a4b11834f3d84b6e46f84","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hpe.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-06-09 15:04:09 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DVR: Add exists method to namespace class to check"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There is no clear way to distinguish when the snat_namespace"},{"line_number":10,"context_line":"object is initialized and when the actual namespace is created."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"7aa08908_06b712f6","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":50},"updated":"2016-06-10 09:29:09.000000000","message":"the commit message should be updated to fully describe the fix for the bug","commit_id":"1e8a950229339835d2eb6a9f2e94cacf468213fa"}],"neutron/agent/l3/agent.py":[{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"00c1409cbdd2951e2fe9233562139f1f5d032edb","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                        # need to keep fip namespaces as well"},{"line_number":548,"context_line":"                        ext_net_id \u003d (r[\u0027external_gateway_info\u0027] or {}).get("},{"line_number":549,"context_line":"                            \u0027network_id\u0027)"},{"line_number":550,"context_line":"                        if ext_net_id:"},{"line_number":551,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":552,"context_line":"                        if (not ext_net_id and"},{"line_number":553,"context_line":"                            (self.conf.agent_mode \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_9d97588f","line":550,"range":{"start_line":550,"start_character":24,"end_line":550,"end_character":38},"updated":"2016-07-12 16:23:23.000000000","message":"I may have another issue here to deal with, since it just checks for the existence of the ext_net_id to keep the namespaces, in case if I need to check for ext_net_id and different gw_port_host then this might still be a compute host, where you wanted to retain the fipnamespaces.\n\nLet me know your thoughts.","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                        # need to keep fip namespaces as well"},{"line_number":547,"context_line":"                        ext_net_id \u003d (r[\u0027external_gateway_info\u0027] or {}).get("},{"line_number":548,"context_line":"                            \u0027network_id\u0027)"},{"line_number":549,"context_line":"                        if ext_net_id:"},{"line_number":550,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":551,"context_line":"                        # need to remove the snat_namespace for the router"},{"line_number":552,"context_line":"                        # for both cases below"},{"line_number":553,"context_line":"                        if (not ext_net_id and"},{"line_number":554,"context_line":"                            (self.conf.agent_mode \u003d\u003d"},{"line_number":555,"context_line":"                                l3_constants.L3_AGENT_MODE_DVR_SNAT)):"},{"line_number":556,"context_line":"                            ns_manager.ensure_router_snat_namespace_cleanup("},{"line_number":557,"context_line":"                                r[\u0027id\u0027])"},{"line_number":558,"context_line":"                        if (ext_net_id and r.get(\u0027gw_port_host\u0027) !\u003d self.host"},{"line_number":559,"context_line":"                            and (self.conf.agent_mode \u003d\u003d"},{"line_number":560,"context_line":"                                l3_constants.L3_AGENT_MODE_DVR_SNAT)):"},{"line_number":561,"context_line":"                            ns_manager.ensure_router_snat_namespace_cleanup("},{"line_number":562,"context_line":"                                r[\u0027id\u0027])"},{"line_number":563,"context_line":"                    update \u003d queue.RouterUpdate("},{"line_number":564,"context_line":"                        r[\u0027id\u0027],"},{"line_number":565,"context_line":"                        queue.PRIORITY_SYNC_ROUTERS_TASK,"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_f8b7661e","line":562,"range":{"start_line":549,"start_character":24,"end_line":562,"end_character":40},"updated":"2016-07-13 08:38:06.000000000","message":"Consider for less LOC:\n \n is_snat_agent \u003d self.conf.agent_mode \u003d\u003d l3_constants.L3_AGENT_MODE_DVR_SNAT\n if ext_net_id:\n     ns_manager.keep_ext_net(ext_net_id)\n     if is_snat_agent and r.get(\u0027gw_port_host\u0027) !\u003d self.host:\n         ns_manager.ensure_router_snat_namespace_cleanup(r[\u0027id\u0027])\n elif is_nat_agent:\n     ns_manager.ensure_router_snat_namespace_cleanup(r[\u0027id\u0027])","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":546,"context_line":"                        # need to keep fip namespaces as well"},{"line_number":547,"context_line":"                        ext_net_id \u003d (r[\u0027external_gateway_info\u0027] or {}).get("},{"line_number":548,"context_line":"                            \u0027network_id\u0027)"},{"line_number":549,"context_line":"                        if ext_net_id:"},{"line_number":550,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":551,"context_line":"                        # need to remove the snat_namespace for the router"},{"line_number":552,"context_line":"                        # for both cases below"},{"line_number":553,"context_line":"                        if (not ext_net_id and"},{"line_number":554,"context_line":"                            (self.conf.agent_mode \u003d\u003d"},{"line_number":555,"context_line":"                                l3_constants.L3_AGENT_MODE_DVR_SNAT)):"},{"line_number":556,"context_line":"                            ns_manager.ensure_router_snat_namespace_cleanup("},{"line_number":557,"context_line":"                                r[\u0027id\u0027])"},{"line_number":558,"context_line":"                        if (ext_net_id and r.get(\u0027gw_port_host\u0027) !\u003d self.host"},{"line_number":559,"context_line":"                            and (self.conf.agent_mode \u003d\u003d"},{"line_number":560,"context_line":"                                l3_constants.L3_AGENT_MODE_DVR_SNAT)):"},{"line_number":561,"context_line":"                            ns_manager.ensure_router_snat_namespace_cleanup("},{"line_number":562,"context_line":"                                r[\u0027id\u0027])"},{"line_number":563,"context_line":"                    update \u003d queue.RouterUpdate("},{"line_number":564,"context_line":"                        r[\u0027id\u0027],"},{"line_number":565,"context_line":"                        queue.PRIORITY_SYNC_ROUTERS_TASK,"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_20d8707f","line":562,"range":{"start_line":549,"start_character":24,"end_line":562,"end_character":40},"in_reply_to":"1aa78d24_f8b7661e","updated":"2016-07-13 19:37:33.000000000","message":"Yes will fix it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"53dcc311a61a19778f3b9a663c2c3d76979d8225","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                            l3_constants.L3_AGENT_MODE_DVR_SNAT)"},{"line_number":551,"context_line":"                        if ext_net_id:"},{"line_number":552,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":553,"context_line":"                            if (is_snat_agent and"},{"line_number":554,"context_line":"                                r.get(\u0027gw_port_host\u0027) !\u003d self.host):"},{"line_number":555,"context_line":"                                ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"},{"line_number":556,"context_line":"                        elif is_snat_agent:"},{"line_number":557,"context_line":"                            ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_30edaeb7","line":554,"range":{"start_line":553,"start_character":28,"end_line":554,"end_character":68},"updated":"2016-07-21 08:25:38.000000000","message":"I believe this case should be handled by DvrEdgeRouter.external_gateway_added() as there could be a conflict in case when agent wasn\u0027t restarted and RouterInfo will try to remove snat namespace gracefully","commit_id":"68b5f511973e1244e6b6e3d58e4b2fba0485c78b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e91047fbfe507c779ba57b3985f7096d3625c57d","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                            l3_constants.L3_AGENT_MODE_DVR_SNAT)"},{"line_number":551,"context_line":"                        if ext_net_id:"},{"line_number":552,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":553,"context_line":"                            if (is_snat_agent and"},{"line_number":554,"context_line":"                                r.get(\u0027gw_port_host\u0027) !\u003d self.host):"},{"line_number":555,"context_line":"                                ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"},{"line_number":556,"context_line":"                        elif is_snat_agent:"},{"line_number":557,"context_line":"                            ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_e5301aeb","line":554,"range":{"start_line":553,"start_character":28,"end_line":554,"end_character":68},"in_reply_to":"dada55a8_30edaeb7","updated":"2016-07-22 16:21:49.000000000","message":"Yes that\u0027s where I had initially called this cleanup but you had concerns with it regarding having multiple snat_nodes and calling cleanup in every snat_nodes.","commit_id":"68b5f511973e1244e6b6e3d58e4b2fba0485c78b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"4c48f57a84d9bb4ff2d06930db81936336c84320","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                            l3_constants.L3_AGENT_MODE_DVR_SNAT)"},{"line_number":551,"context_line":"                        if ext_net_id:"},{"line_number":552,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":553,"context_line":"                            if (is_snat_agent and"},{"line_number":554,"context_line":"                                r.get(\u0027gw_port_host\u0027) !\u003d self.host):"},{"line_number":555,"context_line":"                                ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"},{"line_number":556,"context_line":"                        elif is_snat_agent:"},{"line_number":557,"context_line":"                            ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_e7573a00","line":554,"range":{"start_line":553,"start_character":28,"end_line":554,"end_character":68},"in_reply_to":"dada55a8_5f0f06e1","updated":"2016-07-25 15:51:20.000000000","message":"ok will fix it.","commit_id":"68b5f511973e1244e6b6e3d58e4b2fba0485c78b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8cb1355f8095389493cdb36966f99b3ea0931bbd","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                            l3_constants.L3_AGENT_MODE_DVR_SNAT)"},{"line_number":551,"context_line":"                        if ext_net_id:"},{"line_number":552,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":553,"context_line":"                            if (is_snat_agent and"},{"line_number":554,"context_line":"                                r.get(\u0027gw_port_host\u0027) !\u003d self.host):"},{"line_number":555,"context_line":"                                ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"},{"line_number":556,"context_line":"                        elif is_snat_agent:"},{"line_number":557,"context_line":"                            ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_5f0f06e1","line":554,"range":{"start_line":553,"start_character":28,"end_line":554,"end_character":68},"in_reply_to":"dada55a8_e5301aeb","updated":"2016-07-25 07:44:48.000000000","message":"My concern was calling cleanup on each router update (https://review.openstack.org/#/c/326729/22/neutron/agent/l3/router_info.py) even when snat was not rescheduled. Here I propose clearing snat when there is no external gw on a router during resync. Second case (when there is gw but scheduled to a different host) should be handled in DvrEdgeRouter.external_gateway_added() which should check if stale snat namespace exists.","commit_id":"68b5f511973e1244e6b6e3d58e4b2fba0485c78b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a435c0ce988258bde57bed24efdb6ac2ff2793eb","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                            l3_constants.L3_AGENT_MODE_DVR_SNAT)"},{"line_number":551,"context_line":"                        if ext_net_id:"},{"line_number":552,"context_line":"                            ns_manager.keep_ext_net(ext_net_id)"},{"line_number":553,"context_line":"                            if (is_snat_agent and"},{"line_number":554,"context_line":"                                r.get(\u0027gw_port_host\u0027) !\u003d self.host):"},{"line_number":555,"context_line":"                                ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"},{"line_number":556,"context_line":"                        elif is_snat_agent:"},{"line_number":557,"context_line":"                            ns_manager.ensure_snat_cleanup(r[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"dada55a8_28cc3a88","line":554,"range":{"start_line":553,"start_character":28,"end_line":554,"end_character":68},"in_reply_to":"dada55a8_e7573a00","updated":"2016-07-26 17:55:13.000000000","message":"Done","commit_id":"68b5f511973e1244e6b6e3d58e4b2fba0485c78b"}],"neutron/agent/l3/dvr_edge_ha_router.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"89f08b7241fb337d5d9eb4c1d4f853aaca8b22b6","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self._disable_ipv6_addressing_on_interface(interface_name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":76,"context_line":"        if ex_gw_port:"},{"line_number":77,"context_line":"            for port in self.snat_ports:"},{"line_number":78,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":79,"context_line":"                self.driver.unplug(snat_interface,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_03e627e7","line":76,"updated":"2016-06-09 08:50:47.000000000","message":"please add a unit test","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self._disable_ipv6_addressing_on_interface(interface_name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":76,"context_line":"        if ex_gw_port:"},{"line_number":77,"context_line":"            for port in self.snat_ports:"},{"line_number":78,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":79,"context_line":"                self.driver.unplug(snat_interface,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_31af2a2d","line":76,"range":{"start_line":76,"start_character":8,"end_line":76,"end_character":21},"updated":"2016-06-09 10:23:49.000000000","message":"this is being checked in base RouterInfo class, why need to recheck here?","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self._disable_ipv6_addressing_on_interface(interface_name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":76,"context_line":"        if ex_gw_port:"},{"line_number":77,"context_line":"            for port in self.snat_ports:"},{"line_number":78,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":79,"context_line":"                self.driver.unplug(snat_interface,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_fb5eff10","line":76,"range":{"start_line":76,"start_character":8,"end_line":76,"end_character":21},"in_reply_to":"7aa08908_31af2a2d","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"85e6da80ba508fd801631f968b9d31e4b7704730","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self._disable_ipv6_addressing_on_interface(interface_name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":76,"context_line":"        if ex_gw_port:"},{"line_number":77,"context_line":"            for port in self.snat_ports:"},{"line_number":78,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":79,"context_line":"                self.driver.unplug(snat_interface,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_a52bc293","line":76,"range":{"start_line":76,"start_character":8,"end_line":76,"end_character":21},"in_reply_to":"7aa08908_31af2a2d","updated":"2016-06-09 15:08:17.000000000","message":"During restart we don\u0027t have self.snat_ports, so when the call flow comes in here, it errors out.","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"47ae6410504d69553e8a4b11834f3d84b6e46f84","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                   namespace\u003dself.ha_namespace,"},{"line_number":85,"context_line":"                                   prefix\u003dconstants.SNAT_INT_DEV_PREFIX)"},{"line_number":86,"context_line":"                self._clear_vips(snat_interface)"},{"line_number":87,"context_line":"        super(DvrEdgeHaRouter, self)._external_gateway_removed("},{"line_number":88,"context_line":"            ex_gw_port, interface_name)"},{"line_number":89,"context_line":"        self._clear_vips(interface_name)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_0971e5a8","line":87,"range":{"start_line":87,"start_character":37,"end_line":87,"end_character":62},"updated":"2016-06-10 09:29:09.000000000","message":"should this call external_gateway_removed() rather than _external_gateway_removed() to actually remove the namespace?","commit_id":"1e8a950229339835d2eb6a9f2e94cacf468213fa"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b34ff9d3797ba44feb102ad44312353ebfb403da","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                   namespace\u003dself.ha_namespace,"},{"line_number":85,"context_line":"                                   prefix\u003dconstants.SNAT_INT_DEV_PREFIX)"},{"line_number":86,"context_line":"                self._clear_vips(snat_interface)"},{"line_number":87,"context_line":"        super(DvrEdgeHaRouter, self)._external_gateway_removed("},{"line_number":88,"context_line":"            ex_gw_port, interface_name)"},{"line_number":89,"context_line":"        self._clear_vips(interface_name)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_0fca6ca1","line":87,"range":{"start_line":87,"start_character":37,"end_line":87,"end_character":62},"in_reply_to":"7aa08908_0971e5a8","updated":"2016-06-10 17:21:52.000000000","message":"I don\u0027t want to change the flow at this time. this should not hurt.","commit_id":"1e8a950229339835d2eb6a9f2e94cacf468213fa"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7d070168564283b151e6e093457645d6e5054456","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                   namespace\u003dself.ha_namespace,"},{"line_number":85,"context_line":"                                   prefix\u003dconstants.SNAT_INT_DEV_PREFIX)"},{"line_number":86,"context_line":"                self._clear_vips(snat_interface)"},{"line_number":87,"context_line":"        super(DvrEdgeHaRouter, self)._external_gateway_removed("},{"line_number":88,"context_line":"            ex_gw_port, interface_name)"},{"line_number":89,"context_line":"        self._clear_vips(interface_name)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_8a9f6a5e","line":87,"range":{"start_line":87,"start_character":37,"end_line":87,"end_character":62},"in_reply_to":"7aa08908_0971e5a8","updated":"2016-06-10 17:43:35.000000000","message":"The reason they might have called the _external_gateway_removed here is, since the ha functionality uses the \u0027delete\u0027 function override to delete the snat_amespace.\n\nI am not sure if it would be appropriate to call the \u0027external_gateway_removed\u0027 here.\n\nLet me know you thoughts.","commit_id":"1e8a950229339835d2eb6a9f2e94cacf468213fa"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # Make sure we check for ex_gw_port again here, since there"},{"line_number":77,"context_line":"        # are cases were external_gateway_removed might be called"},{"line_number":78,"context_line":"        # to do the cleanup when ex_gw_port is None and when agent"},{"line_number":79,"context_line":"        # restarts the self.snat_ports will also be non-iterable."},{"line_number":80,"context_line":"        if ex_gw_port:"},{"line_number":81,"context_line":"            for port in self.snat_ports:"},{"line_number":82,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_107d681c","line":79,"range":{"start_line":79,"start_character":39,"end_line":79,"end_character":64},"updated":"2016-06-10 19:54:46.000000000","message":"I\u0027m not sure what this means.  Do you mean self.snat_ports is None or something?  Or, do you mean that self doesn\u0027t have a snat_ports attribute at all?","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c7e21ee936e17028ef3e673b855a2f66aafd9a53","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # Make sure we check for ex_gw_port again here, since there"},{"line_number":77,"context_line":"        # are cases were external_gateway_removed might be called"},{"line_number":78,"context_line":"        # to do the cleanup when ex_gw_port is None and when agent"},{"line_number":79,"context_line":"        # restarts the self.snat_ports will also be non-iterable."},{"line_number":80,"context_line":"        if ex_gw_port:"},{"line_number":81,"context_line":"            for port in self.snat_ports:"},{"line_number":82,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_9e31690e","line":79,"range":{"start_line":79,"start_character":39,"end_line":79,"end_character":64},"in_reply_to":"7aa08908_107d681c","updated":"2016-06-10 20:21:13.000000000","message":"for port in self.snat_ports:\n    TypeError: \u0027NoneType\u0027 object is not iterable","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # are cases were external_gateway_removed might be called"},{"line_number":78,"context_line":"        # to do the cleanup when ex_gw_port is None and when agent"},{"line_number":79,"context_line":"        # restarts the self.snat_ports will also be non-iterable."},{"line_number":80,"context_line":"        if ex_gw_port:"},{"line_number":81,"context_line":"            for port in self.snat_ports:"},{"line_number":82,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":83,"context_line":"                self.driver.unplug(snat_interface,"},{"line_number":84,"context_line":"                                   namespace\u003dself.ha_namespace,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_f0cc1c63","line":81,"range":{"start_line":80,"start_character":8,"end_line":81,"end_character":40},"updated":"2016-06-10 19:54:46.000000000","message":"It isn\u0027t clear to me exactly what the relationship is between ex_gw_port and whether self.snat_ports can / should be iterated and unplugged.  Wouldn\u0027t it be clearer to just check for self.snat_ports?","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c7e21ee936e17028ef3e673b855a2f66aafd9a53","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # are cases were external_gateway_removed might be called"},{"line_number":78,"context_line":"        # to do the cleanup when ex_gw_port is None and when agent"},{"line_number":79,"context_line":"        # restarts the self.snat_ports will also be non-iterable."},{"line_number":80,"context_line":"        if ex_gw_port:"},{"line_number":81,"context_line":"            for port in self.snat_ports:"},{"line_number":82,"context_line":"                snat_interface \u003d self._get_snat_int_device_name(port[\u0027id\u0027])"},{"line_number":83,"context_line":"                self.driver.unplug(snat_interface,"},{"line_number":84,"context_line":"                                   namespace\u003dself.ha_namespace,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_d9094b2e","line":81,"range":{"start_line":80,"start_character":8,"end_line":81,"end_character":40},"in_reply_to":"7aa08908_f0cc1c63","updated":"2016-06-10 20:21:13.000000000","message":"The snat_interface ports are passed as part of the gateway. If the gateway is absent they are not sent to the agent. \nBut the agent will have a cache of the working snat_ports and will use it for getting rid of the old snat port related rules that are no longer required.\nJust for your info.\n\nOk will just check for the self.snat_ports.","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e570af4472c0015e4b4d2aad059263fb7430baa0","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(DvrEdgeHaRouter, self).__init__(agent, host,"},{"line_number":32,"context_line":"                                              *args, **kwargs)"},{"line_number":33,"context_line":"        self.enable_snat \u003d None"},{"line_number":34,"context_line":"        self.snat_ports \u003d None"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @property"},{"line_number":37,"context_line":"    def ha_namespace(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"3aaa91ec_f6b6e688","line":34,"updated":"2016-06-22 20:17:03.000000000","message":"This should really be an empty list instead of adding L78, but that would have a ripple effect on other code that checks against None ?","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"621ffe06715ff01da2d8554a36faff92c57f83e9","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(DvrEdgeHaRouter, self).__init__(agent, host,"},{"line_number":32,"context_line":"                                              *args, **kwargs)"},{"line_number":33,"context_line":"        self.enable_snat \u003d None"},{"line_number":34,"context_line":"        self.snat_ports \u003d None"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @property"},{"line_number":37,"context_line":"    def ha_namespace(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_0c089890","line":34,"updated":"2016-07-05 21:24:43.000000000","message":"Perhaps make this [] ?  See my comment in other file.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"493b50204e9a79cef850bff8f2c74304208f7f7f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(DvrEdgeHaRouter, self).__init__(agent, host,"},{"line_number":32,"context_line":"                                              *args, **kwargs)"},{"line_number":33,"context_line":"        self.enable_snat \u003d None"},{"line_number":34,"context_line":"        self.snat_ports \u003d None"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @property"},{"line_number":37,"context_line":"    def ha_namespace(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_1ada534c","line":34,"in_reply_to":"1aa78d24_0c089890","updated":"2016-07-06 17:44:24.000000000","message":"Since we have declared this in dvr_local_router, I don\u0027t think we even need to declare it here.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"}],"neutron/agent/l3/dvr_edge_router.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9283b7e6ea74633d9cdca4f1d0355a3350d0438d","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":87,"context_line":"        if self.snat_namespace.exists():"},{"line_number":88,"context_line":"            self.snat_namespace.delete()"},{"line_number":89,"context_line":"            self.snat_namespace \u003d None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def internal_network_added(self, port):"},{"line_number":92,"context_line":"        super(DvrEdgeRouter, self).internal_network_added(port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_8dc9cfae","line":89,"updated":"2016-06-08 16:09:24.000000000","message":"If we are initializing this in init() and using .exists() then I don\u0027t think we should be setting this to None","commit_id":"e501d8e007185726155265b23c2851904b7dc476"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3fde90bc58c3ed834720d9d9e3accfc757e57225","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":87,"context_line":"        if self.snat_namespace.exists():"},{"line_number":88,"context_line":"            self.snat_namespace.delete()"},{"line_number":89,"context_line":"            self.snat_namespace \u003d None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def internal_network_added(self, port):"},{"line_number":92,"context_line":"        super(DvrEdgeRouter, self).internal_network_added(port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_ee75e663","line":89,"in_reply_to":"7aa08908_8dc9cfae","updated":"2016-06-08 16:49:26.000000000","message":"Let me check that behavior.","commit_id":"e501d8e007185726155265b23c2851904b7dc476"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9283b7e6ea74633d9cdca4f1d0355a3350d0438d","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self.snat_namespace \u003d dvr_snat_ns.SnatNamespace(self.router[\u0027id\u0027],"},{"line_number":165,"context_line":"                                                            self.agent_conf,"},{"line_number":166,"context_line":"                                                            self.driver,"},{"line_number":167,"context_line":"                                                            self.use_ipv6)"},{"line_number":168,"context_line":"        self.snat_namespace.create()"},{"line_number":169,"context_line":"        return self.snat_namespace"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_2a37e1ff","line":167,"updated":"2016-06-08 16:09:24.000000000","message":"Seems this can be removed based on above comment?","commit_id":"e501d8e007185726155265b23c2851904b7dc476"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f8c055b64f1c20e7d8f3febc6e6f5fd89651988e","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self.snat_namespace \u003d dvr_snat_ns.SnatNamespace(self.router[\u0027id\u0027],"},{"line_number":165,"context_line":"                                                            self.agent_conf,"},{"line_number":166,"context_line":"                                                            self.driver,"},{"line_number":167,"context_line":"                                                            self.use_ipv6)"},{"line_number":168,"context_line":"        self.snat_namespace.create()"},{"line_number":169,"context_line":"        return self.snat_namespace"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_1a29898a","line":167,"in_reply_to":"7aa08908_0e15d2e3","updated":"2016-06-08 18:46:46.000000000","message":"We don\u0027t need L163-167 or L89 if we are going to verify the existence at L87 instead of just looking at self.snat_namespace.","commit_id":"e501d8e007185726155265b23c2851904b7dc476"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3fde90bc58c3ed834720d9d9e3accfc757e57225","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self.snat_namespace \u003d dvr_snat_ns.SnatNamespace(self.router[\u0027id\u0027],"},{"line_number":165,"context_line":"                                                            self.agent_conf,"},{"line_number":166,"context_line":"                                                            self.driver,"},{"line_number":167,"context_line":"                                                            self.use_ipv6)"},{"line_number":168,"context_line":"        self.snat_namespace.create()"},{"line_number":169,"context_line":"        return self.snat_namespace"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_0e15d2e3","line":167,"in_reply_to":"7aa08908_2a37e1ff","updated":"2016-06-08 16:49:26.000000000","message":"which one do you want to remove? it is not clear, are you saying that we should remove #L163-164.","commit_id":"e501d8e007185726155265b23c2851904b7dc476"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        if not self._is_this_snat_host():"},{"line_number":53,"context_line":"            # no centralized SNAT gateway for this node/agent"},{"line_number":54,"context_line":"            LOG.debug(\"not hosting snat for router: %s\", self.router[\u0027id\u0027])"},{"line_number":55,"context_line":"            if self.snat_namespace and self.snat_namespace.exists():"},{"line_number":56,"context_line":"                LOG.debug(\"SNAT was rescheduled to host %s. Clearing snat \""},{"line_number":57,"context_line":"                          \"namespace.\", self.router.get(\u0027gw_port_host\u0027))"},{"line_number":58,"context_line":"                return self.external_gateway_removed("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_31760ad9","line":55,"range":{"start_line":55,"start_character":15,"end_line":55,"end_character":34},"updated":"2016-06-09 10:23:49.000000000","message":"this is created in constructor and never deleted so I guess we could omit this check","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        if not self._is_this_snat_host():"},{"line_number":53,"context_line":"            # no centralized SNAT gateway for this node/agent"},{"line_number":54,"context_line":"            LOG.debug(\"not hosting snat for router: %s\", self.router[\u0027id\u0027])"},{"line_number":55,"context_line":"            if self.snat_namespace and self.snat_namespace.exists():"},{"line_number":56,"context_line":"                LOG.debug(\"SNAT was rescheduled to host %s. Clearing snat \""},{"line_number":57,"context_line":"                          \"namespace.\", self.router.get(\u0027gw_port_host\u0027))"},{"line_number":58,"context_line":"                return self.external_gateway_removed("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_9b6d3bcf","line":55,"range":{"start_line":55,"start_character":15,"end_line":55,"end_character":34},"in_reply_to":"7aa08908_31760ad9","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"85e6da80ba508fd801631f968b9d31e4b7704730","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        if not self._is_this_snat_host():"},{"line_number":53,"context_line":"            # no centralized SNAT gateway for this node/agent"},{"line_number":54,"context_line":"            LOG.debug(\"not hosting snat for router: %s\", self.router[\u0027id\u0027])"},{"line_number":55,"context_line":"            if self.snat_namespace and self.snat_namespace.exists():"},{"line_number":56,"context_line":"                LOG.debug(\"SNAT was rescheduled to host %s. Clearing snat \""},{"line_number":57,"context_line":"                          \"namespace.\", self.router.get(\u0027gw_port_host\u0027))"},{"line_number":58,"context_line":"                return self.external_gateway_removed("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_70123a5a","line":55,"range":{"start_line":55,"start_character":15,"end_line":55,"end_character":34},"in_reply_to":"7aa08908_31760ad9","updated":"2016-06-09 15:08:17.000000000","message":"The reason I retained it, is there was couple of test cases were self.snat_namespace.exists() gave a Nontype error, where it meant the self.snat_namespace was not present.","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                    ex_gw_port, interface_name)"},{"line_number":60,"context_line":"            return"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if self.snat_namespace and not self.snat_namespace.exists():"},{"line_number":63,"context_line":"            # SNAT might be rescheduled to this agent; need to process like"},{"line_number":64,"context_line":"            # newly created gateway"},{"line_number":65,"context_line":"            return self.external_gateway_added(ex_gw_port, interface_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_b1483a8c","line":62,"range":{"start_line":62,"start_character":11,"end_line":62,"end_character":30},"updated":"2016-06-09 10:23:49.000000000","message":"ditto","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                    ex_gw_port, interface_name)"},{"line_number":60,"context_line":"            return"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if self.snat_namespace and not self.snat_namespace.exists():"},{"line_number":63,"context_line":"            # SNAT might be rescheduled to this agent; need to process like"},{"line_number":64,"context_line":"            # newly created gateway"},{"line_number":65,"context_line":"            return self.external_gateway_added(ex_gw_port, interface_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_3b78878f","line":62,"range":{"start_line":62,"start_character":11,"end_line":62,"end_character":30},"in_reply_to":"7aa08908_b1483a8c","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def delete(self, agent):"},{"line_number":214,"context_line":"        super(DvrEdgeRouter, self).delete(agent)"},{"line_number":215,"context_line":"        if self.snat_namespace and self.snat_namespace.exists():"},{"line_number":216,"context_line":"            self.snat_namespace.delete()"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def process_address_scope(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_914d3e9c","line":215,"range":{"start_line":215,"start_character":11,"end_line":215,"end_character":30},"updated":"2016-06-09 10:23:49.000000000","message":"ditto","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def delete(self, agent):"},{"line_number":214,"context_line":"        super(DvrEdgeRouter, self).delete(agent)"},{"line_number":215,"context_line":"        if self.snat_namespace and self.snat_namespace.exists():"},{"line_number":216,"context_line":"            self.snat_namespace.delete()"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def process_address_scope(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_bb6477e5","line":215,"range":{"start_line":215,"start_character":11,"end_line":215,"end_character":30},"in_reply_to":"7aa08908_914d3e9c","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    def _create_snat_namespace(self):"},{"line_number":155,"context_line":"        # TODO(mlavalle): in the near future, this method should contain the"},{"line_number":156,"context_line":"        # code in the L3 agent that creates a gateway for a dvr. The first step"},{"line_number":157,"context_line":"        # is to move the creation of the snat namespace here"},{"line_number":158,"context_line":"        self.snat_namespace.create()"},{"line_number":159,"context_line":"        return self.snat_namespace"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_e1f80cc7","line":157,"updated":"2016-06-09 20:04:45.000000000","message":"I actually have a change to do this ^^^ that I\u0027ll base on this and send out while I\u0027m thinking about it.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    def _create_snat_namespace(self):"},{"line_number":155,"context_line":"        # TODO(mlavalle): in the near future, this method should contain the"},{"line_number":156,"context_line":"        # code in the L3 agent that creates a gateway for a dvr. The first step"},{"line_number":157,"context_line":"        # is to move the creation of the snat namespace here"},{"line_number":158,"context_line":"        self.snat_namespace.create()"},{"line_number":159,"context_line":"        return self.snat_namespace"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_99f540cd","line":157,"in_reply_to":"7aa08908_e1f80cc7","updated":"2016-06-09 21:00:46.000000000","message":"ok will watch out for the change.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"1da1b9a6c901793c446e645ced4559105417d608","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":82,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":83,"context_line":"        if self.snat_namespace.exists():"},{"line_number":84,"context_line":"            self.snat_namespace.delete()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def internal_network_added(self, port):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_f8b99716","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":40},"updated":"2016-06-11 06:12:23.000000000","message":"nit: I found [1] in your another change, and I think if it could apply here. That is, add the exists check to the delete method. So you don\u0027t need to check everytime when deleting a snat namespace. But it is up to your call to decide which is better.\n\n\n[1] https://review.openstack.org/#/c/306065/7/neutron/agent/l3/dvr_snat_ns.py@38","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f75a788c3b71d80117c7552455fc737eea68ce8e","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":82,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":83,"context_line":"        if self.snat_namespace.exists():"},{"line_number":84,"context_line":"            self.snat_namespace.delete()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def internal_network_added(self, port):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_376ad6ed","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":40},"in_reply_to":"7aa08908_48ad47e8","updated":"2016-06-13 17:12:25.000000000","message":"Hong Hui Xiao, yes I understand what you meant. But since this does not harm, let us stay with this.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"92ea77c0a4f9c74bc7cdac2f1cf960ef4a2603ad","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":82,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":83,"context_line":"        if self.snat_namespace.exists():"},{"line_number":84,"context_line":"            self.snat_namespace.delete()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def internal_network_added(self, port):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_756e45ca","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":40},"in_reply_to":"7aa08908_72381e3e","updated":"2016-06-12 02:55:33.000000000","message":"I am sorry I don\u0027t understand why later calls \u0027delete\u0027 in namespaces.py. I thought it will use \u0027delete\u0027 in dvr_snat_ns.py, where you can add the \u0027exists\u0027 check.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"84893fd0028f245918352dbca8705adf1837d61c","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":82,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":83,"context_line":"        if self.snat_namespace.exists():"},{"line_number":84,"context_line":"            self.snat_namespace.delete()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def internal_network_added(self, port):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_48ad47e8","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":40},"in_reply_to":"7aa08908_756e45ca","updated":"2016-06-13 15:17:00.000000000","message":"Yes the later uses the \u0027self.snat_namespace.delete method and that is the reason that it uses the namespaces.py delete method.\nIn most of the calls in this class the delete from the namespaces.py is used.\n\nThe actual delete() function in this class is being called by the HA function.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7f5bc4011cf5d4e6d20c0a399a9f454666f12a64","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":82,"context_line":"        self._external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":83,"context_line":"        if self.snat_namespace.exists():"},{"line_number":84,"context_line":"            self.snat_namespace.delete()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def internal_network_added(self, port):"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_72381e3e","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":40},"in_reply_to":"7aa08908_f8b99716","updated":"2016-06-11 17:55:13.000000000","message":"There is a minor difference between the \u0027delete\u0027 that is shown in the patch above 306065 and the self.snat_namespace.delete.\n\nThe first one calls the \u0027delete()\u0027 function of this class.\nBut the later calls the \u0027delete()\u0027 in namespaces.py\n\nLet me know if I am wrong.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"1da1b9a6c901793c446e645ced4559105417d608","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def update_routing_table(self, operation, route):"},{"line_number":195,"context_line":"        if self.get_ex_gw_port() and self._is_this_snat_host():"},{"line_number":196,"context_line":"            ns_name \u003d dvr_snat_ns.SnatNamespace.get_snat_ns_name("},{"line_number":197,"context_line":"                self.router[\u0027id\u0027])"},{"line_number":198,"context_line":"            # NOTE: For now let us apply the static routes both in SNAT"},{"line_number":199,"context_line":"            # namespace and Router Namespace, to reduce the complexity."},{"line_number":200,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(namespace\u003dns_name)"},{"line_number":201,"context_line":"            if ip_wrapper.netns.exists(ns_name):"},{"line_number":202,"context_line":"                super(DvrEdgeRouter, self)._update_routing_table("},{"line_number":203,"context_line":"                    operation, route, namespace\u003dns_name)"},{"line_number":204,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_d690ed50","line":201,"range":{"start_line":196,"start_character":0,"end_line":201,"end_character":48},"updated":"2016-06-11 06:12:23.000000000","message":"I think we could apply the new \u0027exist\u0027 method here.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"7f5bc4011cf5d4e6d20c0a399a9f454666f12a64","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def update_routing_table(self, operation, route):"},{"line_number":195,"context_line":"        if self.get_ex_gw_port() and self._is_this_snat_host():"},{"line_number":196,"context_line":"            ns_name \u003d dvr_snat_ns.SnatNamespace.get_snat_ns_name("},{"line_number":197,"context_line":"                self.router[\u0027id\u0027])"},{"line_number":198,"context_line":"            # NOTE: For now let us apply the static routes both in SNAT"},{"line_number":199,"context_line":"            # namespace and Router Namespace, to reduce the complexity."},{"line_number":200,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(namespace\u003dns_name)"},{"line_number":201,"context_line":"            if ip_wrapper.netns.exists(ns_name):"},{"line_number":202,"context_line":"                super(DvrEdgeRouter, self)._update_routing_table("},{"line_number":203,"context_line":"                    operation, route, namespace\u003dns_name)"},{"line_number":204,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_12f39a9f","line":201,"range":{"start_line":196,"start_character":0,"end_line":201,"end_character":48},"in_reply_to":"7aa08908_d690ed50","updated":"2016-06-11 17:55:13.000000000","message":"Yes, just don\u0027t wanted to polute this patch with unrelated changes.","commit_id":"0b1d31bf52dfe352e20f4ace6c47db3de03c8680"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e570af4472c0015e4b4d2aad059263fb7430baa0","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                    ex_gw_port, interface_name)"},{"line_number":66,"context_line":"            return"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        if not self.snat_namespace.exists():"},{"line_number":69,"context_line":"            # SNAT might be rescheduled to this agent; need to process like"},{"line_number":70,"context_line":"            # newly created gateway"},{"line_number":71,"context_line":"            return self.external_gateway_added(ex_gw_port, interface_name)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3aaa91ec_7c301702","line":68,"updated":"2016-06-22 20:17:03.000000000","message":"Minor changes like this worry me.  If we have a stale snat namespace, previously we would have gone through a complete init.  Now we could clear a few addresses because external_gateway_added() passed \u0027preserve_ips\u0027 along.  The would get added back eventually.\n\nI\u0027m just wondering if a minor change like this is why the one functional test is failing.\n\nI had pinged Swami offline about differentiating between \"I created it\" versus \"it exists\" - I\u0027ll propose a patch based on this one with that change just to see if we can get past the failure.  I\u0027m just running out of things to try since I can\u0027t get this to fail locally, and don\u0027t know why the check jobs can trigger it every time.\n\nUnless someone else has a better option to track this down?","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e8f9c7e53d49a910dc1b59303eb15303a4256ed5","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        # TODO(mlavalle): in the near future, this method should contain the"},{"line_number":166,"context_line":"        # code in the L3 agent that creates a gateway for a dvr. The first step"},{"line_number":167,"context_line":"        # is to move the creation of the snat namespace here"},{"line_number":168,"context_line":"        if not self.snat_namespace.exists():"},{"line_number":169,"context_line":"            self.snat_namespace.create()"},{"line_number":170,"context_line":"        return self.snat_namespace"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3aaa91ec_fb8658b7","line":168,"updated":"2016-06-30 15:07:21.000000000","message":"So I am narrowing-in on the failure, but this line seems to be one of the issues.  Perhaps there\u0027s something stale getting left around in the functional tests.  I\u0027m still working on it in the follow-on patch to keep the hacking in one place.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6b00c3381148135e890e5cc8c29c638bf40c0d76","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":48,"context_line":"            # different network node manually when the agent was dead."},{"line_number":49,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"},{"line_number":50,"context_line":"            # with a different host."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was rescheduled to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""},{"line_number":54,"context_line":"                      \"host.\", self.snat_namespace.name)"},{"line_number":55,"context_line":"            self.external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def external_gateway_updated(self, ex_gw_port, interface_name):"},{"line_number":58,"context_line":"        if not self._is_this_snat_host():"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_5a22f7a3","line":55,"range":{"start_line":46,"start_character":8,"end_line":55,"end_character":69},"updated":"2016-07-07 09:54:05.000000000","message":"how it differs from a case when agent was not dead, but router gw was just added? I guess here should also check for a stale snat namespace.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"23b193ef1af70b061f0f5b43b74f6a03eaecf827","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":48,"context_line":"            # different network node manually when the agent was dead."},{"line_number":49,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"},{"line_number":50,"context_line":"            # with a different host."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was rescheduled to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""},{"line_number":54,"context_line":"                      \"host.\", self.snat_namespace.name)"},{"line_number":55,"context_line":"            self.external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def external_gateway_updated(self, ex_gw_port, interface_name):"},{"line_number":58,"context_line":"        if not self._is_this_snat_host():"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_8a62f5ab","line":55,"range":{"start_line":46,"start_character":8,"end_line":55,"end_character":69},"in_reply_to":"1aa78d24_5a22f7a3","updated":"2016-07-08 17:03:59.000000000","message":"I don\u0027t get what are saying.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"55051c5fd6168ca2d77e01a1efbb12770b4bd58b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":48,"context_line":"            # different network node manually when the agent was dead."},{"line_number":49,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"},{"line_number":50,"context_line":"            # with a different host."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was rescheduled to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""},{"line_number":54,"context_line":"                      \"host.\", self.snat_namespace.name)"},{"line_number":55,"context_line":"            self.external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def external_gateway_updated(self, ex_gw_port, interface_name):"},{"line_number":58,"context_line":"        if not self._is_this_snat_host():"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_7bd4b946","line":55,"range":{"start_line":46,"start_character":8,"end_line":55,"end_character":69},"in_reply_to":"1aa78d24_5a22f7a3","updated":"2016-07-08 18:02:02.000000000","message":"When agent is not dead and when agent gateway is just added it calls external_gateway_added, since self.ex_gw_port is none ( since this is the first time the agent gateway port is seen by the agent).\nIf this is the snat_host, then it would go ahead and create the snat_namespace.\n\nIf the agent is alive and a new fresh gateway comes in then that would be handled by\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l3/router_info.py#L675\nIf the agent is alive and move happened then that would be handled by the line below for host mismatch.\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l3/router_info.py#L678\n\nBut when the agent is dead and when it restarts, then still if the router_info has the external_gw_port information, it would basically come to the same place here. But if the gw_port_host mismatches, there was not check before to handle that condition (stale namespace) and it just skips.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ffab03ed065187e3cef830f2cfd2bebea087c728","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":48,"context_line":"            # different network node manually when the agent was dead."},{"line_number":49,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"},{"line_number":50,"context_line":"            # with a different host."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was rescheduled to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""},{"line_number":54,"context_line":"                      \"host.\", self.snat_namespace.name)"},{"line_number":55,"context_line":"            self.external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def external_gateway_updated(self, ex_gw_port, interface_name):"},{"line_number":58,"context_line":"        if not self._is_this_snat_host():"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_8704827e","line":55,"range":{"start_line":46,"start_character":8,"end_line":55,"end_character":69},"in_reply_to":"1aa78d24_7bd4b946","updated":"2016-07-11 08:03:11.000000000","message":"\u003e\u003eWhen agent is not dead and when agent gateway is just added it calls external_gateway_added, since self.ex_gw_port is none ( since this is the first time the agent gateway port is seen by the agent).\n\u003e\u003eIf this is the snat_host, then it would go ahead and create the snat_namespace.\n\nRight, but in case if it\u0027s not the snat host it will go to line 51 and log snat rescheduling while there was no rescheduling (and nothing to remove at #55) Am I missing something?","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5aed253355449fdff8b22dd2717e1feea91e1da8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":48,"context_line":"            # different network node manually when the agent was dead."},{"line_number":49,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"},{"line_number":50,"context_line":"            # with a different host."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was rescheduled to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""},{"line_number":54,"context_line":"                      \"host.\", self.snat_namespace.name)"},{"line_number":55,"context_line":"            self.external_gateway_removed(ex_gw_port, interface_name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def external_gateway_updated(self, ex_gw_port, interface_name):"},{"line_number":58,"context_line":"        if not self._is_this_snat_host():"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_f0498c32","line":55,"range":{"start_line":46,"start_character":8,"end_line":55,"end_character":69},"in_reply_to":"1aa78d24_8704827e","updated":"2016-07-12 00:43:52.000000000","message":"Yes, I get what you say now. So probably it should also check for the current host agent type before we call the external_gateway_removed.\n\nWill fix it.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5cd78a3da386051cd2306d442b05980be4f2ecb1","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":47,"context_line":"            self.agent_conf.agent_mode \u003d\u003d l3_constants.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":48,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":49,"context_line":"            # different network node manually when the agent was dead."},{"line_number":50,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_00c31d8a","line":47,"range":{"start_line":47,"start_character":12,"end_line":47,"end_character":77},"updated":"2016-07-12 07:48:39.000000000","message":"this still doesn\u0027t mean that snat was rescheduled, there could be several dvr_snat agents and snat was scheduled to another agent.","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"00c1409cbdd2951e2fe9233562139f1f5d032edb","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":45,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":46,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":47,"context_line":"            self.agent_conf.agent_mode \u003d\u003d l3_constants.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":48,"context_line":"            # This is the case where the router was rescheduled to a"},{"line_number":49,"context_line":"            # different network node manually when the agent was dead."},{"line_number":50,"context_line":"            # When agent wakes up, it would receive the ex_gw_port but"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_3d0bc425","line":47,"range":{"start_line":47,"start_character":12,"end_line":47,"end_character":77},"in_reply_to":"1aa78d24_00c31d8a","updated":"2016-07-12 16:23:23.000000000","message":"I think checking for the existence of the namespace at this point along with the other checks will make sure that there is a stale snat_namespace and will clean it up.\n\nDo you agree?","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a40e8a0b84a7860bfc461172055b828665aa3b62","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            # the same routes to the snat namespace after the gateway port"},{"line_number":45,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_a15e0d43","line":47,"range":{"start_line":47,"start_character":12,"end_line":47,"end_character":41},"updated":"2016-07-28 08:35:18.000000000","message":"redundant given #40","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a40e8a0b84a7860bfc461172055b828665aa3b62","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_e106451f","line":50,"range":{"start_line":49,"start_character":12,"end_line":50,"end_character":54},"updated":"2016-07-28 08:35:18.000000000","message":"need to also check the existence of stale snat namespace to distinguish the case where snat wasn\u0027t moved but just initially scheduled to another host","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b233c7398f766173562d13624e6462d66c65d620","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_5bb7e7f4","line":50,"range":{"start_line":49,"start_character":12,"end_line":50,"end_character":54},"in_reply_to":"bacf61ea_9801653b","updated":"2016-07-29 15:43:29.000000000","message":"yeah, that\u0027s all I was asking in the first comment ;)","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"eaa3ba179316c295a4157756c1d66dc7fd20ccac","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_c12ae42b","line":50,"range":{"start_line":49,"start_character":12,"end_line":50,"end_character":54},"in_reply_to":"bacf61ea_995ec710","updated":"2016-07-29 06:47:15.000000000","message":"- three dvr_snat agents\n- snat is scheduled to agent 1\n- agent 2 is restarted\n- #47 - 55 will be executed and say \"snat was rescheduled\" and attept to clear snat namespace which never was there - wrong!","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f6bdd21a531e8ed558303a67e070d36648aa969e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_9801653b","line":50,"range":{"start_line":49,"start_character":12,"end_line":50,"end_character":54},"in_reply_to":"bacf61ea_c12ae42b","updated":"2016-07-29 15:32:19.000000000","message":"In this case, then if we also check for the existence of the snat_namespace it should solve the problem.\n\nif (not self._is_this_snat_host() and \n    (self.agent_conf.agent_mode \u003d\u003d     n_const.L3_AGENT_MODE_DVR_SNAT) and self.snat_namespace.exists()):\n\nI think this condition should solve that problem? Do you agree?","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6b080303106e6c55dafd9098dbedcaabf98aa779","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        if (not self._is_this_snat_host() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""},{"line_number":53,"context_line":"                      \"namespace %s and will be cleared from the current \""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_995ec710","line":50,"range":{"start_line":49,"start_character":12,"end_line":50,"end_character":54},"in_reply_to":"bacf61ea_e106451f","updated":"2016-07-28 15:17:27.000000000","message":"I thought that this is the condition that checks for the stale namespace when moved to a different node in the absense of the agent.\nI thought the L#61-65 handles those cases.","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"708bd4a9901f401367aa7c9f27abbe944558a6e1","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        elif (self.snat_namespace.exists() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_ed1dd673","line":48,"range":{"start_line":48,"start_character":12,"end_line":48,"end_character":72},"updated":"2016-08-02 06:07:26.000000000","message":"seems this can be removed, existence of snat namespace should be enough to start cleanup","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b8d397aeb13c9f1a176eb3a98dfe7e10d3e2dc2b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            # is added, we need to call routes_updated here."},{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        elif (self.snat_namespace.exists() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_20f7d0f6","line":48,"range":{"start_line":48,"start_character":12,"end_line":48,"end_character":72},"in_reply_to":"bacf61ea_ed1dd673","updated":"2016-08-02 17:11:11.000000000","message":"Done","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"708bd4a9901f401367aa7c9f27abbe944558a6e1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        elif (self.snat_namespace.exists() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_0802d809","line":49,"range":{"start_line":49,"start_character":56,"end_line":49,"end_character":64},"updated":"2016-08-02 06:07:26.000000000","message":"not only manually, this could be auto rescheduling","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b8d397aeb13c9f1a176eb3a98dfe7e10d3e2dc2b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            self.routes_updated([], self.router[\u0027routes\u0027])"},{"line_number":47,"context_line":"        elif (self.snat_namespace.exists() and"},{"line_number":48,"context_line":"            self.agent_conf.agent_mode \u003d\u003d n_const.L3_AGENT_MODE_DVR_SNAT):"},{"line_number":49,"context_line":"            # This is the case where the snat was moved manually to a"},{"line_number":50,"context_line":"            # different agent when the agent was dead."},{"line_number":51,"context_line":"            LOG.debug(\"SNAT was moved to a different host and does \""},{"line_number":52,"context_line":"                      \"not match with the current host. This is a stale \""}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_80dcbc75","line":49,"range":{"start_line":49,"start_character":56,"end_line":49,"end_character":64},"in_reply_to":"bacf61ea_0802d809","updated":"2016-08-02 17:11:11.000000000","message":"Done","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"}],"neutron/agent/l3/dvr_local_router.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":410,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":411,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":412,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":413,"context_line":"        if ex_gw_port:"},{"line_number":414,"context_line":"            for p in self.internal_ports:"},{"line_number":415,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":416,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_b12f9aa6","line":413,"range":{"start_line":413,"start_character":8,"end_line":413,"end_character":21},"updated":"2016-06-09 10:23:49.000000000","message":"checked in base class","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"89f08b7241fb337d5d9eb4c1d4f853aaca8b22b6","unresolved":false,"context_lines":[{"line_number":410,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":411,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":412,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":413,"context_line":"        if ex_gw_port:"},{"line_number":414,"context_line":"            for p in self.internal_ports:"},{"line_number":415,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":416,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_43d4afea","line":413,"updated":"2016-06-09 08:50:47.000000000","message":"please add a unit test","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"85e6da80ba508fd801631f968b9d31e4b7704730","unresolved":false,"context_lines":[{"line_number":410,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":411,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":412,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":413,"context_line":"        if ex_gw_port:"},{"line_number":414,"context_line":"            for p in self.internal_ports:"},{"line_number":415,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":416,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_f04bca5d","line":413,"range":{"start_line":413,"start_character":8,"end_line":413,"end_character":21},"in_reply_to":"7aa08908_b12f9aa6","updated":"2016-06-09 15:08:17.000000000","message":"same reason self.snat_ports does not have any value.","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":410,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":411,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":412,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":413,"context_line":"        if ex_gw_port:"},{"line_number":414,"context_line":"            for p in self.internal_ports:"},{"line_number":415,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":416,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_9b56db04","line":413,"range":{"start_line":413,"start_character":8,"end_line":413,"end_character":21},"in_reply_to":"7aa08908_f04bca5d","updated":"2016-06-09 19:04:10.000000000","message":"Added unit test that covers it.","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"},{"line_number":415,"context_line":"        # restarts the self.snat_ports will be non-iterable, which will"},{"line_number":416,"context_line":"        # be required for cleanup."},{"line_number":417,"context_line":"        if ex_gw_port:"},{"line_number":418,"context_line":"            for p in self.internal_ports:"},{"line_number":419,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":420,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_70f14c6a","line":417,"range":{"start_line":417,"start_character":8,"end_line":417,"end_character":22},"updated":"2016-06-10 19:54:46.000000000","message":"nit:  Here, prefer this:\n\n  if not ex_gw_port:\n      return\n\n  ...","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c7e21ee936e17028ef3e673b855a2f66aafd9a53","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"},{"line_number":415,"context_line":"        # restarts the self.snat_ports will be non-iterable, which will"},{"line_number":416,"context_line":"        # be required for cleanup."},{"line_number":417,"context_line":"        if ex_gw_port:"},{"line_number":418,"context_line":"            for p in self.internal_ports:"},{"line_number":419,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":420,"context_line":"                # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_f90ec730","line":417,"range":{"start_line":417,"start_character":8,"end_line":417,"end_character":22},"in_reply_to":"7aa08908_70f14c6a","updated":"2016-06-10 20:21:13.000000000","message":"will fix it.","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        # restarts the self.snat_ports will be non-iterable, which will"},{"line_number":416,"context_line":"        # be required for cleanup."},{"line_number":417,"context_line":"        if ex_gw_port:"},{"line_number":418,"context_line":"            for p in self.internal_ports:"},{"line_number":419,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":420,"context_line":"                # cache along with the current ports."},{"line_number":421,"context_line":"                gateway \u003d self.get_snat_port_for_internal_port("}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_331ceec0","line":418,"range":{"start_line":418,"start_character":26,"end_line":418,"end_character":40},"updated":"2016-06-10 19:54:46.000000000","message":"Similar comment to here [1].\n\n [1] https://review.openstack.org/#/c/326729/11/neutron/agent/l3/dvr_edge_ha_router.py@81","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c7e21ee936e17028ef3e673b855a2f66aafd9a53","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        # restarts the self.snat_ports will be non-iterable, which will"},{"line_number":416,"context_line":"        # be required for cleanup."},{"line_number":417,"context_line":"        if ex_gw_port:"},{"line_number":418,"context_line":"            for p in self.internal_ports:"},{"line_number":419,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":420,"context_line":"                # cache along with the current ports."},{"line_number":421,"context_line":"                gateway \u003d self.get_snat_port_for_internal_port("}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_594c3b70","line":418,"range":{"start_line":418,"start_character":26,"end_line":418,"end_character":40},"in_reply_to":"7aa08908_331ceec0","updated":"2016-06-10 20:21:13.000000000","message":"In this case it says there is no self.snat_agents.\n if self.snat_ports:\n2016-06-10 13:16:43.667 TRACE neutron.agent.l3.agent AttributeError: \u0027DvrEdgeRouter\u0027 object has no attribute \u0027snat_ports\u0027\n\nSo I will just make sure check for ex_gw_port and return.","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"04903a99750b5619fdf8e897fcc2fbe6430ce3cd","unresolved":false,"context_lines":[{"line_number":412,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":413,"context_line":"        # Make sure we check for the ex_gw_port before proceeding, since"},{"line_number":414,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"},{"line_number":415,"context_line":"        # restarts the self.snat_ports will raise an AttributeError. "},{"line_number":416,"context_line":"        if not ex_gw_port:"},{"line_number":417,"context_line":"            return"},{"line_number":418,"context_line":"        for p in self.internal_ports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_3954cf1f","line":415,"range":{"start_line":415,"start_character":68,"end_line":415,"end_character":69},"updated":"2016-06-10 20:42:03.000000000","message":"Uh oh, I think pep8 will not like this.","commit_id":"64b43fb7de7e2b5a679074198da5ab3beb5d0160"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"04903a99750b5619fdf8e897fcc2fbe6430ce3cd","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        for p in self.internal_ports:"},{"line_number":419,"context_line":"            # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":420,"context_line":"            # cache along with the current ports."},{"line_number":421,"context_line":"            gateway \u003d self.get_snat_port_for_internal_port("},{"line_number":422,"context_line":"                p, self.snat_ports)"},{"line_number":423,"context_line":"            if not gateway:"},{"line_number":424,"context_line":"                continue"},{"line_number":425,"context_line":"            internal_interface \u003d self.get_internal_device_name(p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_d93b0bea","line":422,"range":{"start_line":421,"start_character":59,"end_line":422,"end_character":16},"updated":"2016-06-10 20:42:03.000000000","message":"Don\u0027t change whitespace.","commit_id":"64b43fb7de7e2b5a679074198da5ab3beb5d0160"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c4bfa50026cb43eb72c42bb0bdb3ef96622b2591","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        self.process_floating_ip_nat_rules()"},{"line_number":410,"context_line":"        if self.fip_ns:"},{"line_number":411,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":412,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":413,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":414,"context_line":"        # Make sure we check for the ex_gw_port before proceeding, since"},{"line_number":415,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_cfcea4b6","line":412,"updated":"2016-06-16 16:36:27.000000000","message":"This can throw an exception if ex_gw_port is None","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a44b54bb94cc7a4ebe4b88cf777f95cf56996c5d","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        self.process_floating_ip_nat_rules()"},{"line_number":410,"context_line":"        if self.fip_ns:"},{"line_number":411,"context_line":"            to_fip_interface_name \u003d ("},{"line_number":412,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":413,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":414,"context_line":"        # Make sure we check for the ex_gw_port before proceeding, since"},{"line_number":415,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_729bfe66","line":412,"in_reply_to":"7aa08908_cfcea4b6","updated":"2016-06-17 04:17:35.000000000","message":"Brian this will not throw an exception in the context of DVR routers.\nThis function get_external_device_interface is been overridden here, and in the overridden function, the argument ex_gw_port is not used at all.\nOnly in the context of legacy routers, the ex_gw_port is used, and this should not cause any issue.\n\nSince this condition here deals with just cleanup up the stale namespace when there is no gateway in the router_info it should not be a problem, since the fips will not be available if there is not gateway.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c4bfa50026cb43eb72c42bb0bdb3ef96622b2591","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"},{"line_number":416,"context_line":"        # restarts the self.snat_ports will raise an AttributeError."},{"line_number":417,"context_line":"        if not ex_gw_port:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":"        if self.snat_ports:"},{"line_number":420,"context_line":"            for p in self.internal_ports:"},{"line_number":421,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_cf0344bd","line":418,"updated":"2016-06-16 16:36:27.000000000","message":"This can go a way if you update router_info.py, right?  See my comment there.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a44b54bb94cc7a4ebe4b88cf777f95cf56996c5d","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        # there are cases were the ex_gw_port is None and when the agent"},{"line_number":416,"context_line":"        # restarts the self.snat_ports will raise an AttributeError."},{"line_number":417,"context_line":"        if not ex_gw_port:"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":"        if self.snat_ports:"},{"line_number":420,"context_line":"            for p in self.internal_ports:"},{"line_number":421,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_f2a7eea4","line":418,"in_reply_to":"7aa08908_cf0344bd","updated":"2016-06-17 04:17:35.000000000","message":"May be we can move this line to #L410 and that should not cause any confussion.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"621ffe06715ff01da2d8554a36faff92c57f83e9","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_4ce100fe","line":51,"updated":"2016-07-05 21:24:43.000000000","message":"I think this should be None to match the DVR HA code, or just moved into DvrRouterBase class.  Or maybe initialized to [] to not require the change in the HA code.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"493b50204e9a79cef850bff8f2c74304208f7f7f","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_9acda387","line":51,"in_reply_to":"1aa78d24_4ce100fe","updated":"2016-07-06 17:44:24.000000000","message":"Let me keep it as empty list.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"621ffe06715ff01da2d8554a36faff92c57f83e9","unresolved":false,"context_lines":[{"line_number":421,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":422,"context_line":"                # cache along with the current ports."},{"line_number":423,"context_line":"                gateway \u003d self.get_snat_port_for_internal_port("},{"line_number":424,"context_line":"                    p, self.snat_ports)"},{"line_number":425,"context_line":"                if not gateway:"},{"line_number":426,"context_line":"                    continue"},{"line_number":427,"context_line":"                internal_interface \u003d self.get_internal_device_name(p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_2c2d9446","line":424,"updated":"2016-07-05 21:24:43.000000000","message":"get_snat_port_for_internal_port() can handle both \u0027None\u0027 and [] as the second argument, so why do we need to check self.snat_ports first ?  Maybe I don\u0027t understand where the AttributeError is coming from.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"493b50204e9a79cef850bff8f2c74304208f7f7f","unresolved":false,"context_lines":[{"line_number":421,"context_line":"                # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":422,"context_line":"                # cache along with the current ports."},{"line_number":423,"context_line":"                gateway \u003d self.get_snat_port_for_internal_port("},{"line_number":424,"context_line":"                    p, self.snat_ports)"},{"line_number":425,"context_line":"                if not gateway:"},{"line_number":426,"context_line":"                    continue"},{"line_number":427,"context_line":"                internal_interface \u003d self.get_internal_device_name(p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_dac3ab55","line":424,"in_reply_to":"1aa78d24_2c2d9446","updated":"2016-07-06 17:44:24.000000000","message":"Yes this is not required here.","commit_id":"dc9e2160d3cf8051d0bbba893608b04966560483"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0281cc58172fe2830bc6c51d17d35a66aaae9028","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                self.get_external_device_interface_name(ex_gw_port))"},{"line_number":413,"context_line":"            self.process_floating_ip_addresses(to_fip_interface_name)"},{"line_number":414,"context_line":"        if not ex_gw_port:"},{"line_number":415,"context_line":"            return"},{"line_number":416,"context_line":"        for p in self.internal_ports:"},{"line_number":417,"context_line":"            # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":418,"context_line":"            # cache along with the current ports."}],"source_content_type":"text/x-python","patch_set":20,"id":"1aa78d24_3d474478","line":415,"updated":"2016-07-06 19:37:35.000000000","message":"Do you still need this check?  It\u0027s not used below.","commit_id":"140c194273b373d6b1bfaf9adae35f044807fd3e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0281cc58172fe2830bc6c51d17d35a66aaae9028","unresolved":false,"context_lines":[{"line_number":417,"context_line":"            # NOTE: When removing the gateway port, pass in the snat_port"},{"line_number":418,"context_line":"            # cache along with the current ports."},{"line_number":419,"context_line":"            gateway \u003d self.get_snat_port_for_internal_port("},{"line_number":420,"context_line":"                p, self.snat_ports)"},{"line_number":421,"context_line":"            if not gateway:"},{"line_number":422,"context_line":"                continue"},{"line_number":423,"context_line":"            internal_interface \u003d self.get_internal_device_name(p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":20,"id":"1aa78d24_7d01cc37","line":420,"updated":"2016-07-06 19:37:35.000000000","message":"nit: can you just change this back to original.","commit_id":"140c194273b373d6b1bfaf9adae35f044807fd3e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6b00c3381148135e890e5cc8c29c638bf40c0d76","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_9a93bf5a","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":28},"updated":"2016-07-07 09:54:05.000000000","message":"why moving here?","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5aed253355449fdff8b22dd2717e1feea91e1da8","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_10741866","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":28},"in_reply_to":"1aa78d24_68716844","updated":"2016-07-12 00:43:52.000000000","message":"I\u0027ll probably live it here, since the base is not appropriate.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ffab03ed065187e3cef830f2cfd2bebea087c728","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_68716844","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":28},"in_reply_to":"1aa78d24_8a783591","updated":"2016-07-11 08:03:11.000000000","message":"I see. Probably DvrRouterBase is a better place..","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"23b193ef1af70b061f0f5b43b74f6a03eaecf827","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.dist_fip_count \u003d None"},{"line_number":49,"context_line":"        self.fip_ns \u003d None"},{"line_number":50,"context_line":"        self._pending_arp_set \u003d set()"},{"line_number":51,"context_line":"        self.snat_ports \u003d []"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def get_floating_ips(self):"},{"line_number":54,"context_line":"        \"\"\"Filter Floating IPs to be hosted on this agent.\"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_8a783591","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":28},"in_reply_to":"1aa78d24_9a93bf5a","updated":"2016-07-08 17:03:59.000000000","message":"Initializing it in the local router made sense with the change, and also kind of got rid of initializing it at different places in the dvr_edge_ha_router where it was initialized to None.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"}],"neutron/agent/l3/dvr_router_base.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2411da800c627724099447002cdd014fe5ca237","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.agent \u003d agent"},{"line_number":27,"context_line":"        self.host \u003d host"},{"line_number":28,"context_line":"        self.snat_ports \u003d []"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def process(self, agent):"},{"line_number":31,"context_line":"        super(DvrRouterBase, self).process(agent)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_1ebc3dba","line":28,"range":{"start_line":28,"start_character":8,"end_line":28,"end_character":28},"updated":"2016-08-04 13:24:44.000000000","message":"it was \u0027self.snat_ports \u003d None\u0027 in dev_edge_ha_router. I see places in the code checking for \u0027None\u0027. Still not sure if this change is strictly needed for the bug fix, if not - please remove this change from the patch, it might be related to dvr multinode failures.","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d414d5a1bd6660b660af53c272250835523540ae","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.agent \u003d agent"},{"line_number":27,"context_line":"        self.host \u003d host"},{"line_number":28,"context_line":"        self.snat_ports \u003d []"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def process(self, agent):"},{"line_number":31,"context_line":"        super(DvrRouterBase, self).process(agent)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_c294838c","line":28,"range":{"start_line":28,"start_character":8,"end_line":28,"end_character":28},"in_reply_to":"bacf61ea_1ebc3dba","updated":"2016-08-04 15:05:21.000000000","message":"I think this is required for the change.\nSee dvr_local_router, external_gateway_removed, there is a \u0027for loop\u0027 that looks for self.snat_ports and that\u0027s the reason we initialized it to empty list instead of None.","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9787ef2311cd2e4232796213a388ea4632088c43","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.agent \u003d agent"},{"line_number":27,"context_line":"        self.host \u003d host"},{"line_number":28,"context_line":"        self.snat_ports \u003d []"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def process(self, agent):"},{"line_number":31,"context_line":"        super(DvrRouterBase, self).process(agent)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_8d05977b","line":28,"range":{"start_line":28,"start_character":8,"end_line":28,"end_character":28},"in_reply_to":"bacf61ea_2a1571e4","updated":"2016-08-04 17:34:06.000000000","message":"What if set it to None here?","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"bb11381195038b95ad74d8974ab7d78f9784b5c0","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        self.agent \u003d agent"},{"line_number":27,"context_line":"        self.host \u003d host"},{"line_number":28,"context_line":"        self.snat_ports \u003d []"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def process(self, agent):"},{"line_number":31,"context_line":"        super(DvrRouterBase, self).process(agent)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_2a1571e4","line":28,"range":{"start_line":28,"start_character":8,"end_line":28,"end_character":28},"in_reply_to":"bacf61ea_c294838c","updated":"2016-08-04 17:08:31.000000000","message":"If I revert this change and move self.snat_ports\u003dNone in dvr_edge_ha_router.py, when I run the functional test this is the error message I get in \u0027external_gateway_removed\u0027.\n\nneutron.tests.functional.agent.l3.test_dvr_router.TestDvrRouter.test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move\n------------------------------------------------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"neutron/tests/functional/agent/l3/test_dvr_router.py\", line 162, in test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move\n        restarted_router \u003d self.manage_router(restarted_agent, router1.router)\n      File \"neutron/tests/functional/agent/l3/test_dvr_router.py\", line 54, in manage_router\n        return super(TestDvrRouter, self).manage_router(agent, router)\n      File \"neutron/tests/functional/agent/l3/framework.py\", line 294, in manage_router\n        agent._process_added_router(router)\n      File \"neutron/agent/l3/agent.py\", line 427, in _process_added_router\n        ri.process(self)\n      File \"neutron/agent/l3/dvr_local_router.py\", line 549, in process\n        super(DvrLocalRouter, self).process(agent)\n      File \"neutron/agent/l3/dvr_router_base.py\", line 31, in process\n        super(DvrRouterBase, self).process(agent)\n      File \"neutron/common/utils.py\", line 242, in call\n        self.logger(e)\n      File \"/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py\", line 220, in __exit__\n        self.force_reraise()\n      File \"/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py\", line 196, in force_reraise\n        six.reraise(self.type_, self.value, self.tb)\n      File \"neutron/common/utils.py\", line 239, in call\n        return func(*args, **kwargs)\n      File \"neutron/agent/l3/router_info.py\", line 1035, in process\n        self.process_external(agent)\n      File \"neutron/agent/l3/dvr_local_router.py\", line 485, in process_external\n        super(DvrLocalRouter, self).process_external(agent)\n      File \"neutron/agent/l3/router_info.py\", line 817, in process_external\n        self._process_external_gateway(ex_gw_port, agent.pd)\n      File \"neutron/agent/l3/router_info.py\", line 695, in _process_external_gateway\n        self.external_gateway_added(ex_gw_port, interface_name)\n      File \"neutron/agent/l3/dvr_edge_router.py\", line 53, in external_gateway_added\n        self.external_gateway_removed(ex_gw_port, interface_name)\n      File \"neutron/agent/l3/dvr_edge_router.py\", line 90, in external_gateway_removed\n        self._external_gateway_removed(ex_gw_port, interface_name)\n      File \"neutron/agent/l3/dvr_edge_router.py\", line 78, in _external_gateway_removed\n        interface_name)\n      File \"neutron/agent/l3/dvr_local_router.py\", line 432, in external_gateway_removed\n        gateway \u003d self.get_snat_port_for_internal_port(p, self.snat_ports)\n    AttributeError: \u0027DvrEdgeRouter\u0027 object has no attribute \u0027snat_ports\u0027","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6c781dff135657b0c875f01798a292c37237be64","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def get_snat_port_for_internal_port(self, int_port, snat_ports\u003dNone):"},{"line_number":39,"context_line":"        \"\"\"Return the SNAT port for the given internal interface port.\"\"\""},{"line_number":40,"context_line":"        if snat_ports is None:"},{"line_number":41,"context_line":"            snat_ports \u003d self.get_snat_interfaces()"},{"line_number":42,"context_line":"        fixed_ip \u003d int_port[\u0027fixed_ips\u0027][0]"},{"line_number":43,"context_line":"        subnet_id \u003d fixed_ip[\u0027subnet_id\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_2ae0d195","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":30},"updated":"2016-08-04 17:17:48.000000000","message":"this will never be True now so some logic can be broken","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"dbd1d3a23b6669efd0b4bbf2cb32f0a345796f85","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def get_snat_port_for_internal_port(self, int_port, snat_ports\u003dNone):"},{"line_number":39,"context_line":"        \"\"\"Return the SNAT port for the given internal interface port.\"\"\""},{"line_number":40,"context_line":"        if snat_ports is None:"},{"line_number":41,"context_line":"            snat_ports \u003d self.get_snat_interfaces()"},{"line_number":42,"context_line":"        fixed_ip \u003d int_port[\u0027fixed_ips\u0027][0]"},{"line_number":43,"context_line":"        subnet_id \u003d fixed_ip[\u0027subnet_id\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_6d530318","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":30},"in_reply_to":"bacf61ea_2ae0d195","updated":"2016-08-04 17:21:37.000000000","message":"So what do you think would be the right option here.\nCan we assign the snat_port to None in the dvr_base_router.py and then check for self.snat_ports before iterating through the self.snat_ports, will that fix.","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"04e66c120562c3fa5efd214144d0f0449b600a67","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def get_snat_port_for_internal_port(self, int_port, snat_ports\u003dNone):"},{"line_number":39,"context_line":"        \"\"\"Return the SNAT port for the given internal interface port.\"\"\""},{"line_number":40,"context_line":"        if snat_ports is None:"},{"line_number":41,"context_line":"            snat_ports \u003d self.get_snat_interfaces()"},{"line_number":42,"context_line":"        fixed_ip \u003d int_port[\u0027fixed_ips\u0027][0]"},{"line_number":43,"context_line":"        subnet_id \u003d fixed_ip[\u0027subnet_id\u0027]"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_6da783bd","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":30},"in_reply_to":"bacf61ea_6d530318","updated":"2016-08-04 17:31:45.000000000","message":"the other option is to change the function to pass in a list instead of snat_ports\u003dNone and check for the list before proceeding if it is empty or not.","commit_id":"3faeb650a4ece5b0a941c7571934a4bfd9956b27"}],"neutron/agent/l3/namespace_manager.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5cd78a3da386051cd2306d442b05980be4f2ecb1","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                ns_prefix, ns_id \u003d self.get_prefix_and_id(ns)"},{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id, snat_prefix):"},{"line_number":134,"context_line":"        for ns in self.list_all():"},{"line_number":135,"context_line":"            prefix \u003d namespaces.get_prefix_from_ns_name(ns)"},{"line_number":136,"context_line":"            if prefix !\u003d snat_prefix:"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_20cc5969","line":133,"range":{"start_line":133,"start_character":51,"end_line":133,"end_character":60},"updated":"2016-07-12 07:48:39.000000000","message":"this should be used","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"00c1409cbdd2951e2fe9233562139f1f5d032edb","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                ns_prefix, ns_id \u003d self.get_prefix_and_id(ns)"},{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id, snat_prefix):"},{"line_number":134,"context_line":"        for ns in self.list_all():"},{"line_number":135,"context_line":"            prefix \u003d namespaces.get_prefix_from_ns_name(ns)"},{"line_number":136,"context_line":"            if prefix !\u003d snat_prefix:"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_bd2e9489","line":133,"range":{"start_line":133,"start_character":51,"end_line":133,"end_character":60},"in_reply_to":"1aa78d24_20cc5969","updated":"2016-07-12 16:23:23.000000000","message":"You mean I should not use snat_prefix, and just use the router_id.","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5cd78a3da386051cd2306d442b05980be4f2ecb1","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id, snat_prefix):"},{"line_number":134,"context_line":"        for ns in self.list_all():"},{"line_number":135,"context_line":"            prefix \u003d namespaces.get_prefix_from_ns_name(ns)"},{"line_number":136,"context_line":"            if prefix !\u003d snat_prefix:"},{"line_number":137,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_601e61bc","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":34},"updated":"2016-07-12 07:48:39.000000000","message":"I\u0027d avoid listing all namespaces once again. Please think on a way to tell namespace manager to not _keep_ snat namespaces for certain routers during fullsync, so it cleans up all stale resources on __exit__()","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"00c1409cbdd2951e2fe9233562139f1f5d032edb","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id, snat_prefix):"},{"line_number":134,"context_line":"        for ns in self.list_all():"},{"line_number":135,"context_line":"            prefix \u003d namespaces.get_prefix_from_ns_name(ns)"},{"line_number":136,"context_line":"            if prefix !\u003d snat_prefix:"},{"line_number":137,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_1d752897","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":34},"in_reply_to":"1aa78d24_601e61bc","updated":"2016-07-12 16:23:23.000000000","message":"Let me think through it.","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"40fa8aac3d21851000214342f4d0f0f8579f5cfc","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id, snat_prefix):"},{"line_number":134,"context_line":"        for ns in self.list_all():"},{"line_number":135,"context_line":"            prefix \u003d namespaces.get_prefix_from_ns_name(ns)"},{"line_number":136,"context_line":"            if prefix !\u003d snat_prefix:"},{"line_number":137,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_b50dfb90","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":34},"in_reply_to":"1aa78d24_601e61bc","updated":"2016-07-12 21:25:32.000000000","message":"Yes I was looking into your suggestion, but that might not be  straight forward, since this current only keeps track of ids and not prefixes. So in our case the snat namespace and the router has the same id, but different prefix.\n\nSo I thought have a specific function to remove the snat_namespace would be more clean. ( I will try to get rid of calling the namespace list again).","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                ns_prefix, ns_id \u003d self.get_prefix_and_id(ns)"},{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id):"},{"line_number":134,"context_line":"        prefix \u003d dvr_snat_ns.SNAT_NS_PREFIX"},{"line_number":135,"context_line":"        if prefix in self.ns_prefix_to_class_map:"},{"line_number":136,"context_line":"            self._cleanup(prefix, router_id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_58067a86","line":133,"range":{"start_line":133,"start_character":8,"end_line":133,"end_character":44},"updated":"2016-07-13 08:38:06.000000000","message":"\"ensure_snat_cleanup\" seems clear enough considering class name","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                ns_prefix, ns_id \u003d self.get_prefix_and_id(ns)"},{"line_number":131,"context_line":"                self._cleanup(ns_prefix, ns_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_router_snat_namespace_cleanup(self, router_id):"},{"line_number":134,"context_line":"        prefix \u003d dvr_snat_ns.SNAT_NS_PREFIX"},{"line_number":135,"context_line":"        if prefix in self.ns_prefix_to_class_map:"},{"line_number":136,"context_line":"            self._cleanup(prefix, router_id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_a0d2a059","line":133,"range":{"start_line":133,"start_character":8,"end_line":133,"end_character":44},"in_reply_to":"1aa78d24_58067a86","updated":"2016-07-13 19:37:33.000000000","message":"sure will rename it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"708bd4a9901f401367aa7c9f27abbe944558a6e1","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_snat_cleanup(self, router_id):"},{"line_number":134,"context_line":"        prefix \u003d dvr_snat_ns.SNAT_NS_PREFIX"},{"line_number":135,"context_line":"        if prefix in self.ns_prefix_to_class_map:"},{"line_number":136,"context_line":"            self._cleanup(prefix, router_id)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _cleanup(self, ns_prefix, ns_id):"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_8844084a","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":49},"updated":"2016-08-02 06:07:26.000000000","message":"why check this? I think it\u0027s better to fail explicitly in case SNAT_NS_PREFIX is removed from ns_prefix_to_class_map for some reason","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b8d397aeb13c9f1a176eb3a98dfe7e10d3e2dc2b","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def ensure_snat_cleanup(self, router_id):"},{"line_number":134,"context_line":"        prefix \u003d dvr_snat_ns.SNAT_NS_PREFIX"},{"line_number":135,"context_line":"        if prefix in self.ns_prefix_to_class_map:"},{"line_number":136,"context_line":"            self._cleanup(prefix, router_id)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _cleanup(self, ns_prefix, ns_id):"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_00d28c34","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":49},"in_reply_to":"bacf61ea_8844084a","updated":"2016-08-02 17:11:11.000000000","message":"Done","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"}],"neutron/agent/l3/router_info.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a2cc6e6c0eec799bae3dba77fe67cac8b52a7992","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":652,"context_line":"        if ex_gw_port:"},{"line_number":653,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":654,"context_line":"                self.remove_external_gateway_ip(device,"},{"line_number":655,"context_line":"                                                common_utils.ip_to_cidr("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_31244ac5","line":652,"range":{"start_line":652,"start_character":8,"end_line":652,"end_character":21},"updated":"2016-06-09 10:23:49.000000000","message":"checked in base class","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"89f08b7241fb337d5d9eb4c1d4f853aaca8b22b6","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":652,"context_line":"        if ex_gw_port:"},{"line_number":653,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":654,"context_line":"                self.remove_external_gateway_ip(device,"},{"line_number":655,"context_line":"                                                common_utils.ip_to_cidr("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_63d56be3","line":652,"updated":"2016-06-09 08:50:47.000000000","message":"unit test","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1eb386d3a74958e784021df3fa7343bf5eb1057b","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":652,"context_line":"        if ex_gw_port:"},{"line_number":653,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":654,"context_line":"                self.remove_external_gateway_ip(device,"},{"line_number":655,"context_line":"                                                common_utils.ip_to_cidr("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_9ba41b09","line":652,"range":{"start_line":652,"start_character":8,"end_line":652,"end_character":21},"in_reply_to":"7aa08908_31244ac5","updated":"2016-06-09 19:04:10.000000000","message":"Done","commit_id":"2b2d5f9da63b0503cf4eca9e8247e3a58eba94ea"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":648,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":652,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":653,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":654,"context_line":"        # of the stale gateway and it should not error out while looking"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_81166853","line":651,"updated":"2016-06-09 20:04:45.000000000","message":"nit: this can move under if statement since not needed otherwise.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":648,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":652,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":653,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":654,"context_line":"        # of the stale gateway and it should not error out while looking"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_d916a8f0","line":651,"in_reply_to":"7aa08908_81166853","updated":"2016-06-09 21:00:46.000000000","message":"will fix it.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":688,"context_line":"        elif not ex_gw_port and not self.ex_gw_port:"},{"line_number":689,"context_line":"            # Condition to remove any gateway namespaces"},{"line_number":690,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":691,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":692,"context_line":""},{"line_number":693,"context_line":"        existing_devices \u003d self._get_existing_devices()"},{"line_number":694,"context_line":"        stale_devs \u003d [dev for dev in existing_devices"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_61b53ccf","line":691,"updated":"2016-06-09 20:04:45.000000000","message":"Seems this can be combined with L686-687, with L685 just being an \"else:\" since ex_gw_port will not be set in that case.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":688,"context_line":"        elif not ex_gw_port and not self.ex_gw_port:"},{"line_number":689,"context_line":"            # Condition to remove any gateway namespaces"},{"line_number":690,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":691,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":692,"context_line":""},{"line_number":693,"context_line":"        existing_devices \u003d self._get_existing_devices()"},{"line_number":694,"context_line":"        stale_devs \u003d [dev for dev in existing_devices"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_d9c4e860","line":691,"in_reply_to":"7aa08908_61b53ccf","updated":"2016-06-09 21:00:46.000000000","message":"will fix it.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"},{"line_number":654,"context_line":"        # for ex_gw_port[\u0027fixed_ips\u0027]"},{"line_number":655,"context_line":"        if ex_gw_port:"},{"line_number":656,"context_line":"            device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"},{"line_number":657,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":658,"context_line":"                self.remove_external_gateway_ip(device,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_53e6dab4","line":655,"range":{"start_line":655,"start_character":8,"end_line":655,"end_character":21},"updated":"2016-06-10 19:54:46.000000000","message":"This one makes sense.","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"67aed3eec99ec575fe8a4b59f8f52b2f2431db1c","unresolved":false,"context_lines":[{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # If either the self.ex_gw_port or not self.ex_gw_port this"},{"line_number":687,"context_line":"            # this condition should work."},{"line_number":688,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":689,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":690,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_9063181a","line":687,"range":{"start_line":687,"start_character":14,"end_line":687,"end_character":18},"updated":"2016-06-10 19:54:46.000000000","message":"nit:  duplicate \"this\".  Actually, the whole comment is kind of redundant.  But, I\u0027m okay with it.  Maybe shorten it:\n\n  This works if self.ex_gw_port is True or not.","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c7e21ee936e17028ef3e673b855a2f66aafd9a53","unresolved":false,"context_lines":[{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # If either the self.ex_gw_port or not self.ex_gw_port this"},{"line_number":687,"context_line":"            # this condition should work."},{"line_number":688,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":689,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":690,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_de577100","line":687,"range":{"start_line":687,"start_character":14,"end_line":687,"end_character":18},"in_reply_to":"7aa08908_9063181a","updated":"2016-06-10 20:21:13.000000000","message":"Done","commit_id":"4ac1eb3b0f0a5809b309f59e664a6fb08cd3220f"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c4bfa50026cb43eb72c42bb0bdb3ef96622b2591","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_8f549cca","line":686,"updated":"2016-06-16 16:36:27.000000000","message":"I think you should make this \u0027elif self.ex_gw_port:\u0027 so we don\u0027t call into things with None.  The \u0027not ex_gw_port\u0027 can go because it\u0027s implied here.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a44b54bb94cc7a4ebe4b88cf777f95cf56996c5d","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_d2d0f2f9","line":686,"in_reply_to":"7aa08908_8f549cca","updated":"2016-06-17 04:17:35.000000000","message":"This is may not be required, since we need to handle the ex_gw_port \u0027None\u0027 case.","commit_id":"47a989c87568eed91b2c50f520c0e9955387f4b3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6b00c3381148135e890e5cc8c29c638bf40c0d76","unresolved":false,"context_lines":[{"line_number":646,"context_line":"            ex_gw_port, interface_name, self.ns_name, preserve_ips)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_ba05db46","line":650,"range":{"start_line":649,"start_character":8,"end_line":650,"end_character":45},"updated":"2016-07-07 09:54:05.000000000","message":"should this be logged every time when updating router that has no gateway? I guess no","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ffab03ed065187e3cef830f2cfd2bebea087c728","unresolved":false,"context_lines":[{"line_number":646,"context_line":"            ex_gw_port, interface_name, self.ns_name, preserve_ips)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_c8b5fcd0","line":650,"range":{"start_line":649,"start_character":8,"end_line":650,"end_character":45},"in_reply_to":"1aa78d24_6a6229da","updated":"2016-07-11 08:03:11.000000000","message":"Yeah, but with this patch (line #687) this now will be called every time when updating router that has no gateway","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"23b193ef1af70b061f0f5b43b74f6a03eaecf827","unresolved":false,"context_lines":[{"line_number":646,"context_line":"            ex_gw_port, interface_name, self.ns_name, preserve_ips)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def external_gateway_removed(self, ex_gw_port, interface_name):"},{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_6a6229da","line":650,"range":{"start_line":649,"start_character":8,"end_line":650,"end_character":45},"in_reply_to":"1aa78d24_ba05db46","updated":"2016-07-08 17:03:59.000000000","message":"Do you really think I should modify it part of this patch.\nLet us take it in different patch.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"6b00c3381148135e890e5cc8c29c638bf40c0d76","unresolved":false,"context_lines":[{"line_number":659,"context_line":"                                                common_utils.ip_to_cidr("},{"line_number":660,"context_line":"                                                    ip_addr[\u0027ip_address\u0027],"},{"line_number":661,"context_line":"                                                    ip_addr[\u0027prefixlen\u0027]))"},{"line_number":662,"context_line":"        self.driver.unplug(interface_name,"},{"line_number":663,"context_line":"                           bridge\u003dself.agent_conf.external_network_bridge,"},{"line_number":664,"context_line":"                           namespace\u003dself.ns_name,"},{"line_number":665,"context_line":"                           prefix\u003dEXTERNAL_DEV_PREFIX)"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    @staticmethod"},{"line_number":668,"context_line":"    def _gateway_ports_equal(port1, port2):"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_fa764304","line":665,"range":{"start_line":662,"start_character":8,"end_line":665,"end_character":54},"updated":"2016-07-07 09:54:05.000000000","message":"ditto","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"23b193ef1af70b061f0f5b43b74f6a03eaecf827","unresolved":false,"context_lines":[{"line_number":659,"context_line":"                                                common_utils.ip_to_cidr("},{"line_number":660,"context_line":"                                                    ip_addr[\u0027ip_address\u0027],"},{"line_number":661,"context_line":"                                                    ip_addr[\u0027prefixlen\u0027]))"},{"line_number":662,"context_line":"        self.driver.unplug(interface_name,"},{"line_number":663,"context_line":"                           bridge\u003dself.agent_conf.external_network_bridge,"},{"line_number":664,"context_line":"                           namespace\u003dself.ns_name,"},{"line_number":665,"context_line":"                           prefix\u003dEXTERNAL_DEV_PREFIX)"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    @staticmethod"},{"line_number":668,"context_line":"    def _gateway_ports_equal(port1, port2):"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_4a5f6d0e","line":665,"range":{"start_line":662,"start_character":8,"end_line":665,"end_character":54},"in_reply_to":"1aa78d24_fa764304","updated":"2016-07-08 17:03:59.000000000","message":"See my reply above.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"58e63ba9f66dc5b8e35829dd742aa87b4c8ac2f4","unresolved":false,"context_lines":[{"line_number":682,"context_line":"                pd.add_gw_interface(self.router[\u0027id\u0027], interface_name)"},{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        existing_devices \u003d self._get_existing_devices()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_b156a103","line":687,"range":{"start_line":685,"start_character":8,"end_line":687,"end_character":74},"updated":"2016-07-07 10:12:13.000000000","message":"not happy with this being called each time processing router without gateway. Logically we should only check for stale things and do cleanup on agent restart/revival (fullsync). What do you think?","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5aed253355449fdff8b22dd2717e1feea91e1da8","unresolved":false,"context_lines":[{"line_number":682,"context_line":"                pd.add_gw_interface(self.router[\u0027id\u0027], interface_name)"},{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        existing_devices \u003d self._get_existing_devices()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_700bdcd6","line":687,"range":{"start_line":685,"start_character":8,"end_line":687,"end_character":74},"in_reply_to":"1aa78d24_08e704e5","updated":"2016-07-12 00:43:52.000000000","message":"Yes will try to see if I can do it in fullsync instead of here.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"23b193ef1af70b061f0f5b43b74f6a03eaecf827","unresolved":false,"context_lines":[{"line_number":682,"context_line":"                pd.add_gw_interface(self.router[\u0027id\u0027], interface_name)"},{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        existing_devices \u003d self._get_existing_devices()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_ea7bb979","line":687,"range":{"start_line":685,"start_character":8,"end_line":687,"end_character":74},"in_reply_to":"1aa78d24_b156a103","updated":"2016-07-08 17:03:59.000000000","message":"Is there a state to identify if it is a agent restart or not. Otherwise, this would be the right place to do it.\n\nPlease let me know if you have any other thoughts.","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ffab03ed065187e3cef830f2cfd2bebea087c728","unresolved":false,"context_lines":[{"line_number":682,"context_line":"                pd.add_gw_interface(self.router[\u0027id\u0027], interface_name)"},{"line_number":683,"context_line":"            elif not self._gateway_ports_equal(ex_gw_port, self.ex_gw_port):"},{"line_number":684,"context_line":"                self.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":685,"context_line":"        else:"},{"line_number":686,"context_line":"            # This works if self.ex_gw_port is true or not"},{"line_number":687,"context_line":"            self.external_gateway_removed(self.ex_gw_port, interface_name)"},{"line_number":688,"context_line":"            pd.remove_gw_interface(self.router[\u0027id\u0027])"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        existing_devices \u003d self._get_existing_devices()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_08e704e5","line":687,"range":{"start_line":685,"start_character":8,"end_line":687,"end_character":74},"in_reply_to":"1aa78d24_ea7bb979","updated":"2016-07-11 08:03:11.000000000","message":"I believe fullsync is a good place to handle stale resources cleanup. Fullsync is performed at agent start/revival","commit_id":"af697a203a0c531a0d0dc57d2220c070b1ae661d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5cd78a3da386051cd2306d442b05980be4f2ecb1","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"},{"line_number":654,"context_line":"        # for ex_gw_port[\u0027fixed_ips\u0027]"},{"line_number":655,"context_line":"        if ex_gw_port:"},{"line_number":656,"context_line":"            device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_e0b37198","line":653,"range":{"start_line":652,"start_character":16,"end_line":653,"end_character":30},"updated":"2016-07-12 07:48:39.000000000","message":"is there such a place with current state of the patch (calling external_gateway_removed with ex_gw_port\u003dNone)?","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"00c1409cbdd2951e2fe9233562139f1f5d032edb","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        LOG.debug(\"External gateway removed: port(%s), interface(%s)\","},{"line_number":650,"context_line":"                  ex_gw_port, interface_name)"},{"line_number":651,"context_line":"        # Make sure we check again for the existence of the ex_gw_port,"},{"line_number":652,"context_line":"        # since there may be a call to this function to do the cleanup"},{"line_number":653,"context_line":"        # of the stale gateway and it should not error out while looking"},{"line_number":654,"context_line":"        # for ex_gw_port[\u0027fixed_ips\u0027]"},{"line_number":655,"context_line":"        if ex_gw_port:"},{"line_number":656,"context_line":"            device \u003d ip_lib.IPDevice(interface_name, namespace\u003dself.ns_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_5df050fd","line":653,"range":{"start_line":652,"start_character":16,"end_line":653,"end_character":30},"in_reply_to":"1aa78d24_e0b37198","updated":"2016-07-12 16:23:23.000000000","message":"Yes I think we can get rid of this.","commit_id":"5d3ee3b38b00a76d33b7da50aea5805dac72bdf7"}],"neutron/tests/functional/agent/l3/test_dvr_router.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"627a8e65896fb626f8b6f3dee02752c210862358","unresolved":false,"context_lines":[{"line_number":808,"context_line":"        router_info[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":809,"context_line":"        self._add_snat_port_info_to_router("},{"line_number":810,"context_line":"            router_info, router_info[l3_constants.INTERFACE_KEY])"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        router \u003d self.manage_router(self.agent, router_info)"},{"line_number":813,"context_line":"        router_ip_cidr1 \u003d self._port_first_ip_cidr(router.internal_ports[0])"},{"line_number":814,"context_line":"        router_ip1 \u003d router_ip_cidr1.partition(\u0027/\u0027)[0]"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_1019c222","side":"PARENT","line":811,"updated":"2016-07-06 02:37:18.000000000","message":"nit: unrelated change","commit_id":"e520e21d8574f41ab64a2a550e6801a8b5a97b9a"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0281cc58172fe2830bc6c51d17d35a66aaae9028","unresolved":false,"context_lines":[{"line_number":808,"context_line":"        router_info[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":809,"context_line":"        self._add_snat_port_info_to_router("},{"line_number":810,"context_line":"            router_info, router_info[l3_constants.INTERFACE_KEY])"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        router \u003d self.manage_router(self.agent, router_info)"},{"line_number":813,"context_line":"        router_ip_cidr1 \u003d self._port_first_ip_cidr(router.internal_ports[0])"},{"line_number":814,"context_line":"        router_ip1 \u003d router_ip_cidr1.partition(\u0027/\u0027)[0]"}],"source_content_type":"text/x-python","patch_set":20,"id":"1aa78d24_70129358","side":"PARENT","line":811,"updated":"2016-07-06 19:37:35.000000000","message":"nit: whitespace change","commit_id":"0ad114ab80a577ec64afbe417035b63af40205c4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2d717e433b406af60b48482d198ed61982917f56","unresolved":false,"context_lines":[{"line_number":862,"context_line":"        self.agent.conf.agent_mode \u003d \u0027dvr_snat\u0027"},{"line_number":863,"context_line":"        router_info \u003d self.generate_dvr_router_info()"},{"line_number":864,"context_line":"        router1 \u003d self.manage_router(self.agent, router_info)"},{"line_number":865,"context_line":"        # Now save the internal device name to verify later"},{"line_number":866,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":867,"context_line":"        # Now we have verified that the snat_namespace exists."},{"line_number":868,"context_line":"        self.assertTrue(router1.snat_namespace.exists())"},{"line_number":869,"context_line":"        restarted_agent \u003d neutron_l3_agent.L3NATAgentWithStateReport("},{"line_number":870,"context_line":"            self.agent.host, self.agent.conf)"},{"line_number":871,"context_line":"        router1.router[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_121c8e69","line":868,"range":{"start_line":865,"start_character":8,"end_line":868,"end_character":56},"updated":"2016-07-14 08:52:17.000000000","message":"aren\u0027t these two doing the same thing?","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2d717e433b406af60b48482d198ed61982917f56","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        router1.router[\u0027gw_port\u0027] \u003d \"\""},{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_92551efc","line":875,"range":{"start_line":875,"start_character":8,"end_line":875,"end_character":51},"updated":"2016-07-14 08:52:17.000000000","message":"no need to assert second time, nothing changed","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"77170547e74b0642999033cac0b4a5864fc4c8e5","unresolved":false,"context_lines":[{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_e6d2f65a","line":876,"updated":"2016-07-14 00:19:30.000000000","message":"Still not clear on why the functional test here is not able to capture the namespace_manager actions.\n\nAny thoughts!.","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2d717e433b406af60b48482d198ed61982917f56","unresolved":false,"context_lines":[{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_126bee86","line":876,"range":{"start_line":876,"start_character":27,"end_line":876,"end_character":45},"updated":"2016-07-14 08:52:17.000000000","message":"the test is failing because now stale snat namespaces are cleaned up during fullsync, not during router processing","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"79dc4973f646426b739bd29994e357922b37f81c","unresolved":false,"context_lines":[{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_ca019d6c","line":876,"range":{"start_line":876,"start_character":27,"end_line":876,"end_character":45},"in_reply_to":"1aa78d24_126bee86","updated":"2016-07-14 14:51:17.000000000","message":"Do you think then we might not be able to capture the namespace delete here?","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"bf3ef46dfebd8f743aeb3079e1cb126df06db739","unresolved":false,"context_lines":[{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"dada55a8_0e874662","line":876,"range":{"start_line":876,"start_character":27,"end_line":876,"end_character":45},"in_reply_to":"1aa78d24_54952b86","updated":"2016-07-18 15:47:47.000000000","message":"ok, I will handle it in test_agent.py for these test cases.","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e5da4df8874adea6df3916d63bd9242c2ad4dd94","unresolved":false,"context_lines":[{"line_number":873,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"\""},{"line_number":874,"context_line":"        router1.router[\u0027external_gateway_info\u0027] \u003d \"\""},{"line_number":875,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":876,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":877,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"1aa78d24_54952b86","line":876,"range":{"start_line":876,"start_character":27,"end_line":876,"end_character":45},"in_reply_to":"1aa78d24_ca019d6c","updated":"2016-07-15 08:44:17.000000000","message":"Need to emulate agent resync to capture stale namespace cleanup. test_legacy_router has some tests on it","commit_id":"a90cd700865f712d14304fbf9c82dcd706442795"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a40e8a0b84a7860bfc461172055b828665aa3b62","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_24d06b53","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"updated":"2016-07-28 08:35:18.000000000","message":"another test case to consider is when ext gw was removed from router which is handled in resync loop - to cover this code path as well","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b233c7398f766173562d13624e6462d66c65d620","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_3b62f33e","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"in_reply_to":"bacf61ea_1851f536","updated":"2016-07-29 15:43:29.000000000","message":"ah, I see, interesting. Follow-up is ok then","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6b080303106e6c55dafd9098dbedcaabf98aa779","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_f93703ae","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"in_reply_to":"bacf61ea_24d06b53","updated":"2016-07-28 15:17:27.000000000","message":"Oleg, yes I had a test case for that use case, in the previous patch set and it caused unwanted failures in the functional tests since the functional test itself had issues when cleaning up the stale namespaces. \n\nSee the test below: This was introduced in patch set 28 and I had to remove it, since it was randomly causing failures on other functional tests.\n\nWe have to probably fix the random failures in functional test which is currently using the stale \u0027snat_namespace\u0027 and then add this test case.\n\nIf you agree, we can push this patch and later fix the functional test and add this test case there.\n\ndef _test_periodic_sync_routers_task_snat_ns_delete(\n        self, router, agent,\n        gw_port_host_change\u003dFalse, gw_clear\u003dFalse):\n        ri \u003d self.manage_router(agent, router)\n        self._assert_snat_namespace_exists(ri)\n        self._namespace_exists(ri.ns_name)\n        nw_id \u003d ri.router[\u0027gw_port\u0027][\u0027network_id\u0027]\n        ri.router[\u0027external_gateway_info\u0027] \u003d {\n            \u0027network_id\u0027: nw_id,\n            \u0027enable_snat\u0027: ri.router[\u0027enable_snat\u0027]\n        }\n        if gw_port_host_change:\n            ri.router[\u0027gw_port_host\u0027] \u003d \u0027my-new-host\u0027\n        if gw_clear:\n            ri.router[\u0027gw_port\u0027] \u003d \"\"\n            ri.router[\u0027external_gateway_info\u0027] \u003d \"\"\n            ri.router[\u0027gw_port_host\u0027] \u003d \"\"\n\n        # clear agent router info as it will be after restart\n        mocked_get_router_ids \u003d self.mock_plugin_api.get_router_ids\n        mocked_get_router_ids.return_value \u003d ri.router[\u0027id\u0027]\n        mocked_get_routers \u003d self.mock_plugin_api.get_routers\n        mocked_get_routers.return_value \u003d [ri.router]\n        # clear agent router info as it will be after restart\n        agent.router_info \u003d {}\n        agent.periodic_sync_routers_task(agent.context)\n        while not agent._queue._queue.empty():\n            agent._process_router_update()\n        self._namespace_exists(ri.ns_name)\n        self._assert_snat_namespace_does_not_exist(ri)\n\n\ndef test_dvr_periodic_sync_routers_snat_ns_delete_with_no_gateway(\n        self):\n        \"\"\"Test to validate the stale snat namespace delete with snat clear.\n\n        This test validates the stale snat namespace cleanup when\n        the agent restarts after the gateway port has been removed\n        from the router.\n        \"\"\"\n        self.agent.conf.agent_mode \u003d \u0027dvr_snat\u0027\n        router_info \u003d self.generate_dvr_router_info(enable_snat\u003dTrue)\n        self._test_periodic_sync_routers_task_snat_ns_delete(\n            router_info, self.agent, gw_clear\u003dTrue)","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8057f2cf0ab31c8cb7dc5e5106d7542e2ea1a531","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"fa7ab95a_ad51d864","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"in_reply_to":"bacf61ea_3b62f33e","updated":"2016-08-26 08:43:14.000000000","message":"Is it the right time for the follow-up with a func test?","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f6bdd21a531e8ed558303a67e070d36648aa969e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_1851f536","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"in_reply_to":"bacf61ea_81baacbe","updated":"2016-07-29 15:32:19.000000000","message":"What I wanted to say here is the functional in its current state is kind of using a stale SNAT namespace for couple of tests, and if I introduce this test, it was wipping out the  snat_namespace that was stale and so causing the other tests to fail.\n\nI agree that a test is required to capture the regression.\nBut I thought I can take up the work of cleaning up the functional test in a different patch.\n\nIf it has to be addressed as part of this patch, then I can proceed.","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"eaa3ba179316c295a4157756c1d66dc7fd20ccac","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._delete_router(self.agent, router.router_id)"},{"line_number":150,"context_line":"        self._assert_fip_namespace_deleted(ext_gateway_port)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_dvr_unused_snat_ns_deleted_when_agent_restarts_after_move(self):"},{"line_number":153,"context_line":"        \"\"\"Test to validate the stale snat namespace delete with snat move."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This test validates the stale snat namespace cleanup when"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_81baacbe","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":70},"in_reply_to":"bacf61ea_f93703ae","updated":"2016-07-29 06:47:15.000000000","message":"Not sure I got it. If a test is causing failures in some other tests than it\u0027s not properly isolated and does not cleanup after itself. My concern is that we\u0027re not covering the code change in this patch and hence may introduce a regression, and func tests failures may be a symptom.","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"a40e8a0b84a7860bfc461172055b828665aa3b62","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self.agent.host, self.agent.conf)"},{"line_number":165,"context_line":"        router1.router[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":166,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"my-new-host\""},{"line_number":167,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":168,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":169,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_4473dfb1","line":167,"range":{"start_line":167,"start_character":8,"end_line":167,"end_character":51},"updated":"2016-07-28 08:35:18.000000000","message":"no need to check for the second time, nothing changed yet","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6b080303106e6c55dafd9098dbedcaabf98aa779","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            self.agent.host, self.agent.conf)"},{"line_number":165,"context_line":"        router1.router[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":166,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"my-new-host\""},{"line_number":167,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":168,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":169,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_b9910b9c","line":167,"range":{"start_line":167,"start_character":8,"end_line":167,"end_character":51},"in_reply_to":"bacf61ea_4473dfb1","updated":"2016-07-28 15:17:27.000000000","message":"will fix this.","commit_id":"26a5a2bad1720fdaf358d6a77d30044f0b6e219b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"708bd4a9901f401367aa7c9f27abbe944558a6e1","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":163,"context_line":"        restarted_agent \u003d neutron_l3_agent.L3NATAgentWithStateReport("},{"line_number":164,"context_line":"            self.agent.host, self.agent.conf)"},{"line_number":165,"context_line":"        router1.router[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":166,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"my-new-host\""},{"line_number":167,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":168,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_88b2484a","line":165,"range":{"start_line":165,"start_character":8,"end_line":165,"end_character":57},"updated":"2016-08-02 06:07:26.000000000","message":"is this needed?","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b8d397aeb13c9f1a176eb3a98dfe7e10d3e2dc2b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self._assert_snat_namespace_exists(router1)"},{"line_number":163,"context_line":"        restarted_agent \u003d neutron_l3_agent.L3NATAgentWithStateReport("},{"line_number":164,"context_line":"            self.agent.host, self.agent.conf)"},{"line_number":165,"context_line":"        router1.router[n_const.SNAT_ROUTER_INTF_KEY] \u003d []"},{"line_number":166,"context_line":"        router1.router[\u0027gw_port_host\u0027] \u003d \"my-new-host\""},{"line_number":167,"context_line":"        restarted_router \u003d self.manage_router(restarted_agent, router1.router)"},{"line_number":168,"context_line":"        self._assert_snat_namespace_does_not_exist(restarted_router)"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_89d7c7ec","line":165,"range":{"start_line":165,"start_character":8,"end_line":165,"end_character":57},"in_reply_to":"bacf61ea_88b2484a","updated":"2016-08-02 17:11:11.000000000","message":"Done","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"}],"neutron/tests/unit/agent/l3/test_agent.py":[{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"ade4ae6cd17023d718031dfbd2ce439435938372","unresolved":false,"context_lines":[{"line_number":654,"context_line":"                                      router,"},{"line_number":655,"context_line":"                                      **self.ri_kwargs)"},{"line_number":656,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":657,"context_line":"        self.assertFalse(ri.snat_namespace.exists())"},{"line_number":658,"context_line":"        ri._create_snat_namespace()"},{"line_number":659,"context_line":"        self.assertTrue(ri.snat_namespace.exists())"},{"line_number":660,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_b376e9a1","line":657,"updated":"2016-06-07 21:31:34.000000000","message":"It kind of fails here, something might be wrong.","commit_id":"e8d97d64de572b31b2dd114108f2593ba3e56bc0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":635,"context_line":"                                      router[\u0027id\u0027],"},{"line_number":636,"context_line":"                                      router,"},{"line_number":637,"context_line":"                                      **self.ri_kwargs)"},{"line_number":638,"context_line":"        # Makesure that ri.snat_namespace object is created when the"},{"line_number":639,"context_line":"        # router is initialized"},{"line_number":640,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":641,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_a1e604e6","line":638,"updated":"2016-06-09 20:04:45.000000000","message":"nit: Make sure","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":635,"context_line":"                                      router[\u0027id\u0027],"},{"line_number":636,"context_line":"                                      router,"},{"line_number":637,"context_line":"                                      **self.ri_kwargs)"},{"line_number":638,"context_line":"        # Makesure that ri.snat_namespace object is created when the"},{"line_number":639,"context_line":"        # router is initialized"},{"line_number":640,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":641,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_59863814","line":638,"in_reply_to":"7aa08908_a1e604e6","updated":"2016-06-09 21:00:46.000000000","message":"will fix it.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                                      **self.ri_kwargs)"},{"line_number":674,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":675,"context_line":"        ri._create_snat_namespace()"},{"line_number":676,"context_line":"        self.assertTrue(ri.snat_namespace.exists())"},{"line_number":677,"context_line":"        ri.snat_namespace.delete()"},{"line_number":678,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":679,"context_line":"        self.assertTrue(mock_snat_ns_del.called)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_81d5c8ba","line":676,"updated":"2016-06-09 20:04:45.000000000","message":"This doesn\u0027t look to be testing anything based on your comment below.  Are you just trying to make sure ri.snat_namespace is never cleared?","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                                      **self.ri_kwargs)"},{"line_number":674,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":675,"context_line":"        ri._create_snat_namespace()"},{"line_number":676,"context_line":"        self.assertTrue(ri.snat_namespace.exists())"},{"line_number":677,"context_line":"        ri.snat_namespace.delete()"},{"line_number":678,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":679,"context_line":"        self.assertTrue(mock_snat_ns_del.called)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_59b478d0","line":676,"in_reply_to":"7aa08908_81d5c8ba","updated":"2016-06-09 21:00:46.000000000","message":"Just trying to show here because of the mock that we have for the device_exists, it would replicate the mock value.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":678,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":679,"context_line":"        self.assertTrue(mock_snat_ns_del.called)"},{"line_number":680,"context_line":"        # This will always return true since mock_ip is mocked."},{"line_number":681,"context_line":"        self.assertTrue(ri.snat_namespace.exists())"},{"line_number":682,"context_line":"        # Now let us set the mock value to false."},{"line_number":683,"context_line":"        self.mock_ip.netns.exists.return_value \u003d False"},{"line_number":684,"context_line":"        self.assertFalse(ri.snat_namespace.exists())"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_e1dacce8","line":681,"updated":"2016-06-09 20:04:45.000000000","message":"I don\u0027t think you need this or below as it\u0027s not really testing anything.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":678,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":679,"context_line":"        self.assertTrue(mock_snat_ns_del.called)"},{"line_number":680,"context_line":"        # This will always return true since mock_ip is mocked."},{"line_number":681,"context_line":"        self.assertTrue(ri.snat_namespace.exists())"},{"line_number":682,"context_line":"        # Now let us set the mock value to false."},{"line_number":683,"context_line":"        self.mock_ip.netns.exists.return_value \u003d False"},{"line_number":684,"context_line":"        self.assertFalse(ri.snat_namespace.exists())"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_79e694e9","line":681,"in_reply_to":"7aa08908_e1dacce8","updated":"2016-06-09 21:00:46.000000000","message":"Yes just to prove that nothing much can be done in here.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":705,"context_line":"        # Make sure we set a return value to emulate the non existence"},{"line_number":706,"context_line":"        # of the namespace."},{"line_number":707,"context_line":"        self.mock_ip.netns.exists.return_value \u003d False"},{"line_number":708,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":709,"context_line":"        if ri.snat_namespace.exists():"},{"line_number":710,"context_line":"            ri.snat_namespace.delete()"},{"line_number":711,"context_line":"            self.assertTrue(mock_ns_del.called)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_4199201f","line":708,"updated":"2016-06-09 20:04:45.000000000","message":"assertIsNotNone ?","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":705,"context_line":"        # Make sure we set a return value to emulate the non existence"},{"line_number":706,"context_line":"        # of the namespace."},{"line_number":707,"context_line":"        self.mock_ip.netns.exists.return_value \u003d False"},{"line_number":708,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":709,"context_line":"        if ri.snat_namespace.exists():"},{"line_number":710,"context_line":"            ri.snat_namespace.delete()"},{"line_number":711,"context_line":"            self.assertTrue(mock_ns_del.called)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_99f42088","line":708,"in_reply_to":"7aa08908_4199201f","updated":"2016-06-09 21:00:46.000000000","message":"Yes this is check that the object is there but namespace does not exist.","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f25a3bceecf9b6ba162bf8d15dfb792c2b8b8dcf","unresolved":false,"context_lines":[{"line_number":708,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":709,"context_line":"        if ri.snat_namespace.exists():"},{"line_number":710,"context_line":"            ri.snat_namespace.delete()"},{"line_number":711,"context_line":"            self.assertTrue(mock_ns_del.called)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    def _test_ext_gw_updated_dvr_edge_router(self, host_match,"},{"line_number":714,"context_line":"                                             snat_hosted_before\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_0190b8eb","line":711,"updated":"2016-06-09 20:04:45.000000000","message":"Will this get checked based on L707 ?","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5fb54f6b57714cd57e517bde59beef6df2282101","unresolved":false,"context_lines":[{"line_number":708,"context_line":"        self.assertTrue(ri.snat_namespace)"},{"line_number":709,"context_line":"        if ri.snat_namespace.exists():"},{"line_number":710,"context_line":"            ri.snat_namespace.delete()"},{"line_number":711,"context_line":"            self.assertTrue(mock_ns_del.called)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    def _test_ext_gw_updated_dvr_edge_router(self, host_match,"},{"line_number":714,"context_line":"                                             snat_hosted_before\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_99226000","line":711,"in_reply_to":"7aa08908_0190b8eb","updated":"2016-06-09 21:00:46.000000000","message":"might have to check this .","commit_id":"a05bc43a4d85ca92c8077c5637e34516b423ecbb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        # router is initialized"},{"line_number":623,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_7845366d","line":625,"range":{"start_line":625,"start_character":4,"end_line":625,"end_character":59},"updated":"2016-07-13 08:38:06.000000000","message":"why mocking at this level? Mocking in test body is more readable","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        # router is initialized"},{"line_number":623,"context_line":"        self.assertIsNotNone(ri.snat_namespace)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_20bfd0fd","line":625,"range":{"start_line":625,"start_character":4,"end_line":625,"end_character":59},"in_reply_to":"1aa78d24_7845366d","updated":"2016-07-13 19:37:33.000000000","message":"This was based on a code snippet in this file.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        This function specifically checks the impact of the snat"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_f8280699","line":627,"range":{"start_line":627,"start_character":14,"end_line":627,"end_character":26},"updated":"2016-07-13 08:38:06.000000000","message":"mock_snat_ns_delete","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        This function specifically checks the impact of the snat"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_003f3488","line":627,"range":{"start_line":627,"start_character":14,"end_line":627,"end_character":26},"in_reply_to":"1aa78d24_f8280699","updated":"2016-07-13 19:37:33.000000000","message":"ditto","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        This function specifically checks the impact of the snat"},{"line_number":631,"context_line":"        namespace object value on external_gateway_removed for deleting"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_d3b24d93","line":628,"range":{"start_line":628,"start_character":11,"end_line":628,"end_character":20},"updated":"2016-07-13 08:38:06.000000000","message":"Test","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":625,"context_line":"    @mock.patch.object(dvr_snat_ns.SnatNamespace, \u0027delete\u0027)"},{"line_number":626,"context_line":"    def test_ext_gw_updated_calling_snat_ns_delete_if_gw_port_host_none("},{"line_number":627,"context_line":"        self, mock_snat_ns):"},{"line_number":628,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        This function specifically checks the impact of the snat"},{"line_number":631,"context_line":"        namespace object value on external_gateway_removed for deleting"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_40493c32","line":628,"range":{"start_line":628,"start_character":11,"end_line":628,"end_character":20},"in_reply_to":"1aa78d24_d3b24d93","updated":"2016-07-13 19:37:33.000000000","message":"will rename it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":637,"context_line":"                                      router[\u0027id\u0027],"},{"line_number":638,"context_line":"                                      router,"},{"line_number":639,"context_line":"                                      **self.ri_kwargs)"},{"line_number":640,"context_line":"        ri._create_snat_namespace()"},{"line_number":641,"context_line":"        interface_name, ex_gw_port \u003d l3_test_common.prepare_ext_gw_test(self,"},{"line_number":642,"context_line":"                                                                        ri)"},{"line_number":643,"context_line":"        router[\u0027gw_port_host\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_387e0ee4","line":640,"range":{"start_line":640,"start_character":8,"end_line":640,"end_character":35},"updated":"2016-07-13 08:38:06.000000000","message":"is it needed for the test?","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":637,"context_line":"                                      router[\u0027id\u0027],"},{"line_number":638,"context_line":"                                      router,"},{"line_number":639,"context_line":"                                      **self.ri_kwargs)"},{"line_number":640,"context_line":"        ri._create_snat_namespace()"},{"line_number":641,"context_line":"        interface_name, ex_gw_port \u003d l3_test_common.prepare_ext_gw_test(self,"},{"line_number":642,"context_line":"                                                                        ri)"},{"line_number":643,"context_line":"        router[\u0027gw_port_host\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_c0024cba","line":640,"range":{"start_line":640,"start_character":8,"end_line":640,"end_character":35},"in_reply_to":"1aa78d24_387e0ee4","updated":"2016-07-13 19:37:33.000000000","message":"will check it again, this was written a while back.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":643,"context_line":"        router[\u0027gw_port_host\u0027] \u003d \u0027\u0027"},{"line_number":644,"context_line":"        ri.external_gateway_updated(ex_gw_port, interface_name)"},{"line_number":645,"context_line":"        if router[\u0027gw_port_host\u0027] !\u003d ri.host:"},{"line_number":646,"context_line":"            if ri.snat_namespace.exists():"},{"line_number":647,"context_line":"                self.assertEqual(1, mock_snat_ns.call_count)"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"    @mock.patch.object(namespaces.Namespace, \u0027delete\u0027)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_58979aeb","line":646,"range":{"start_line":646,"start_character":12,"end_line":646,"end_character":42},"updated":"2016-07-13 08:38:06.000000000","message":"ditto","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":649,"context_line":"    @mock.patch.object(namespaces.Namespace, \u0027delete\u0027)"},{"line_number":650,"context_line":"    def test_snat_ns_delete_not_called_when_snat_namespace_does_not_exist("},{"line_number":651,"context_line":"        self, mock_ns_del):"},{"line_number":652,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        This function specifically checks the impact of the snat"},{"line_number":655,"context_line":"        namespace object initialization without the actual creation"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_3368f1f4","line":652,"range":{"start_line":652,"start_character":11,"end_line":652,"end_character":19},"updated":"2016-07-13 08:38:06.000000000","message":"Test","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":649,"context_line":"    @mock.patch.object(namespaces.Namespace, \u0027delete\u0027)"},{"line_number":650,"context_line":"    def test_snat_ns_delete_not_called_when_snat_namespace_does_not_exist("},{"line_number":651,"context_line":"        self, mock_ns_del):"},{"line_number":652,"context_line":"        \"\"\"Function to check the impact of snat_namespace object."},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        This function specifically checks the impact of the snat"},{"line_number":655,"context_line":"        namespace object initialization without the actual creation"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_800164b2","line":652,"range":{"start_line":652,"start_character":11,"end_line":652,"end_character":19},"in_reply_to":"1aa78d24_3368f1f4","updated":"2016-07-13 19:37:33.000000000","message":"will rename it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"708bd4a9901f401367aa7c9f27abbe944558a6e1","unresolved":false,"context_lines":[{"line_number":612,"context_line":"        self._test_external_gateway_updated(dual_stack\u003dTrue)"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"    def test_dvr_edge_router_init_for_snat_namespace_object(self):"},{"line_number":615,"context_line":"        router \u003d l3_test_common.prepare_router_data(num_internal_ports\u003d2)"},{"line_number":616,"context_line":"        ri \u003d dvr_router.DvrEdgeRouter(mock.Mock(),"},{"line_number":617,"context_line":"                                      HOSTNAME,"},{"line_number":618,"context_line":"                                      router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_08ec9828","line":615,"range":{"start_line":615,"start_character":17,"end_line":615,"end_character":73},"updated":"2016-08-02 06:07:26.000000000","message":"can\u0027t it be just None for this test?","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"b8d397aeb13c9f1a176eb3a98dfe7e10d3e2dc2b","unresolved":false,"context_lines":[{"line_number":612,"context_line":"        self._test_external_gateway_updated(dual_stack\u003dTrue)"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"    def test_dvr_edge_router_init_for_snat_namespace_object(self):"},{"line_number":615,"context_line":"        router \u003d l3_test_common.prepare_router_data(num_internal_ports\u003d2)"},{"line_number":616,"context_line":"        ri \u003d dvr_router.DvrEdgeRouter(mock.Mock(),"},{"line_number":617,"context_line":"                                      HOSTNAME,"},{"line_number":618,"context_line":"                                      router[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"bacf61ea_2934db48","line":615,"range":{"start_line":615,"start_character":17,"end_line":615,"end_character":73},"in_reply_to":"bacf61ea_08ec9828","updated":"2016-08-02 17:11:11.000000000","message":"Just the router_id is required and I have updated the test.","commit_id":"cdff385964d91e10381ebfbcd5b41ed02932057e"}],"neutron/tests/unit/agent/l3/test_namespace_manager.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def test_ensure_router_snat_namespace_cleanup(self):"},{"line_number":95,"context_line":"        router_id \u003d _uuid()"},{"line_number":96,"context_line":"        ns_names \u003d [namespaces.NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":97,"context_line":"        ns_names +\u003d [dvr_snat_ns.SNAT_NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":98,"context_line":"        ns_names +\u003d [namespaces.NS_PREFIX + router_id,"},{"line_number":99,"context_line":"                     dvr_snat_ns.SNAT_NS_PREFIX + router_id]"},{"line_number":100,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_namespaces\u0027,"},{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_97155041","line":99,"range":{"start_line":96,"start_character":8,"end_line":99,"end_character":60},"updated":"2016-07-13 08:38:06.000000000","message":"seems not needed","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def test_ensure_router_snat_namespace_cleanup(self):"},{"line_number":95,"context_line":"        router_id \u003d _uuid()"},{"line_number":96,"context_line":"        ns_names \u003d [namespaces.NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":97,"context_line":"        ns_names +\u003d [dvr_snat_ns.SNAT_NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":98,"context_line":"        ns_names +\u003d [namespaces.NS_PREFIX + router_id,"},{"line_number":99,"context_line":"                     dvr_snat_ns.SNAT_NS_PREFIX + router_id]"},{"line_number":100,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_namespaces\u0027,"},{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_0024545e","line":99,"range":{"start_line":96,"start_character":8,"end_line":99,"end_character":60},"in_reply_to":"1aa78d24_97155041","updated":"2016-07-13 19:37:33.000000000","message":"will fix it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        ns_names +\u003d [dvr_snat_ns.SNAT_NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":98,"context_line":"        ns_names +\u003d [namespaces.NS_PREFIX + router_id,"},{"line_number":99,"context_line":"                     dvr_snat_ns.SNAT_NS_PREFIX + router_id]"},{"line_number":100,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_namespaces\u0027,"},{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"},{"line_number":103,"context_line":"            self.ns_manager.ensure_router_snat_namespace_cleanup(router_id)"},{"line_number":104,"context_line":"            expected \u003d [mock.call(dvr_snat_ns.SNAT_NS_PREFIX, router_id)]"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_773704e3","line":101,"range":{"start_line":100,"start_character":8,"end_line":101,"end_character":56},"updated":"2016-07-13 08:38:06.000000000","message":"not needed","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        ns_names +\u003d [dvr_snat_ns.SNAT_NS_PREFIX + _uuid() for _ in range(5)]"},{"line_number":98,"context_line":"        ns_names +\u003d [namespaces.NS_PREFIX + router_id,"},{"line_number":99,"context_line":"                     dvr_snat_ns.SNAT_NS_PREFIX + router_id]"},{"line_number":100,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_namespaces\u0027,"},{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"},{"line_number":103,"context_line":"            self.ns_manager.ensure_router_snat_namespace_cleanup(router_id)"},{"line_number":104,"context_line":"            expected \u003d [mock.call(dvr_snat_ns.SNAT_NS_PREFIX, router_id)]"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_201b501e","line":101,"range":{"start_line":100,"start_character":8,"end_line":101,"end_character":56},"in_reply_to":"1aa78d24_773704e3","updated":"2016-07-13 19:37:33.000000000","message":"will fix it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"8ac0527bb9b5e80f7656b4427a5233bde0f59402","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"},{"line_number":103,"context_line":"            self.ns_manager.ensure_router_snat_namespace_cleanup(router_id)"},{"line_number":104,"context_line":"            expected \u003d [mock.call(dvr_snat_ns.SNAT_NS_PREFIX, router_id)]"},{"line_number":105,"context_line":"            mock_cleanup.assert_has_calls(expected, any_order\u003dTrue)"},{"line_number":106,"context_line":"            self.assertEqual(1, mock_cleanup.call_count)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_ensure_router_cleanup(self):"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_97439041","line":105,"range":{"start_line":104,"start_character":12,"end_line":105,"end_character":67},"updated":"2016-07-13 08:38:06.000000000","message":"mock_cleanup.assert_called_once_with(...)","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"43a4d3d8461e6a6f79657067af386f279ff878f2","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                               return_value\u003dns_names), \\"},{"line_number":102,"context_line":"                mock.patch.object(self.ns_manager, \u0027_cleanup\u0027) as mock_cleanup:"},{"line_number":103,"context_line":"            self.ns_manager.ensure_router_snat_namespace_cleanup(router_id)"},{"line_number":104,"context_line":"            expected \u003d [mock.call(dvr_snat_ns.SNAT_NS_PREFIX, router_id)]"},{"line_number":105,"context_line":"            mock_cleanup.assert_has_calls(expected, any_order\u003dTrue)"},{"line_number":106,"context_line":"            self.assertEqual(1, mock_cleanup.call_count)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_ensure_router_cleanup(self):"}],"source_content_type":"text/x-python","patch_set":26,"id":"1aa78d24_601558e4","line":105,"range":{"start_line":104,"start_character":12,"end_line":105,"end_character":67},"in_reply_to":"1aa78d24_97439041","updated":"2016-07-13 19:37:33.000000000","message":"will add it.","commit_id":"96cd7e40160838a91ce8824b27e1c49a05759f7b"}]}
