)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"651c5241b64b05ef759c149c79b2f599b4e8b154","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-12-08 17:42:48 +1100"},{"line_number":4,"context_line":"Commit:     Sachi King \u003csachi.king@anchor.com.au\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-12-08 23:22:23 +1100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"If router is HA, get current_cidrs from keepalived object"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When using L3 HA and keepalived neutron is nolonger directly managing"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a961159_79639e1a","line":6,"updated":"2014-12-08 14:15:42.000000000","message":"We need to update the functional test so that it reproduces the issue.","commit_id":"5ada7083b2dbbe3de3fb400c595969c4af334176"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"3cdde9f36eb5b16dd495bee461bc05050cec1860","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-12-08 17:42:48 +1100"},{"line_number":4,"context_line":"Commit:     Sachi King \u003csachi.king@anchor.com.au\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-12-11 13:21:28 +1100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"If router is HA, get current_cidrs from keepalived object"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When using L3 HA and keepalived neutron is no longer directly managing"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3a961159_307be42a","line":6,"updated":"2014-12-16 14:17:26.000000000","message":"Per our conversation on IRC, saving the vips in a list but returning them as a set, leaves us open to adding the same VIP multiple times (Like before this patch), and we\u0027ll never be the wiser, even though that\u0027s a signal of a bug.\n\nI\u0027d like to make sure that if you call add_vip and the vip is already present in-memory, that we raise an exception.\n\nFailing that, we should save the vips in a set, so that we don\u0027t have duplicates upon addition. Although, you\u0027d have to convince me why not raise an error when trying to add a duplicate vip.","commit_id":"288bbe71f6953ce692e0763b48f211d5e9668781"}],"neutron/agent/l3/agent.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cc3b84b965cb200c8ca4256f08ed63f0dde08429","unresolved":false,"context_lines":[{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        device \u003d ip_lib.IPDevice(interface_name, self.root_helper,"},{"line_number":686,"context_line":"                                 namespace\u003dri.ns_name)"},{"line_number":687,"context_line":"        if ri.is_ha:"},{"line_number":688,"context_line":"            existing_cidrs \u003d set(self._ha_get_existing_cidrs("},{"line_number":689,"context_line":"                ri, interface_name))"},{"line_number":690,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_0fe08cf7","line":687,"updated":"2015-01-20 04:17:14.000000000","message":"This change can and should be isolated for testing.  It shouldn\u0027t be necessary to call \u0027process_router_floating_ip_addresses\u0027 at all - there are already lots of tests that validate its behavior.\n\nConsider the following approach of extracting out the changed code so that it can be directly targeted for testing.\n\ndef process_router_floating_ip_addresses(...)\n  ...\n  existing_cidrs \u003d self._get_router_cidrs(...)\n  ...\n\n\ndef _get_router_cidrs(self, ri, device, interface_name):\n  if ri.is_ha:\n    return ...\n  else\n    return ...\n\ndef test_get_router_cidrs_returns_ha_cidrs(self):\n  # Mock out _a_get_existing_cidrs, set a return value, and ensure that _get_router_cidrs returns that value\n\ndef test_get_router_cidrs_returns_non_ha_cidrs(self):\n  # mock out device.addr.list, set a return value, and ensure that _get_router_cidrs returns that value","commit_id":"6fd99466bf526a65e2bdf953cc8c52379f9fa42f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d3792d3692d1b4c57066c57c91b3242b8e29cf69","unresolved":false,"context_lines":[{"line_number":667,"context_line":"                                               ip\u003dip_cidr)"},{"line_number":668,"context_line":"            if ri.router[\u0027distributed\u0027]:"},{"line_number":669,"context_line":"                self.floating_ip_removed_dist(ri, ip_cidr)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _get_router_cidrs(self, ri, device, interface_name):"},{"line_number":672,"context_line":"        if ri.is_ha:"},{"line_number":673,"context_line":"            return set(self._ha_get_existing_cidrs(ri, interface_name))"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a930d6b_d081c34b","line":670,"updated":"2015-01-21 15:12:39.000000000","message":"There\u0027s no need for interface_name, you can get it from device.name.","commit_id":"dfd4f37e2dac3208f168b123cb05440a6ec7dc5a"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"423f7cc63272b32c3924acc6e60eec1338f40e43","unresolved":false,"context_lines":[{"line_number":667,"context_line":"                                               ip\u003dip_cidr)"},{"line_number":668,"context_line":"            if ri.router[\u0027distributed\u0027]:"},{"line_number":669,"context_line":"                self.floating_ip_removed_dist(ri, ip_cidr)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _get_router_cidrs(self, ri, device, interface_name):"},{"line_number":672,"context_line":"        if ri.is_ha:"},{"line_number":673,"context_line":"            return set(self._ha_get_existing_cidrs(ri, interface_name))"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a930d6b_e19c246c","line":670,"in_reply_to":"1a930d6b_d081c34b","updated":"2015-01-22 00:29:53.000000000","message":"Done","commit_id":"dfd4f37e2dac3208f168b123cb05440a6ec7dc5a"}],"neutron/agent/l3/ha.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        instance \u003d ri.keepalived_manager.config.get_instance(ri.ha_vr_id)"},{"line_number":178,"context_line":"        instance.remove_vips_vroutes_by_interface(interface)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def _ha_get_existing_cidrs(self, ri, interface_name):"},{"line_number":181,"context_line":"        instance \u003d ri.keepalived_manager.config.get_instance(ri.ha_vr_id)"},{"line_number":182,"context_line":"        return instance.get_existing_vips(interface_name)"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_1143bfaf","line":180,"updated":"2014-12-21 02:44:12.000000000","message":"Where is the unit test for this method addition?","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"}],"neutron/agent/l3_agent.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"651c5241b64b05ef759c149c79b2f599b4e8b154","unresolved":false,"context_lines":[{"line_number":1130,"context_line":"                                               namespace\u003dri.ns_name,"},{"line_number":1131,"context_line":"                                               ip\u003dip_cidr)"},{"line_number":1132,"context_line":"            if ri.router[\u0027distributed\u0027]:"},{"line_number":1133,"context_line":"                self.floating_ip_removed_dist(ri, ip_cidr)"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"    def process_router_floating_ip_addresses(self, ri, ex_gw_port):"},{"line_number":1136,"context_line":"        \"\"\"Configure IP addresses on router\u0027s external gateway interface."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_d949f28c","line":1133,"updated":"2014-12-08 14:15:42.000000000","message":"We don\u0027t need to call process_router_floating_ip_addresses at all in the HA case. We need a much simpler method that wipes all of the FIPs in keepalived and overrides them with whatever we got in the update. Note that this isn\u0027t disruptive to the data plane because keepalived is smart about that and compares what it got in the conf and the current system state. Basically, we let keepalived handle the hard work and just configure it with the floating IPs received in the latest update.\n\nRegarding fip_statuses, it\u0027s a bit different with HA routers. I just noticed they\u0027re not actually working (They\u0027re always None / empty). I want to handle that in a separate patch and bug.","commit_id":"5ada7083b2dbbe3de3fb400c595969c4af334176"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"39871898562d989d12674d48d567a0b7fd3a1d3d","unresolved":false,"context_lines":[{"line_number":1130,"context_line":"                                               namespace\u003dri.ns_name,"},{"line_number":1131,"context_line":"                                               ip\u003dip_cidr)"},{"line_number":1132,"context_line":"            if ri.router[\u0027distributed\u0027]:"},{"line_number":1133,"context_line":"                self.floating_ip_removed_dist(ri, ip_cidr)"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"    def process_router_floating_ip_addresses(self, ri, ex_gw_port):"},{"line_number":1136,"context_line":"        \"\"\"Configure IP addresses on router\u0027s external gateway interface."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_c8e7493f","line":1133,"in_reply_to":"3a961159_d949f28c","updated":"2014-12-09 00:23:23.000000000","message":"Clearing fips is non-trivial.  The ex_gw, as well as internal ports are the same thing to keepalived as a floating IP, they\u0027re all a \u0027vip\u0027.  To do so sounds like it would require substantial code re-factoring.\n\nI don\u0027t see the merit to doing a substantial code re-factoring to fix this bug, it\u0027s a separate issue.  If you think this fix is going to cause issues or not fix the issue at hand please comment on that or describe the changes required to implement what you describe.  I currently just don\u0027t see it.\n\nI\u0027d like to better understand why such an extreme change is required for this, because at this time I don\u0027t see the merit to creating more deviations in L3NATAgent between when it is ran in normal mode, HA mode, or DVR mode: to do so adds more code paths and more chances for bugs to crop up.\n\nDidn\u0027t notice the fip_statuses thing, agreed that is a separate bug.","commit_id":"5ada7083b2dbbe3de3fb400c595969c4af334176"}],"neutron/agent/linux/keepalived.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9d18e05699087f133351d6b86b51d701ece9a634","unresolved":false,"context_lines":[{"line_number":50,"context_line":"               {\u0027valid_auth_types\u0027: \u0027, \u0027.join(VALID_AUTH_TYPES)})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"class AddVIPDuplicateAddressException(exceptions.NeutronException):"},{"line_number":54,"context_line":"    message \u003d (_(\u0027Attempted to add duplicate VIP address\u0027))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_4eb98c14","line":53,"updated":"2014-12-17 13:54:22.000000000","message":"Consider name \u0027VIPDuplicateAddressException\u0027. IMO that name make slightly more sense.","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"f989ae3d6fae0507ac8b3414ee3a42a7e7e593b7","unresolved":false,"context_lines":[{"line_number":50,"context_line":"               {\u0027valid_auth_types\u0027: \u0027, \u0027.join(VALID_AUTH_TYPES)})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"class AddVIPDuplicateAddressException(exceptions.NeutronException):"},{"line_number":54,"context_line":"    message \u003d (_(\u0027Attempted to add duplicate VIP address\u0027))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_2cd0b652","line":53,"in_reply_to":"3a961159_4eb98c14","updated":"2014-12-18 00:51:19.000000000","message":"I agree.","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"20f4f9cd5554f0f50f6b9ada3ce729343be17946","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self.authentication \u003d (auth_type, password)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def add_vip(self, ip_cidr, interface_name):"},{"line_number":140,"context_line":"        for vip in self.vips:"},{"line_number":141,"context_line":"            if (vip.ip_address \u003d\u003d ip_cidr"},{"line_number":142,"context_line":"                    and vip.interface_name \u003d\u003d interface_name):"},{"line_number":143,"context_line":"                raise AddVIPDuplicateAddressException()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_c7400838","line":140,"updated":"2014-12-17 08:33:50.000000000","message":"Is this an unrelated bugfix? If so, please separate it into a different patchset.","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"f989ae3d6fae0507ac8b3414ee3a42a7e7e593b7","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self.authentication \u003d (auth_type, password)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def add_vip(self, ip_cidr, interface_name):"},{"line_number":140,"context_line":"        for vip in self.vips:"},{"line_number":141,"context_line":"            if (vip.ip_address \u003d\u003d ip_cidr"},{"line_number":142,"context_line":"                    and vip.interface_name \u003d\u003d interface_name):"},{"line_number":143,"context_line":"                raise AddVIPDuplicateAddressException()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_8cf60af8","line":140,"in_reply_to":"3a961159_0e9ea454","updated":"2014-12-18 00:51:19.000000000","message":"I defiantly wouldn\u0027t call this unrelated.\nThis whole bug stems from calling this multiple with the same address.\n\nHowever, I\u0027ll pull this out to a separate patch. Thinking about this, it seems like this would make back-porting to stable a bit more risky. \n\nThis patch can focus on fixing the problem, while the new patch can add throwing an error if it\u0027s called multiple times.  Though I would hope, and am pretty sure, nothing else in stable is calling this multiple times.","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9d18e05699087f133351d6b86b51d701ece9a634","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        self.authentication \u003d (auth_type, password)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def add_vip(self, ip_cidr, interface_name):"},{"line_number":140,"context_line":"        for vip in self.vips:"},{"line_number":141,"context_line":"            if (vip.ip_address \u003d\u003d ip_cidr"},{"line_number":142,"context_line":"                    and vip.interface_name \u003d\u003d interface_name):"},{"line_number":143,"context_line":"                raise AddVIPDuplicateAddressException()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_0e9ea454","line":140,"in_reply_to":"3a961159_c7400838","updated":"2014-12-17 13:54:22.000000000","message":"+1","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        self.vips \u003d [vip for vip in self.vips"},{"line_number":147,"context_line":"                     if vip.ip_address !\u003d ip_address]"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def get_existing_vips(self, interface_name):"},{"line_number":150,"context_line":"        return [vip.ip_address for vip in self.vips"},{"line_number":151,"context_line":"                if vip.interface_name \u003d\u003d interface_name]"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_f1ee33b4","line":149,"updated":"2014-12-21 02:44:12.000000000","message":"Consider changing this method name to indicate that vip addresses are being returned rather than the vips themselves (e.g. get_addresses_for_interface or get_vip_addresses).","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"886c16d4328467dc84815d01626cc0b8d3b613e2","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        self.vips \u003d [vip for vip in self.vips"},{"line_number":147,"context_line":"                     if vip.ip_address !\u003d ip_address]"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def get_existing_vips(self, interface_name):"},{"line_number":150,"context_line":"        return [vip.ip_address for vip in self.vips"},{"line_number":151,"context_line":"                if vip.interface_name \u003d\u003d interface_name]"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_d3a0c693","line":149,"in_reply_to":"3a961159_f1ee33b4","updated":"2015-01-13 11:48:28.000000000","message":"Done","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"}],"neutron/tests/unit/agent/linux/test_keepalived.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"b1bbd093e67603ea19a187b5d3da213c27a146c6","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def test_get_vips_returns_list(self):"},{"line_number":151,"context_line":"        config \u003d self._get_config()"},{"line_number":152,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":153,"context_line":"        current_vips \u003d instance.get_existing_vips(\u0027eth2\u0027)"},{"line_number":154,"context_line":"        self.assertEqual([\u0027192.168.2.0/24\u0027, \u0027192.168.3.0/24\u0027],"},{"line_number":155,"context_line":"                         current_vips)"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_a7f69cf7","line":153,"updated":"2014-12-17 08:44:20.000000000","message":"This is the first time I noticed we used prefixes instead of IP addresses as VIPs. Oops :)","commit_id":"24ffbb3f18ee425d885ecf70df52bf9cbd462fb8"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        config.reset()"},{"line_number":148,"context_line":"        self.assertEqual(\u0027\u0027, config.get_config_str())"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def test_get_vips_returns_list(self):"},{"line_number":151,"context_line":"        config \u003d self._get_config()"},{"line_number":152,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":153,"context_line":"        current_vips \u003d instance.get_existing_vips(\u0027eth2\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_312c3b02","line":150,"updated":"2014-12-21 02:44:12.000000000","message":"Please follow the convention of test_[method name]_[condition being tested] (e.g. test_get_existing_vips_returns_list if the method under test is get_existing_vips).","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"886c16d4328467dc84815d01626cc0b8d3b613e2","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        config.reset()"},{"line_number":148,"context_line":"        self.assertEqual(\u0027\u0027, config.get_config_str())"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def test_get_vips_returns_list(self):"},{"line_number":151,"context_line":"        config \u003d self._get_config()"},{"line_number":152,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":153,"context_line":"        current_vips \u003d instance.get_existing_vips(\u0027eth2\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_5efdbd07","line":150,"in_reply_to":"3a961159_312c3b02","updated":"2015-01-13 11:48:28.000000000","message":"Done","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        config \u003d self._get_config()"},{"line_number":152,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":153,"context_line":"        current_vips \u003d instance.get_existing_vips(\u0027eth2\u0027)"},{"line_number":154,"context_line":"        self.assertEqual([\u0027192.168.2.0/24\u0027, \u0027192.168.3.0/24\u0027],"},{"line_number":155,"context_line":"                         current_vips)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_5131c758","line":154,"updated":"2014-12-21 02:44:12.000000000","message":"Consider defining the expected ip addresses only once (as constants or by reusing the configuration) to simplify maintenance.","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"886c16d4328467dc84815d01626cc0b8d3b613e2","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        config \u003d self._get_config()"},{"line_number":152,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":153,"context_line":"        current_vips \u003d instance.get_existing_vips(\u0027eth2\u0027)"},{"line_number":154,"context_line":"        self.assertEqual([\u0027192.168.2.0/24\u0027, \u0027192.168.3.0/24\u0027],"},{"line_number":155,"context_line":"                         current_vips)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_dece0d5b","line":154,"in_reply_to":"3a961159_5131c758","updated":"2015-01-13 11:48:28.000000000","message":"Done","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cc3b84b965cb200c8ca4256f08ed63f0dde08429","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        config \u003d self._get_config()"},{"line_number":192,"context_line":"        instance \u003d config.get_instance(1)"},{"line_number":193,"context_line":"        current_vips \u003d sorted(instance.get_existing_vip_ip_addresses(\u0027eth2\u0027))"},{"line_number":194,"context_line":"        expected_current_vips \u003d sorted([vip.ip_address for vip in instance.vips"},{"line_number":195,"context_line":"                                 if vip.interface_name \u003d\u003d \u0027eth2\u0027])"},{"line_number":196,"context_line":"        self.assertEqual(expected_current_vips, current_vips)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_4fe0d426","line":194,"updated":"2015-01-20 04:17:14.000000000","message":"DRY - I\u0027m afraid this is actually worse that before, since it duplicates the logic of the code.  Please revert to defining statically.","commit_id":"6fd99466bf526a65e2bdf953cc8c52379f9fa42f"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":12767,"name":"Craige McWhirter","email":"craige@mcwhirter.io","username":"craige"},"change_message_id":"53eaa6237881f5f864edd3b24266fb62259562fe","unresolved":false,"context_lines":[{"line_number":1023,"context_line":"                                         {\u0027cidr\u0027: \u002715.1.2.3/32\u0027}]"},{"line_number":1024,"context_line":"        agent.process_router_floating_ip_addresses(ri, {\u0027id\u0027: _uuid()})"},{"line_number":1025,"context_line":"        agent._add_floating_ip.assert_called_once_with(ri,"},{"line_number":1026,"context_line":"                fake_floatingips[\u0027floatingips\u0027][0], \u0027ovs1234\u0027, device)"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"    def test_process_router_dist_floating_ip_add(self):"},{"line_number":1029,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_794c10c9","line":1026,"updated":"2014-12-11 03:50:17.000000000","message":"Minor nit but \"ri,\" should be on the line below and indented 4 spaces only.","commit_id":"288bbe71f6953ce692e0763b48f211d5e9668781"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1b6755d7c53fb45ac97c2786a21916cc7e49cc63","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        ri.iptables_manager.ipv4[\u0027nat\u0027] \u003d mock.MagicMock()"},{"line_number":995,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_f42e61f9","line":997,"updated":"2014-12-18 13:05:40.000000000","message":"I don\u0027t think this test actually tests anything.\n\nInstead I would mock only what device.addr.list returns, create an agent and an HA router, and assert what VIPs are held in the resulting keepalived config. You can then re-mock device.addr.list to contain the new FIPs, replace a FIP, update the router and assert that the resulting keepalived conf still contains what you expect. I think it\u0027s a much more effective test.","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        ri.iptables_manager.ipv4[\u0027nat\u0027] \u003d mock.MagicMock()"},{"line_number":995,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_b1266b14","line":997,"in_reply_to":"3a961159_52cf297f","updated":"2014-12-21 02:44:12.000000000","message":"This test is doing entirely too much considering that the only thing that changed is how the set of existing cidrs is determined.  Consider refactoring process_router_floating_ip_addresses for testability so that the test addition can be proportional to the proposed code change.","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"886c16d4328467dc84815d01626cc0b8d3b613e2","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        ri.iptables_manager.ipv4[\u0027nat\u0027] \u003d mock.MagicMock()"},{"line_number":995,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_3f7548fa","line":997,"in_reply_to":"3a961159_b1266b14","updated":"2015-01-13 11:48:28.000000000","message":"What \u0027process_router_floating_ip_addresses\u0027 are you talking about?\nThere does not appear to be one created to refactor.","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"393c9ec3763505dd6471d92b84d40c0900e7b95a","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        ri.iptables_manager.ipv4[\u0027nat\u0027] \u003d mock.MagicMock()"},{"line_number":995,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_52cf297f","line":997,"in_reply_to":"3a961159_f42e61f9","updated":"2014-12-19 06:28:28.000000000","message":"It very well does test the issue.\n\nI don\u0027t understand what you\u0027re describing, please be clearer with what you would do and additionally explain why.\nIt\u0027s completely impossible to make a change if one does not know the goal, or what\u0027s wrong.\n\nAdditionally, I think testing more than what is here oversteps the bounds of the test as we would no-longer be testing that this function does the right thing, but instead that something, somewhere handles the issue, here or elsewhere, which is not right.\n\nThe important issue to test here is, given a device that has an allocated address that is not configured, regardless of device status, we add it.  We also, provided a device that does not have an address configured while it is configured in the config file, we do not add it.  This covers both.\n\n\u003d\u003d\u003d\u003d\u003d\n\nWe setup floating IPs:\n15.1.2.3\n15.1.2.4\n\nReturn configured VIPs 15.1.2.2(GW) and 15.1.2.4.\nReturn configured on device addresses 15.1.2.2 and 15.1.2.3.\n\nWe then run process_router_floating_ip_addresses and ensure that we did call _add_floating_ip with 15.1.2.3 and not with 15.1.2.4","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["},{"line_number":1001,"context_line":"            {\u0027id\u0027: _uuid(),"},{"line_number":1002,"context_line":"             \u0027host\u0027: HOSTNAME,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_31135bb9","line":999,"updated":"2014-12-21 02:44:12.000000000","message":"Please follow the convention of including the full name of the method under test in the test name as per a previous comment.","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"886c16d4328467dc84815d01626cc0b8d3b613e2","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        self._test_process_router_floating_ip_addresses_add(ri, agent)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"    @mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027)"},{"line_number":999,"context_line":"    def test_process_router_ha_floating_ip_add_with_device(self, IPDevice):"},{"line_number":1000,"context_line":"        fake_floatingips \u003d {\u0027floatingips\u0027: ["},{"line_number":1001,"context_line":"            {\u0027id\u0027: _uuid(),"},{"line_number":1002,"context_line":"             \u0027host\u0027: HOSTNAME,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_5f985475","line":999,"in_reply_to":"3a961159_31135bb9","updated":"2015-01-13 11:48:28.000000000","message":"Done","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"09ddd7b2f3243e59840afde19e529a5887eeb271","unresolved":false,"context_lines":[{"line_number":1024,"context_line":"        device.addr.list.return_value \u003d [{\u0027cidr\u0027: \u002715.1.2.2/24\u0027},"},{"line_number":1025,"context_line":"                                         {\u0027cidr\u0027: \u002715.1.2.3/32\u0027}]"},{"line_number":1026,"context_line":"        agent.process_router_floating_ip_addresses(ri, {\u0027id\u0027: _uuid()})"},{"line_number":1027,"context_line":"        agent._add_floating_ip.assert_called_once_with("},{"line_number":1028,"context_line":"                ri, fake_floatingips[\u0027floatingips\u0027][0], \u0027ovs1234\u0027, device)"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":"    def test_process_router_dist_floating_ip_add(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_d123f702","line":1027,"updated":"2014-12-21 02:44:12.000000000","message":"The need to validate behavior in code that is under ones control is an anti-pattern that usually indicates poorly structured code.  And yes, lots of Neutron tests exhibit this flaw, but that\u0027s not a reason to perpetuate it.\n\nReference: http://googletesting.blogspot.com/2013/03/testing-on-toilet-testing-state-vs.html","commit_id":"3cedb38445f8a9084cec2aa69568b784c605b96c"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d3792d3692d1b4c57066c57c91b3242b8e29cf69","unresolved":false,"context_lines":[{"line_number":997,"context_line":"        ri \u003d mock.MagicMock()"},{"line_number":998,"context_line":"        ri.is_ha \u003d True"},{"line_number":999,"context_line":"        device \u003d None"},{"line_number":1000,"context_line":"        addresses \u003d [\u002715.1.2.2/24\u0027, \u002715.1.2.3/32\u0027]"},{"line_number":1001,"context_line":"        agent._ha_get_existing_cidrs \u003d mock.MagicMock()"},{"line_number":1002,"context_line":"        agent._ha_get_existing_cidrs.return_value \u003d addresses"},{"line_number":1003,"context_line":"        self.assertEqual(set(addresses), agent._get_router_cidrs(ri, device,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a930d6b_b00fd7e0","line":1000,"updated":"2015-01-21 15:12:39.000000000","message":"One improvement would be to mock instance.get_existing_vip_ip_addresses instead, so that we\u0027d catch any issues with argument passing between get_router_cidrs and ha_get_existing_cidrs.","commit_id":"dfd4f37e2dac3208f168b123cb05440a6ec7dc5a"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"423f7cc63272b32c3924acc6e60eec1338f40e43","unresolved":false,"context_lines":[{"line_number":997,"context_line":"        ri \u003d mock.MagicMock()"},{"line_number":998,"context_line":"        ri.is_ha \u003d True"},{"line_number":999,"context_line":"        device \u003d None"},{"line_number":1000,"context_line":"        addresses \u003d [\u002715.1.2.2/24\u0027, \u002715.1.2.3/32\u0027]"},{"line_number":1001,"context_line":"        agent._ha_get_existing_cidrs \u003d mock.MagicMock()"},{"line_number":1002,"context_line":"        agent._ha_get_existing_cidrs.return_value \u003d addresses"},{"line_number":1003,"context_line":"        self.assertEqual(set(addresses), agent._get_router_cidrs(ri, device,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a930d6b_447d066e","line":1000,"in_reply_to":"1a930d6b_b00fd7e0","updated":"2015-01-22 00:29:53.000000000","message":"Makes sense, how\u0027s this look?","commit_id":"dfd4f37e2dac3208f168b123cb05440a6ec7dc5a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6cf2319a93d38ef4bec8cde781f3daa1eadfea3e","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        ri \u003d mock.MagicMock()"},{"line_number":997,"context_line":"        ri.is_ha \u003d True"},{"line_number":998,"context_line":"        addresses \u003d [\u002715.1.2.2/24\u0027, \u002715.1.2.3/32\u0027]"},{"line_number":999,"context_line":"        instance \u003d mock.MagicMock()"},{"line_number":1000,"context_line":"        instance.get_existing_vip_ip_addresses.return_value \u003d addresses"},{"line_number":1001,"context_line":"        ri.keepalived_manager.config.get_instance.return_value \u003d instance"},{"line_number":1002,"context_line":"        device \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a930d6b_e86218d7","line":999,"updated":"2015-01-23 00:48:36.000000000","message":"Please revert to the approach from the previous patchset.  The point of this test is to validate get_router_cidrs, and embedding knowledge of ha_get_existing_cidrs adds unnecessary complexity.","commit_id":"56ed9c8be91bcbcfe0ad9ddb3e90d01fbf532ed8"}]}
