)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"46d7b979cea7ea88253a106cf29b695d9dd07e9e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dongcan Ye \u003chellochosen@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-01-30 18:54:53 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Forbid adding a router interface on an external network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_6fc20c36","line":7,"updated":"2016-01-31 21:18:58.000000000","message":"Forbid to add ...","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"82662299aa213533a63f3b99cbbe2e64fc8cd957","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dongcan Ye \u003chellochosen@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-01-30 18:54:53 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Forbid adding a router interface on an external network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_3080b38a","line":7,"in_reply_to":"7a5de9d1_6fc20c36","updated":"2016-02-02 08:03:35.000000000","message":"Done","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"dc5899ae98f3ba966ff8538c4aa3b830ad69070f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Forbid adding a router interface on an external network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_5a283ee2","line":9,"updated":"2016-01-30 16:16:19.000000000","message":"attach","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"82662299aa213533a63f3b99cbbe2e64fc8cd957","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Forbid adding a router interface on an external network"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_507befbd","line":9,"in_reply_to":"7a5de9d1_5a283ee2","updated":"2016-02-02 08:03:35.000000000","message":"Done","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"46d7b979cea7ea88253a106cf29b695d9dd07e9e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibit adding a router interface (both using the way by"},{"line_number":14,"context_line":"port and by subnet) on an external network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_cfc9c05a","line":11,"range":{"start_line":11,"start_character":20,"end_line":11,"end_character":27},"updated":"2016-01-31 21:18:58.000000000","message":"IMO, the proposed solution is not the right one to avoid ip conflict: you should check a new interface subnet against others interface subnets and ext-net subnet.","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":15371,"name":"Tom Patzig","email":"tom.patzig@sap.com","username":"tpatzig"},"change_message_id":"e65c602d29ab70e53cf2f056759f5f74efa6542e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibit adding a router interface (both using the way by"},{"line_number":14,"context_line":"port and by subnet) on an external network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_fe70e941","line":11,"range":{"start_line":11,"start_character":20,"end_line":11,"end_character":27},"in_reply_to":"7a5de9d1_cfc9c05a","updated":"2016-02-01 07:56:30.000000000","message":"It is not conflicting with other neutron networks/subnets; it conflicts with the existing external gateway address. This address is defined in the external networks subnet and should never ever be brought up.","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"82662299aa213533a63f3b99cbbe2e64fc8cd957","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attch to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibit adding a router interface (both using the way by"},{"line_number":14,"context_line":"port and by subnet) on an external network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a5de9d1_9023a7bc","line":11,"range":{"start_line":11,"start_character":20,"end_line":11,"end_character":27},"in_reply_to":"7a5de9d1_fe70e941","updated":"2016-02-02 08:03:35.000000000","message":"@Cedric Brandily, agree with Tom. It will take the same ip address in qg and gr device.","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":19912,"name":"Xuanzhou Perry Dong","email":"oss_xzdong@163.com","username":"oss_xzdong"},"change_message_id":"44bee685a9b9b575a44e96d059e76b792e08621c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When user setting gateway for a router, need attach to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibit adding a router interface (add by subnet)"},{"line_number":14,"context_line":"on an external network."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ieda07e3bc04e7337c2e2aad750798d52347dab1b"},{"line_number":17,"context_line":"Closes-Bug: #1539444"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a5de9d1_1cf030c8","line":14,"range":{"start_line":12,"start_character":0,"end_line":14,"end_character":23},"updated":"2016-02-02 08:58:30.000000000","message":"nit: prohibit -\u003e prohibits","commit_id":"391a751ed6d2913e13c762796eb6dc4f60c1ee0b"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"ab0297373cd6a32c95002ed0ed4c2853c08a50d2","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When user setting gateway for a router, need attach to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibit adding a router interface (add by subnet)"},{"line_number":14,"context_line":"on an external network."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ieda07e3bc04e7337c2e2aad750798d52347dab1b"},{"line_number":17,"context_line":"Closes-Bug: #1539444"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a5ae5dd_e9cced6b","line":14,"range":{"start_line":12,"start_character":0,"end_line":14,"end_character":23},"in_reply_to":"7a5de9d1_1cf030c8","updated":"2016-02-05 03:43:26.000000000","message":"Done","commit_id":"391a751ed6d2913e13c762796eb6dc4f60c1ee0b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"be266e11a62633530ad892102bfc071d4664d551","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibits adding a router interface (add by subnet)"},{"line_number":14,"context_line":"on an external network."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ieda07e3bc04e7337c2e2aad750798d52347dab1b"},{"line_number":17,"context_line":"Closes-Bug: #1539444"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5a5ae5dd_acec832a","line":15,"updated":"2016-02-07 07:11:22.000000000","message":"The fact that this was supported and people may use this today in deployments will cause things to break if and when they upgrade with this patch. Can you please do the following:\nAdd DocImpact and UpgradeImpact flags here and provide a release note","commit_id":"f7f3145b87a13d8aed4a5710e034b63994637a9b"},{"author":{"_account_id":156,"name":"Ryu Ishimoto","email":"ryu@midokura.com","username":"ryu-midokura"},"change_message_id":"fd9868983c5bc747734a164bb577f3553c4fea4f","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When user setting gateway for a router, need attach to an external"},{"line_number":10,"context_line":"network. Meanwhile user can add a router interface on that external"},{"line_number":11,"context_line":"network, that cause gateway ip conflict in router namespace."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch prohibits adding a router interface (add by subnet)"},{"line_number":14,"context_line":"on an external network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a5ae5dd_2b46304f","line":11,"updated":"2016-02-08 04:44:23.000000000","message":"This seems to assume reference implementation.  At least one vendor plugin (midonet) supports this configuration where its virtual router acts as the gateway on an external network.  Could this be done in a way such that only reference implementation is affected?  Or at least with a flag?","commit_id":"2139b20e30584ef9657d169ccef4de20682a8f77"}],"neutron/db/l3_db.py":[{"author":{"_account_id":15371,"name":"Tom Patzig","email":"tom.patzig@sap.com","username":"tpatzig"},"change_message_id":"e65c602d29ab70e53cf2f056759f5f74efa6542e","unresolved":false,"context_lines":[{"line_number":544,"context_line":"            msg \u003d _(\u0027Router port must have at least one fixed IP\u0027)"},{"line_number":545,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":546,"context_line":"        port_net \u003d self._core_plugin.get_network(context, port[\u0027network_id\u0027])"},{"line_number":547,"context_line":"        if port_net.get(\u0027router:external\u0027, False):"},{"line_number":548,"context_line":"            msg \u003d _(\u0027Port belongs to an external network, \u0027"},{"line_number":549,"context_line":"                    \u0027cannot assign as a router interface.\u0027)"},{"line_number":550,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_012fa488","line":547,"updated":"2016-02-01 07:56:30.000000000","message":"This is not the use-case for the related bug. The bug only covers adding an interface by subnet, which then automatically creates a port with the existing external gateway address.\nI think when using a manually created port, the interface-add should be fine. It should be checked in an earlier state, when creating the port, that there is not the external gateway address used, but that is another topic ;)","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"82662299aa213533a63f3b99cbbe2e64fc8cd957","unresolved":false,"context_lines":[{"line_number":544,"context_line":"            msg \u003d _(\u0027Router port must have at least one fixed IP\u0027)"},{"line_number":545,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":546,"context_line":"        port_net \u003d self._core_plugin.get_network(context, port[\u0027network_id\u0027])"},{"line_number":547,"context_line":"        if port_net.get(\u0027router:external\u0027, False):"},{"line_number":548,"context_line":"            msg \u003d _(\u0027Port belongs to an external network, \u0027"},{"line_number":549,"context_line":"                    \u0027cannot assign as a router interface.\u0027)"},{"line_number":550,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a5de9d1_a61ea95c","line":547,"in_reply_to":"7a5de9d1_012fa488","updated":"2016-02-02 08:03:35.000000000","message":"Thanks, got it.","commit_id":"e0f9c5285ae304cc67bf41a4eea77888ba5002c9"},{"author":{"_account_id":19912,"name":"Xuanzhou Perry Dong","email":"oss_xzdong@163.com","username":"oss_xzdong"},"change_message_id":"44bee685a9b9b575a44e96d059e76b792e08621c","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        network \u003d self._core_plugin.get_network(context, subnet[\u0027network_id\u0027])"},{"line_number":615,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Subnet belongs to an external network, \u0027"},{"line_number":617,"context_line":"                    \u0027cannot add to a router.\u0027)"},{"line_number":618,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":619,"context_line":"        self._check_for_dup_router_subnet(context, router,"},{"line_number":620,"context_line":"                                          subnet[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_9cb42082","line":617,"range":{"start_line":617,"start_character":3,"end_line":617,"end_character":46},"updated":"2016-02-02 08:58:30.000000000","message":"nit: add -\u003e be added","commit_id":"391a751ed6d2913e13c762796eb6dc4f60c1ee0b"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"ab0297373cd6a32c95002ed0ed4c2853c08a50d2","unresolved":false,"context_lines":[{"line_number":614,"context_line":"        network \u003d self._core_plugin.get_network(context, subnet[\u0027network_id\u0027])"},{"line_number":615,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Subnet belongs to an external network, \u0027"},{"line_number":617,"context_line":"                    \u0027cannot add to a router.\u0027)"},{"line_number":618,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":619,"context_line":"        self._check_for_dup_router_subnet(context, router,"},{"line_number":620,"context_line":"                                          subnet[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_09caa94e","line":617,"range":{"start_line":617,"start_character":3,"end_line":617,"end_character":46},"in_reply_to":"7a5de9d1_9cb42082","updated":"2016-02-05 03:43:26.000000000","message":"Done","commit_id":"391a751ed6d2913e13c762796eb6dc4f60c1ee0b"},{"author":{"_account_id":156,"name":"Ryu Ishimoto","email":"ryu@midokura.com","username":"ryu-midokura"},"change_message_id":"2d1648e8852560f8213bf39069a8f9522f7fc393","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                   \u0027external router cannot be added to Neutron Router.\u0027) %"},{"line_number":631,"context_line":"                   subnet[\u0027id\u0027])"},{"line_number":632,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":633,"context_line":"        network \u003d self._core_plugin.get_network(context, subnet[\u0027network_id\u0027])"},{"line_number":634,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":635,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":636,"context_line":"            if ext_gw_info:"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_dc159a40","line":633,"updated":"2016-02-23 02:34:46.000000000","message":"Consider making this section a separate method similar to _check_for_dup_router_subnet below.","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"b7af27a9a62229c098792a6308b31074af296e97","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                   \u0027external router cannot be added to Neutron Router.\u0027) %"},{"line_number":631,"context_line":"                   subnet[\u0027id\u0027])"},{"line_number":632,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":633,"context_line":"        network \u003d self._core_plugin.get_network(context, subnet[\u0027network_id\u0027])"},{"line_number":634,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":635,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":636,"context_line":"            if ext_gw_info:"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_f756b05a","line":633,"in_reply_to":"bae84128_dc159a40","updated":"2016-02-23 07:47:05.000000000","message":"Thanks!","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":156,"name":"Ryu Ishimoto","email":"ryu@midokura.com","username":"ryu-midokura"},"change_message_id":"2d1648e8852560f8213bf39069a8f9522f7fc393","unresolved":false,"context_lines":[{"line_number":640,"context_line":"                        context,"},{"line_number":641,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":642,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":643,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflict with \""},{"line_number":644,"context_line":"                                \"the router\u0027s external subnet\u0027s gateway ip, \""},{"line_number":645,"context_line":"                                \"cannot be added to the router.\")"},{"line_number":646,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_017dddb0","line":643,"updated":"2016-02-23 02:34:46.000000000","message":"conflicts","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"b7af27a9a62229c098792a6308b31074af296e97","unresolved":false,"context_lines":[{"line_number":640,"context_line":"                        context,"},{"line_number":641,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":642,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":643,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflict with \""},{"line_number":644,"context_line":"                                \"the router\u0027s external subnet\u0027s gateway ip, \""},{"line_number":645,"context_line":"                                \"cannot be added to the router.\")"},{"line_number":646,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_d753ac69","line":643,"in_reply_to":"bae84128_017dddb0","updated":"2016-02-23 07:47:05.000000000","message":"Done","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":156,"name":"Ryu Ishimoto","email":"ryu@midokura.com","username":"ryu-midokura"},"change_message_id":"2d1648e8852560f8213bf39069a8f9522f7fc393","unresolved":false,"context_lines":[{"line_number":642,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":643,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflict with \""},{"line_number":644,"context_line":"                                \"the router\u0027s external subnet\u0027s gateway ip, \""},{"line_number":645,"context_line":"                                \"cannot be added to the router.\")"},{"line_number":646,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":647,"context_line":"        self._check_for_dup_router_subnet(context, router,"},{"line_number":648,"context_line":"                                          subnet[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_a110715a","line":645,"updated":"2016-02-23 02:34:46.000000000","message":"nit: Error message sounds verbose.  Maybe \u0027cannot be added to the router\u0027 is not necessary here.","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"b7af27a9a62229c098792a6308b31074af296e97","unresolved":false,"context_lines":[{"line_number":642,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":643,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflict with \""},{"line_number":644,"context_line":"                                \"the router\u0027s external subnet\u0027s gateway ip, \""},{"line_number":645,"context_line":"                                \"cannot be added to the router.\")"},{"line_number":646,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":647,"context_line":"        self._check_for_dup_router_subnet(context, router,"},{"line_number":648,"context_line":"                                          subnet[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_174a34ac","line":645,"in_reply_to":"bae84128_a110715a","updated":"2016-02-23 07:47:05.000000000","message":"Done","commit_id":"86908b98cee22807e5ea14faf32353238f67bb1b"},{"author":{"_account_id":15371,"name":"Tom Patzig","email":"tom.patzig@sap.com","username":"tpatzig"},"change_message_id":"d60121600aa47093a29f4983e117c23f88e1f70a","unresolved":false,"context_lines":[{"line_number":629,"context_line":"                    ext_subnet \u003d self._core_plugin.get_subnet("},{"line_number":630,"context_line":"                        context,"},{"line_number":631,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":632,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":633,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflicts with the \""},{"line_number":634,"context_line":"                                \"router\u0027s external subnet\u0027s gateway ip.\")"},{"line_number":635,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_2e471e4c","line":632,"updated":"2016-02-23 10:34:52.000000000","message":"This check is wrong. The router you are using for router-interface-add with an external network, does not have any external_gateway_info. \nYou have an external network with a subnet, where the gateway address is an existing external gateway address; and when you try to add this network with router-interface-add to a new router (no existing interfaces), it will bring up the external gateway IP. If you do not want to deny that operation at all, it should behave like router-gateway-set, which is doing it right.","commit_id":"d0dacbff46581100b83d48e6af14f886ee973eb1"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"c885a2d50550ba58d544300eba7132d0dac2bc54","unresolved":false,"context_lines":[{"line_number":629,"context_line":"                    ext_subnet \u003d self._core_plugin.get_subnet("},{"line_number":630,"context_line":"                        context,"},{"line_number":631,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":632,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":633,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflicts with the \""},{"line_number":634,"context_line":"                                \"router\u0027s external subnet\u0027s gateway ip.\")"},{"line_number":635,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_4144e219","line":632,"in_reply_to":"bae84128_2e471e4c","updated":"2016-02-23 15:46:21.000000000","message":"Hi, Tom. Thanks for review. Here I use this check is just consider the situation that a vRouter acts as the gateway on the external network(like midonet) and the vRouter has another external network as its gateway, (I\u0027m not sure whether it correct, if correct router can have external_gateway_info) The topo like this:\n\nvm--subnet1--router1--subnet2(router:external)--router2--subnet3(router:external)\n\nAnother situation is your comments here. We can prohibits interface add operation just like PS4.","commit_id":"d0dacbff46581100b83d48e6af14f886ee973eb1"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"0d7306e820052be17f883ccc96a8103ee2cdea97","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":625,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":626,"context_line":"            if ext_gw_info:"},{"line_number":627,"context_line":"                external_fixed_ips \u003d ext_gw_info.get(\u0027external_fixed_ips\u0027)"},{"line_number":628,"context_line":"                for ext_fixed_ip in external_fixed_ips:"},{"line_number":629,"context_line":"                    ext_subnet \u003d self._core_plugin.get_subnet("},{"line_number":630,"context_line":"                        context,"},{"line_number":631,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":632,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":633,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflicts with the \""},{"line_number":634,"context_line":"                                \"router\u0027s external subnet\u0027s gateway ip.\")"},{"line_number":635,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def _add_interface_by_subnet(self, context, router, subnet_id, owner):"},{"line_number":638,"context_line":"        subnet \u003d self._core_plugin.get_subnet(context, subnet_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_2c756e63","line":635,"range":{"start_line":627,"start_character":16,"end_line":635,"end_character":74},"updated":"2016-02-23 08:33:18.000000000","message":"I prefer for you don\u0027t use the for loop here. Maybe a better option is:\n  ext_net_id \u003d ext_gw_info.get(\u0027network_id\u0027)\n  gateway_ip \u003d subnet[\u0027gateway_ip\u0027]\n  subnet_qry \u003d context.session.query(models_v2.Subnet).filter(\n      models_v2.Subnet.network_id \u003d\u003d ext_net_id,\n      models_v2.Subnet.gateway_ip \u003d\u003d gateway_ip)\n  if subnet_qry.first() is not None:\n      raise ...\n\nThe logic here doesn\u0027t need to get any subnet dict indeed, only existence should be checked.","commit_id":"d0dacbff46581100b83d48e6af14f886ee973eb1"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"c885a2d50550ba58d544300eba7132d0dac2bc54","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":625,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":626,"context_line":"            if ext_gw_info:"},{"line_number":627,"context_line":"                external_fixed_ips \u003d ext_gw_info.get(\u0027external_fixed_ips\u0027)"},{"line_number":628,"context_line":"                for ext_fixed_ip in external_fixed_ips:"},{"line_number":629,"context_line":"                    ext_subnet \u003d self._core_plugin.get_subnet("},{"line_number":630,"context_line":"                        context,"},{"line_number":631,"context_line":"                        ext_fixed_ip[\u0027subnet_id\u0027])"},{"line_number":632,"context_line":"                    if ext_subnet[\u0027gateway_ip\u0027] \u003d\u003d subnet[\u0027gateway_ip\u0027]:"},{"line_number":633,"context_line":"                        msg \u003d _(\"Subnet\u0027s gateway ip conflicts with the \""},{"line_number":634,"context_line":"                                \"router\u0027s external subnet\u0027s gateway ip.\")"},{"line_number":635,"context_line":"                        raise n_exc.BadRequest(resource\u003d\u0027router\u0027, msg\u003dmsg)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def _add_interface_by_subnet(self, context, router, subnet_id, owner):"},{"line_number":638,"context_line":"        subnet \u003d self._core_plugin.get_subnet(context, subnet_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_f8320a5d","line":635,"range":{"start_line":627,"start_character":16,"end_line":635,"end_character":74},"in_reply_to":"bae84128_2c756e63","updated":"2016-02-23 15:46:21.000000000","message":"Done","commit_id":"d0dacbff46581100b83d48e6af14f886ee973eb1"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"3eafdb98d2521a4ed405c4536ff051d03da6c994","unresolved":false,"context_lines":[{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    def _check_subnet_gateway_ip(self, context, router, subnet):"},{"line_number":626,"context_line":"        network \u003d self._core_plugin.get_network(context, subnet[\u0027network_id\u0027])"},{"line_number":627,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":628,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":629,"context_line":"            if ext_gw_info:"},{"line_number":630,"context_line":"                ext_net_id \u003d ext_gw_info.get(\u0027network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5aef4532_dd868cb8","line":627,"range":{"start_line":627,"start_character":24,"end_line":627,"end_character":30},"updated":"2016-03-08 06:32:16.000000000","message":"it is better to use external_net.EXTERNAL","commit_id":"397337122aee35b01546408112aa1cd699163799"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"3eafdb98d2521a4ed405c4536ff051d03da6c994","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        if network.get(\u0027router:external\u0027, False):"},{"line_number":628,"context_line":"            ext_gw_info \u003d router.get(\u0027external_gateway_info\u0027)"},{"line_number":629,"context_line":"            if ext_gw_info:"},{"line_number":630,"context_line":"                ext_net_id \u003d ext_gw_info.get(\u0027network_id\u0027)"},{"line_number":631,"context_line":"                gateway_ip \u003d subnet[\u0027gateway_ip\u0027]"},{"line_number":632,"context_line":"                subnet_qry \u003d context.session.query(models_v2.Subnet).filter("},{"line_number":633,"context_line":"                    models_v2.Subnet.network_id \u003d\u003d ext_net_id,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5aef4532_7d63f81a","line":630,"range":{"start_line":630,"start_character":16,"end_line":630,"end_character":26},"updated":"2016-03-08 06:32:16.000000000","message":"it is better to check if the ext_net_id \u003d\u003d network[\u0027id\u0027]","commit_id":"397337122aee35b01546408112aa1cd699163799"}]}
