)]}'
{"neutron/agent/l3/ha_router.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"efb3a82d9cb56ebce10e03cc6d2a6e206db6e3a8","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _add_default_gw_virtual_route(self, ex_gw_port, interface_name):"},{"line_number":195,"context_line":"        default_gw_rts \u003d []"},{"line_number":196,"context_line":"        gateway_ips \u003d self._get_external_gw_ips(ex_gw_port)"},{"line_number":197,"context_line":"        for gw_ip in gateway_ips:"},{"line_number":198,"context_line":"                # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":199,"context_line":"                # be nice."}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_ba4123ab","side":"PARENT","line":196,"updated":"2015-11-11 17:18:59.000000000","message":"Could have just added \u0027if not gateway_ips: return\u0027 here","commit_id":"87ce4868caea9b7f1dd79f575004ee152ffa7eb0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"efb3a82d9cb56ebce10e03cc6d2a6e206db6e3a8","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        self.routes \u003d new_routes"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _add_default_gw_virtual_route(self, ex_gw_port, interface_name,"},{"line_number":195,"context_line":"                                      gateway_ips):"},{"line_number":196,"context_line":"        default_gw_rts \u003d []"},{"line_number":197,"context_line":"        for gw_ip in gateway_ips:"},{"line_number":198,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_1aae2f98","line":195,"updated":"2015-11-11 17:18:59.000000000","message":"This doesn\u0027t need the ex_gw_port argument any more since gateway_ips is passed by the caller.","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"2f41376dc9d7c277c6de8133a4a648376d0c6aca","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        self.routes \u003d new_routes"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _add_default_gw_virtual_route(self, ex_gw_port, interface_name,"},{"line_number":195,"context_line":"                                      gateway_ips):"},{"line_number":196,"context_line":"        default_gw_rts \u003d []"},{"line_number":197,"context_line":"        for gw_ip in gateway_ips:"},{"line_number":198,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_a988da71","line":195,"in_reply_to":"da85f559_1aae2f98","updated":"2015-11-12 10:01:15.000000000","message":"Thanks for the comment and done","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6b4d320837ba1a352919b8d57209d17e474c50fd","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        self.routes \u003d new_routes"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _add_default_gw_virtual_route(self, ex_gw_port, interface_name):"},{"line_number":195,"context_line":"        default_gw_rts \u003d []"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        gateway_ips \u003d self._get_external_gw_ips(ex_gw_port)"},{"line_number":198,"context_line":"        if not gateway_ips:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da85f559_021e816f","line":195,"updated":"2015-11-12 17:31:29.000000000","message":"pedantic nit: this can move after the \"not gateway_ips\" check since it\u0027s unused otherwise","commit_id":"053dfd996356d07f38386bfe943bab1c9dfcd8de"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"5fd0285ae3256a58027dd23f6bad4680550427dd","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        self.routes \u003d new_routes"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _add_default_gw_virtual_route(self, ex_gw_port, interface_name):"},{"line_number":195,"context_line":"        default_gw_rts \u003d []"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        gateway_ips \u003d self._get_external_gw_ips(ex_gw_port)"},{"line_number":198,"context_line":"        if not gateway_ips:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da85f559_20e7a641","line":195,"in_reply_to":"da85f559_021e816f","updated":"2015-11-15 09:08:36.000000000","message":"Done","commit_id":"053dfd996356d07f38386bfe943bab1c9dfcd8de"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1a487205492f4155384b27c0f95bb6ee1b00fd22","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        default_gw_rts \u003d []"},{"line_number":196,"context_line":"        gateway_ips \u003d self._get_external_gw_ips(ex_gw_port)"},{"line_number":197,"context_line":"        for gw_ip in gateway_ips:"},{"line_number":198,"context_line":"                # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":199,"context_line":"                # be nice."},{"line_number":200,"context_line":"                default_gw \u003d n_consts.IP_ANY[netaddr.IPAddress(gw_ip).version]"},{"line_number":201,"context_line":"                instance \u003d self._get_keepalived_instance()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_1238e8d2","side":"PARENT","line":198,"updated":"2015-11-16 20:04:28.000000000","message":"Please avoid the temptation to fix whitespace.  Yes, it was incorrect before but it is out of the scope of this patch set to fix it.\n\nhttp://docs.openstack.org/developer/neutron/devref/effective_neutron.html","commit_id":"27437bce90baad40588f8abe74515120105ae5fc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"00c713b21a3d350a69d37466df5c3ac08887036c","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":202,"context_line":"            # be nice."},{"line_number":203,"context_line":"            default_gw \u003d n_consts.IP_ANY[netaddr.IPAddress(gw_ip).version]"},{"line_number":204,"context_line":"            instance \u003d self._get_keepalived_instance()"},{"line_number":205,"context_line":"            default_gw_rts.append(keepalived.KeepalivedVirtualRoute("},{"line_number":206,"context_line":"                default_gw, gw_ip, interface_name))"},{"line_number":207,"context_line":"        instance.virtual_routes.gateway_routes \u003d default_gw_rts"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_0a507409","line":204,"updated":"2015-11-16 03:03:32.000000000","message":"line #204 can be moved to line#199","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"7121c52cafadbae08e68b962ac6af17227779392","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":202,"context_line":"            # be nice."},{"line_number":203,"context_line":"            default_gw \u003d n_consts.IP_ANY[netaddr.IPAddress(gw_ip).version]"},{"line_number":204,"context_line":"            instance \u003d self._get_keepalived_instance()"},{"line_number":205,"context_line":"            default_gw_rts.append(keepalived.KeepalivedVirtualRoute("},{"line_number":206,"context_line":"                default_gw, gw_ip, interface_name))"},{"line_number":207,"context_line":"        instance.virtual_routes.gateway_routes \u003d default_gw_rts"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_b879abfe","line":204,"in_reply_to":"ba8a016a_78bfcad0","updated":"2015-11-17 05:11:30.000000000","message":"Thanks for all the comments, will do that.","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"edb19e0a8964af70b40449ee292d918548f3ff6a","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":202,"context_line":"            # be nice."},{"line_number":203,"context_line":"            default_gw \u003d n_consts.IP_ANY[netaddr.IPAddress(gw_ip).version]"},{"line_number":204,"context_line":"            instance \u003d self._get_keepalived_instance()"},{"line_number":205,"context_line":"            default_gw_rts.append(keepalived.KeepalivedVirtualRoute("},{"line_number":206,"context_line":"                default_gw, gw_ip, interface_name))"},{"line_number":207,"context_line":"        instance.virtual_routes.gateway_routes \u003d default_gw_rts"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_78bfcad0","line":204,"in_reply_to":"ba8a016a_b2e79c3f","updated":"2015-11-17 01:09:30.000000000","message":"Yeah, moving self._get_keepalived_instance() out of the loop makes a lot of sense. I\u0027d still short circuit like you do in lines 196+197.","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1a487205492f4155384b27c0f95bb6ee1b00fd22","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # TODO(Carl) This is repeated everywhere.  A method would"},{"line_number":202,"context_line":"            # be nice."},{"line_number":203,"context_line":"            default_gw \u003d n_consts.IP_ANY[netaddr.IPAddress(gw_ip).version]"},{"line_number":204,"context_line":"            instance \u003d self._get_keepalived_instance()"},{"line_number":205,"context_line":"            default_gw_rts.append(keepalived.KeepalivedVirtualRoute("},{"line_number":206,"context_line":"                default_gw, gw_ip, interface_name))"},{"line_number":207,"context_line":"        instance.virtual_routes.gateway_routes \u003d default_gw_rts"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_b2e79c3f","line":204,"in_reply_to":"da85f559_0a507409","updated":"2015-11-16 20:04:28.000000000","message":"Moving that probably shouldn\u0027t be done as part of this patch set.  However, it is an interesting alternative fix for the reported bug.  Part of me likes it better.\n\nI tried in a local sandbox.  Reverting the changes to this file and making this suggested change also passes your UT.","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"}],"neutron/tests/unit/agent/l3/test_ha_router.py":[{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"c3d8d0376224de055028bd5747a348426adfd447","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":67,"context_line":"                      \u0027mac_address\u0027: \u0027ca:fe:de:ad:be:ef\u0027}"},{"line_number":68,"context_line":"        # Make sure no exceptional code"},{"line_number":69,"context_line":"        ri.external_gateway_added(ex_gw_port, \u0027qg-abc\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_7f7bb628","line":69,"updated":"2015-11-11 14:40:19.000000000","message":"Can you also verify that no default gateway virtual route was added?","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"3ceaeaedcd32288d3141f66dc687fff3bf215083","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":67,"context_line":"                      \u0027mac_address\u0027: \u0027ca:fe:de:ad:be:ef\u0027}"},{"line_number":68,"context_line":"        # Make sure no exceptional code"},{"line_number":69,"context_line":"        ri.external_gateway_added(ex_gw_port, \u0027qg-abc\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_9a469f4d","line":69,"in_reply_to":"da85f559_15328b5f","updated":"2015-11-11 17:12:04.000000000","message":"Thanks for checking, I am okay with the UT as-is.","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"d50e094ae7c0e591fb8e98fda01cdfa390a7dc62","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":67,"context_line":"                      \u0027mac_address\u0027: \u0027ca:fe:de:ad:be:ef\u0027}"},{"line_number":68,"context_line":"        # Make sure no exceptional code"},{"line_number":69,"context_line":"        ri.external_gateway_added(ex_gw_port, \u0027qg-abc\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_15328b5f","line":69,"in_reply_to":"da85f559_7f7bb628","updated":"2015-11-11 15:11:17.000000000","message":"I am afraid not... I mocked keepalived_manager at line 53, which manages the keepalived instances. And the routes are stored in keepalived instances. \n\nIf I don\u0027t mocked keepalived_manager, this UT would be more compicating....\n\nWhat is your opinion about it?","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"11a9c744890c9e50384c7d0f6bae7e8ba98f398a","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":67,"context_line":"                      \u0027mac_address\u0027: \u0027ca:fe:de:ad:be:ef\u0027}"},{"line_number":68,"context_line":"        # Make sure no exceptional code"},{"line_number":69,"context_line":"        ri.external_gateway_added(ex_gw_port, \u0027qg-abc\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_bbed2d90","line":69,"in_reply_to":"da85f559_9a469f4d","updated":"2015-11-13 16:07:05.000000000","message":"Yes, keepalived_manager should be mocked, but how about this, it seems possible to assert default gateway virtual route was added or not:\n\n    mock_instance \u003d mock.Mock()\n    mock_instance.virtual_routes.gateway_routes \u003d []\n    ri._get_keepalived_instance \u003d mock.Mock(return_value\u003dmock_instance)\n    ...\n[1] self.assertEqual(x, len(mock_instance.virtual_routes.gateway_routes))\n\nI modified and tested this UT in my local env.\nAt first, a subnet has a gateway_ip is mocked and used to call ri.external_gateway_added, and assert x\u003d1 in [1](which simulates normal case), then mock another subnet with gateway_ip is None, after call ri.external_gateway_added again, assert x\u003d1 in [1](which simulates no virtual route should be added case).  And the two asserts all passed.\n\nAn UT without anything to assert seems too odd to me.","commit_id":"9bdda8bdc6dcde3b7d4e23f9d009578668114297"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"edb19e0a8964af70b40449ee292d918548f3ff6a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        ri._get_cidrs_from_keepalived \u003d mock.MagicMock(return_value\u003daddresses)"},{"line_number":48,"context_line":"        self.assertEqual(set(addresses), ri.get_router_cidrs(device))"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_external_gateway_add(self):"},{"line_number":51,"context_line":"        ri \u003d self._create_router()"},{"line_number":52,"context_line":"        ri.driver \u003d mock.MagicMock()"},{"line_number":53,"context_line":"        mock_instance \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_f8a09a92","line":50,"updated":"2015-11-17 01:09:30.000000000","message":"Your new test should be targeting _add_default_gw_virtual_route, not external_gateway_added. It would simplify the test... A lot.","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"7121c52cafadbae08e68b962ac6af17227779392","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        ri._get_cidrs_from_keepalived \u003d mock.MagicMock(return_value\u003daddresses)"},{"line_number":48,"context_line":"        self.assertEqual(set(addresses), ri.get_router_cidrs(device))"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_external_gateway_add(self):"},{"line_number":51,"context_line":"        ri \u003d self._create_router()"},{"line_number":52,"context_line":"        ri.driver \u003d mock.MagicMock()"},{"line_number":53,"context_line":"        mock_instance \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_184797bc","line":50,"in_reply_to":"ba8a016a_f8a09a92","updated":"2015-11-17 05:11:30.000000000","message":"Reasonable, done.","commit_id":"78e7c12cb338868dde4740250a27c1475031b72f"}]}
