)]}'
{"neutron/tests/unit/services/revisions/test_revision_plugin.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"1d5a0fec7401b5b74f0e26dbb48c5b66bbc94b9f","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            new \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: port[\u0027port\u0027][\u0027fixed_ips\u0027]}}"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                # ensure adding an IP allocation updates the port"},{"line_number":170,"context_line":"                next_ip \u003d str(netaddr.IPAddress("},{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_223c8191","line":170,"range":{"start_line":170,"start_character":16,"end_line":170,"end_character":23},"updated":"2019-03-27 19:56:38.000000000","message":"If what we need is simply a \"free\" IP address in the network, an alternative approach is to use _find_ip_address [1] to find one. IMHO, this is a more elegant approach.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/db/test_db_base_plugin_v2.py#L290","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"a144482b06df03633f9e2d0279af13c5a9f2c64c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            new \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: port[\u0027port\u0027][\u0027fixed_ips\u0027]}}"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                # ensure adding an IP allocation updates the port"},{"line_number":170,"context_line":"                next_ip \u003d str(netaddr.IPAddress("},{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_cdea850d","line":170,"range":{"start_line":170,"start_character":16,"end_line":170,"end_character":23},"in_reply_to":"5fc1f717_223c8191","updated":"2019-03-28 13:50:37.000000000","message":"Done","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"2fb6411a191ebebcb32b76f1827a1035eb3011fe","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            new \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: port[\u0027port\u0027][\u0027fixed_ips\u0027]}}"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                # ensure adding an IP allocation updates the port"},{"line_number":170,"context_line":"                next_ip \u003d str(netaddr.IPAddress("},{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_3f26d3cf","line":170,"range":{"start_line":170,"start_character":16,"end_line":170,"end_character":23},"in_reply_to":"5fc1f717_223c8191","updated":"2019-03-28 07:38:36.000000000","message":"I agree that using this _find_ip_address() method would be better here and would avoid this \"second test\" in except block.","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"13bdc8c91ec641f3ab994ea83fec6f9a9455a643","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            new \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: port[\u0027port\u0027][\u0027fixed_ips\u0027]}}"},{"line_number":168,"context_line":"            try:"},{"line_number":169,"context_line":"                # ensure adding an IP allocation updates the port"},{"line_number":170,"context_line":"                next_ip \u003d str(netaddr.IPAddress("},{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_f3d72422","line":170,"range":{"start_line":170,"start_character":16,"end_line":170,"end_character":23},"in_reply_to":"5fc1f717_3f26d3cf","updated":"2019-03-28 11:08:53.000000000","message":"Ok yes, this option is better than my suggestion in L174","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"6a28d526fc2f6a23baa5704d042f247c6ccb1d32","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"},{"line_number":174,"context_line":"            except matchers.MismatchError:"},{"line_number":175,"context_line":"                # Occasionally the +1 address is the subnet broadcast address"},{"line_number":176,"context_line":"                # which is rejected by neutron with a 400 InvalidIpForNetwork."},{"line_number":177,"context_line":"                # Retry with -1 address."}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_dddec50f","line":174,"updated":"2019-03-27 16:48:51.000000000","message":"Good catch! Thanks!\n\nI was thinking about testing first if the new IP is the subnet broadcast address. You have \"self.subnet.cidr\" and \"next_ip\".\n\nif netaddr.IPNetwork(self.subnet.cidr).broadcast \u003d\u003d next_ip:\n  prev_ip \u003d ....","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"a144482b06df03633f9e2d0279af13c5a9f2c64c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                      new[\u0027port\u0027][\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]) + 1)"},{"line_number":172,"context_line":"                new[\u0027port\u0027][\u0027fixed_ips\u0027].append({\u0027ip_address\u0027: next_ip})"},{"line_number":173,"context_line":"                response \u003d self._update(\u0027ports\u0027, port[\u0027port\u0027][\u0027id\u0027], new)"},{"line_number":174,"context_line":"            except matchers.MismatchError:"},{"line_number":175,"context_line":"                # Occasionally the +1 address is the subnet broadcast address"},{"line_number":176,"context_line":"                # which is rejected by neutron with a 400 InvalidIpForNetwork."},{"line_number":177,"context_line":"                # Retry with -1 address."}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_adf37908","line":174,"in_reply_to":"5fc1f717_dddec50f","updated":"2019-03-28 13:50:37.000000000","message":"I went with using _find_ip_address().","commit_id":"d528d7a470ebae541ac019c7bf926cd841dc9fd3"}]}
