)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"80796419c51d13bf1416622a7dc3b9d01c05ce13","unresolved":false,"context_lines":[{"line_number":19,"context_line":"EUI-64 addresses is repeatable."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"This commit removes a test case from the DNS integration tests. The"},{"line_number":22,"context_line":"test was specifically testing that DNS records we updated in the case"},{"line_number":23,"context_line":"where a subnet id was passed to re-allocate a fixed_ip. Since the use"},{"line_number":24,"context_line":"case no longer works, the test doesn\u0027t make sense."},{"line_number":25,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a8ec9b2_86c055e2","line":22,"range":{"start_line":22,"start_character":47,"end_line":22,"end_character":49},"updated":"2016-09-20 11:50:07.000000000","message":"were","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"}],"neutron/db/ipam_backend_mixin.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"80796419c51d13bf1416622a7dc3b9d01c05ce13","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        return not (ipv6_utils.is_auto_address_subnet(subnet) and"},{"line_number":416,"context_line":"                    not ipv6_utils.is_ipv6_pd_enabled(subnet))"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _get_changed_ips_for_port(self, context, original_ips,"},{"line_number":419,"context_line":"                                  new_ips, device_owner):"},{"line_number":420,"context_line":"        \"\"\"Calculate changes in IPs for the port.\"\"\""},{"line_number":421,"context_line":"        # Collect auto addressed subnet ids that has to be removed on update"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_617893f9","line":418,"updated":"2016-09-20 11:50:07.000000000","message":"(No action required) I am probably not used to ipam code, but the size of the function makes me cry and bite finger nails.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"55d29a5ca995718a1714f7b26b8bcf1a997c96c3","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        return not (ipv6_utils.is_auto_address_subnet(subnet) and"},{"line_number":416,"context_line":"                    not ipv6_utils.is_ipv6_pd_enabled(subnet))"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _get_changed_ips_for_port(self, context, original_ips,"},{"line_number":419,"context_line":"                                  new_ips, device_owner):"},{"line_number":420,"context_line":"        \"\"\"Calculate changes in IPs for the port.\"\"\""},{"line_number":421,"context_line":"        # Collect auto addressed subnet ids that has to be removed on update"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_4cf3c00a","line":418,"in_reply_to":"7a8ec9b2_31632f43","updated":"2016-09-20 14:18:39.000000000","message":"Definitely not as part of the fix.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"62e0821c2382928f82644224c7be7c94cb412905","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        return not (ipv6_utils.is_auto_address_subnet(subnet) and"},{"line_number":416,"context_line":"                    not ipv6_utils.is_ipv6_pd_enabled(subnet))"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _get_changed_ips_for_port(self, context, original_ips,"},{"line_number":419,"context_line":"                                  new_ips, device_owner):"},{"line_number":420,"context_line":"        \"\"\"Calculate changes in IPs for the port.\"\"\""},{"line_number":421,"context_line":"        # Collect auto addressed subnet ids that has to be removed on update"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_02a17fa9","line":418,"in_reply_to":"7a8ec9b2_4cf3c00a","updated":"2016-09-20 14:43:40.000000000","message":"I don\u0027t intend to refactor at this time as a prerequisite or a follow up either. I have a hard time breaking up methods just for the sake of making them shorter because it seems to just spread the logic around. There are many good reasons to restructure and simplify a piece of code: separation of concerns, good code reuse, better testability, .... There are certainly others that I didn\u0027t list here. But, \"make it shorter\" doesn\u0027t sound to me like a worthy goal on its own. Sure, a very long method is often an indicator that the method could improve in one of these other areas. But, it would help me more if you could point out what a better code structure would be and why.\n\nWe might get a little in testability. But, honestly the only tests I can think of that would operate on a small part of this method in isolation feel contrived to me.\n\nIf you have an idea. I\u0027d welcome the chance to review any suggestion you have for a follow up.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"55b396d9860f39c59055795fbb3fa19b52211233","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        return not (ipv6_utils.is_auto_address_subnet(subnet) and"},{"line_number":416,"context_line":"                    not ipv6_utils.is_ipv6_pd_enabled(subnet))"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _get_changed_ips_for_port(self, context, original_ips,"},{"line_number":419,"context_line":"                                  new_ips, device_owner):"},{"line_number":420,"context_line":"        \"\"\"Calculate changes in IPs for the port.\"\"\""},{"line_number":421,"context_line":"        # Collect auto addressed subnet ids that has to be removed on update"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_31632f43","line":418,"in_reply_to":"7a8ec9b2_617893f9","updated":"2016-09-20 14:13:36.000000000","message":"I\u0027m sorry to make you cry. I\u0027m not going to refactor for this patch at this time. Maybe later.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"80796419c51d13bf1416622a7dc3b9d01c05ce13","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        # Consider fixed_ips that don\u0027t specify ip_address. Try to match them"},{"line_number":444,"context_line":"        # up with originals to see if they can be reused.  Create a new map of"},{"line_number":445,"context_line":"        # the remaining, unmatched originals for this step."},{"line_number":446,"context_line":"        orig_by_subnet \u003d {ip[\u0027subnet_id\u0027]: ip"},{"line_number":447,"context_line":"                          for ip in orig_by_ip.values()}"},{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_79776b3b","line":446,"range":{"start_line":446,"start_character":26,"end_line":446,"end_character":45},"updated":"2016-09-20 11:50:07.000000000","message":"IIUC it assumes that no port has a pair of allocations for the same subnet. Is it a correct assumption?","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"55b396d9860f39c59055795fbb3fa19b52211233","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        # Consider fixed_ips that don\u0027t specify ip_address. Try to match them"},{"line_number":444,"context_line":"        # up with originals to see if they can be reused.  Create a new map of"},{"line_number":445,"context_line":"        # the remaining, unmatched originals for this step."},{"line_number":446,"context_line":"        orig_by_subnet \u003d {ip[\u0027subnet_id\u0027]: ip"},{"line_number":447,"context_line":"                          for ip in orig_by_ip.values()}"},{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_11a1d3a9","line":446,"range":{"start_line":446,"start_character":26,"end_line":446,"end_character":45},"in_reply_to":"7a8ec9b2_79776b3b","updated":"2016-09-20 14:13:36.000000000","message":"Yeah, thats a problem that I actually had intended to rectify but didn\u0027t. Good catch.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"80796419c51d13bf1416622a7dc3b9d01c05ce13","unresolved":false,"context_lines":[{"line_number":446,"context_line":"        orig_by_subnet \u003d {ip[\u0027subnet_id\u0027]: ip"},{"line_number":447,"context_line":"                          for ip in orig_by_ip.values()}"},{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"},{"line_number":450,"context_line":"                continue"},{"line_number":451,"context_line":"            orig \u003d orig_by_subnet.pop(ip[\u0027subnet_id\u0027], None)"},{"line_number":452,"context_line":"            if orig and not ipv6_utils.is_eui64_address(orig[\u0027ip_address\u0027]):"},{"line_number":453,"context_line":"                # Use the original address on this subnet"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_36b330eb","line":450,"range":{"start_line":449,"start_character":0,"end_line":450,"end_character":24},"updated":"2016-09-20 11:50:07.000000000","message":"nit: that could be avoided if you would pop ip_address caring allocations in line 442.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"55b396d9860f39c59055795fbb3fa19b52211233","unresolved":false,"context_lines":[{"line_number":446,"context_line":"        orig_by_subnet \u003d {ip[\u0027subnet_id\u0027]: ip"},{"line_number":447,"context_line":"                          for ip in orig_by_ip.values()}"},{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"},{"line_number":450,"context_line":"                continue"},{"line_number":451,"context_line":"            orig \u003d orig_by_subnet.pop(ip[\u0027subnet_id\u0027], None)"},{"line_number":452,"context_line":"            if orig and not ipv6_utils.is_eui64_address(orig[\u0027ip_address\u0027]):"},{"line_number":453,"context_line":"                # Use the original address on this subnet"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_918963cd","line":450,"range":{"start_line":449,"start_character":0,"end_line":450,"end_character":24},"in_reply_to":"7a8ec9b2_36b330eb","updated":"2016-09-20 14:13:36.000000000","message":"I considered it thought this wasn\u0027t much different.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"264fd911f56f5e3a18a4cde9d311e70816218e12","unresolved":false,"context_lines":[{"line_number":446,"context_line":"        orig_by_subnet \u003d {ip[\u0027subnet_id\u0027]: ip"},{"line_number":447,"context_line":"                          for ip in orig_by_ip.values()}"},{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"},{"line_number":450,"context_line":"                continue"},{"line_number":451,"context_line":"            orig \u003d orig_by_subnet.pop(ip[\u0027subnet_id\u0027], None)"},{"line_number":452,"context_line":"            if orig and not ipv6_utils.is_eui64_address(orig[\u0027ip_address\u0027]):"},{"line_number":453,"context_line":"                # Use the original address on this subnet"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_130c7041","line":450,"range":{"start_line":449,"start_character":0,"end_line":450,"end_character":24},"in_reply_to":"7a8ec9b2_918963cd","updated":"2016-09-20 16:25:39.000000000","message":"I should expound a little on why I chose not to do this because I considered it again as I was addressing other feedback.\n\nThe reason that I didn\u0027t want to get in to popping the addresses off on L442  is that to make that safe I\u0027d have to make a copy of the list. You have to be careful modifying a list you\u0027re iterating over. I thought this was easier to get right and maintain.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"80796419c51d13bf1416622a7dc3b9d01c05ce13","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"},{"line_number":450,"context_line":"                continue"},{"line_number":451,"context_line":"            orig \u003d orig_by_subnet.pop(ip[\u0027subnet_id\u0027], None)"},{"line_number":452,"context_line":"            if orig and not ipv6_utils.is_eui64_address(orig[\u0027ip_address\u0027]):"},{"line_number":453,"context_line":"                # Use the original address on this subnet"},{"line_number":454,"context_line":"                prev_ips.append(orig)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_d9dcff1a","line":451,"range":{"start_line":451,"start_character":12,"end_line":451,"end_character":60},"updated":"2016-09-20 11:50:07.000000000","message":"whta\u0027s the plan when multiple fixed_ips request just \u0027subnet_id\u0027? Do we allocate multiple addresses, or just one?","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"55b396d9860f39c59055795fbb3fa19b52211233","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        for ip in ips:"},{"line_number":449,"context_line":"            if \u0027ip_address\u0027 in ip:"},{"line_number":450,"context_line":"                continue"},{"line_number":451,"context_line":"            orig \u003d orig_by_subnet.pop(ip[\u0027subnet_id\u0027], None)"},{"line_number":452,"context_line":"            if orig and not ipv6_utils.is_eui64_address(orig[\u0027ip_address\u0027]):"},{"line_number":453,"context_line":"                # Use the original address on this subnet"},{"line_number":454,"context_line":"                prev_ips.append(orig)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_31f16f6b","line":451,"range":{"start_line":451,"start_character":12,"end_line":451,"end_character":60},"in_reply_to":"7a8ec9b2_d9dcff1a","updated":"2016-09-20 14:13:36.000000000","message":"We allocate multiple. I should add a test for this.","commit_id":"3b3736f2ea0c98c3243f67929e73806fd1854c8f"}],"neutron/tests/unit/db/test_ipam_backend_mixin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"200efb0d1d577ccbc001f65c247a52ffb284a82a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                                                      original_ips,"},{"line_number":78,"context_line":"                                                      new_ips,"},{"line_number":79,"context_line":"                                                      owner)"},{"line_number":80,"context_line":"        self.assertEqual(expected_change, change)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":83,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a8ec9b2_f06c4f0a","line":80,"updated":"2016-09-20 20:14:16.000000000","message":"I had that unit test failure fixed in my local copy by sorting each part of this tuple here. But, I thought it wouldn\u0027t matter and reverted it. I knew I\u0027d need it. I\u0027ll fix it up and resubmit.","commit_id":"3b30775f6d83f73bb5a0a6539b3b82f5c796d874"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b4e4bc44ed9f59cafd8a03a1799c02c9c4390d76","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_3d3759b1","line":91,"updated":"2016-09-21 08:22:45.000000000","message":"hm. isn\u0027t assertItemsEqual what you need?","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4bfbe13c4b286948cbfff6d1ea38e4be28861aaa","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_35ec088f","line":91,"in_reply_to":"5a8bc5a2_d57317b3","updated":"2016-09-23 03:06:53.000000000","message":"@John in python3 dicts are *unorderable* [1]. This means that sorted on a sequence of dicts doesn\u0027t work.\n\n  % python3\n  ...\n  \u003e\u003e\u003e sorted([{1:2}, {3:4}])\n  Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  TypeError: unorderable types: dict() \u003c dict()\n\nThe documentation for assertItemsEqual says it works on unhashable objects but it doesn\u0027t say anything about unorderable objects. Maybe they made a mistake in the documentation, I don\u0027t know. If you want to post a follow-up to clean this up, that is something that we can look in to as part of that patch review.\n\nCount may work on unorderable objects, I don\u0027t know. Since we\u0027re using python2.7, the point is moot.\n\n[1] http://stackoverflow.com/questions/22333388/dicts-are-not-orderable-in-python-3","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"41185174b0422f68d3bf8f0ea62bf27a9e884854","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_e6a1bd47","line":91,"in_reply_to":"7a8ec9b2_31b4c433","updated":"2016-09-21 15:28:38.000000000","message":"Also, they chose to rename the method to assertCountEqual in python 3. It still seems to work as assertItemsEqual for now but it is annoying. It is especially annoying since the new name seems less intuitive to me than the old name.","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e80fa4c7e67f95806c215df848e3466dbcaeff90","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_9deb0d78","line":91,"in_reply_to":"7a8ec9b2_3d3759b1","updated":"2016-09-21 08:25:55.000000000","message":"Actually, why do we need this change for the _test_get_changed_ips_for_port in the first place? Wouldn\u0027t Changes object that is a namedtuple handle comparison for you?","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c88fca17db3dab9ab2713190f38cc49488b64da3","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_c3749aff","line":91,"in_reply_to":"7a8ec9b2_41cfb07e","updated":"2016-09-21 23:25:27.000000000","message":"I wasn\u0027t too concerned about the change in name. It bothered me more that the docs for it don\u0027t claim to work in this case. I didn\u0027t want to use undocumented behavior.\n\nI\u0027d be happy if one of you wants to post a follow up to \"fix\" this. :)","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"f1b7a060cc1a070a2f93e76755aef4ba3881e0fa","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_d57317b3","line":91,"in_reply_to":"7a8ec9b2_47d32fd5","updated":"2016-09-22 10:06:06.000000000","message":"The documentation for assertItemsEqual[1] and assertCountEqual[2] is pretty clear that both functions work with unordered objects. Though the implementation of each appears to be slightly different - assertItemsEqual is described as being equivalent to:\n\n assertEqual(sorted(expected), sorted(actual))\n\nwhereas assertCountEqual is equivalent to:\n\n assertEqual(Counter(list(first)), Counter(list(second)))\n\nThe first is essentially what you\u0027ve implemented here, the second verifies that each object has an equal number of occurrences of each element. This could just be a difference in the documentation though, as the result is really the same. In either case, it\u0027s safe to say that assertItemsEqual is \u0027correct\u0027 for comparing dicts. Hopefully we can standardize around it going forward. I\u0027ll go ahead and roll a patch to refactor this test. Glad we could merge the fix :)\n\n [1] https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertItemsEqual\n [2] https://docs.python.org/3.2/library/unittest.html#unittest.TestCase.assertCountEqual","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"f68d758dde8b8088c38419f9850c55ec33c16142","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_41cfb07e","line":91,"in_reply_to":"7a8ec9b2_9bb84b13","updated":"2016-09-21 18:33:03.000000000","message":"This cropped up in another review a few weeks ago, and Henry pointed out that unittest2 provides py3 compatibility for assertItemsEqual, so that\u0027s what\u0027s used elsewhere. I hate to be a stickler, but let\u0027s use that instead of a helper function. See:\n\n https://review.openstack.org/#/c/331825/","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"028adf9d39e636796da7c5ea721cfebff13b0c78","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_31b4c433","line":91,"in_reply_to":"7a8ec9b2_9deb0d78","updated":"2016-09-21 15:16:47.000000000","message":"It does until you factor in my comment on L82 and the addition of the test around L203. The order of the items in the list is not consistent and dicts are not orderable in py3.\n\nI looked at assertItemsEqual and it said it works with unhashable objects but it wasn\u0027t clear if it would work for dicts which are unorderable in py3 [1]. unhashable !\u003d unorderable. I just tried it locally and it seems to work but I hate relying on undocumented behavior.\n\nSo, I did this on purpose.\n\n[1] http://stackoverflow.com/questions/22333388/dicts-are-not-orderable-in-python-3","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"0ac95f4dc4778e8f10b0e07296be4f10277251e2","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_47d32fd5","line":91,"in_reply_to":"7a8ec9b2_c3749aff","updated":"2016-09-22 03:53:53.000000000","message":"I learn new subtleties of this problem every time it surfaces.\n\nI going to let this change in as-is now. It works, and it helps with a critical bug.\n\nDuring ocata, those who feel so inclined can refactor this to perfection.","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b6a827d4ada144218790319d18815bb1c390ffff","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        assertUnorderedListOfDictEqual(expected.add, change.add)"},{"line_number":90,"context_line":"        assertUnorderedListOfDictEqual(expected.original, change.original)"},{"line_number":91,"context_line":"        assertUnorderedListOfDictEqual(expected.remove, change.remove)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test__get_changed_ips_for_port(self):"},{"line_number":94,"context_line":"        new_ips \u003d self._prepare_ips(self.default_new_ips)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_9bb84b13","line":91,"in_reply_to":"7a8ec9b2_e6a1bd47","updated":"2016-09-21 17:42:47.000000000","message":"I think we use the assertItemsEqual function in quite some places for dicts, but meh, I guess I am not in the mood to push or look for proofs it works, especially now.","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d48f23432e0491f7f3ff3f0658edfc11180dd894","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                   {\u0027subnet_id\u0027: \u0027id-3\u0027},"},{"line_number":201,"context_line":"                   {\u0027subnet_id\u0027: \u0027id-3\u0027, \u0027ip_address\u0027: \u00274.3.2.10\u0027}]"},{"line_number":202,"context_line":"        original_ips \u003d [{\u0027subnet_id\u0027: \u0027id-3\u0027, \u0027ip_address\u0027: \u00274.3.2.1\u0027},"},{"line_number":203,"context_line":"                        {\u0027subnet_id\u0027: \u0027id-3\u0027, \u0027ip_address\u0027: \u00274.3.2.10\u0027}]"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        expected_change \u003d self.mixin.Changes("},{"line_number":206,"context_line":"            add\u003d[{\u0027subnet_id\u0027: \u0027id-3\u0027}],"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_f5b0b38d","line":203,"updated":"2016-09-21 04:06:06.000000000","message":"Note: This seems to be the test that requires the changes on L80 - L91.","commit_id":"14fee9cfcc816128606fc11d33800af90a0b1859"}]}
