)]}'
{"zun/network/kuryr_network.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"09834b64167acbef4618863ec4be852f43b7b18c","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        if container.addresses and neutron_network_id:"},{"line_number":293,"context_line":"            addrs_list \u003d container.addresses.get(neutron_network_id, [])"},{"line_number":294,"context_line":"            for addr in addrs_list:"},{"line_number":295,"context_line":"                if not addr[\u0027preserve_on_delete\u0027]:"},{"line_number":296,"context_line":"                    port_id \u003d addr[\u0027port\u0027]"},{"line_number":297,"context_line":"                    neutron_ports.add(port_id)"},{"line_number":298,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f91af0f_b1fa4c40","line":295,"range":{"start_line":295,"start_character":16,"end_line":295,"end_character":50},"updated":"2018-01-08 21:15:32.000000000","message":"Nit: I think the code will be more readable if we tweak the order like below:\n\n  if addr[\u0027preserve_on_delete\u0027]:\n      ...\n  else:\n      ...","commit_id":"089f64da7a8673c5e9fe253ca24725083616a925"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"09834b64167acbef4618863ec4be852f43b7b18c","unresolved":false,"context_lines":[{"line_number":298,"context_line":"                else:"},{"line_number":299,"context_line":"                    port_id \u003d addr[\u0027port\u0027]"},{"line_number":300,"context_line":"                    port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \"\"}}"},{"line_number":301,"context_line":"                    self.neutron_api.update_port(port_id, port_req_body)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        try:"},{"line_number":304,"context_line":"            self.docker.disconnect_container_from_network(container_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f91af0f_31ce3c2d","line":301,"range":{"start_line":301,"start_character":37,"end_line":301,"end_character":48},"updated":"2018-01-08 21:15:32.000000000","message":"The fix is correct, but I think it is better to move the update_port call to the \u0027finally\u0027 block (like what we did for delete_port). This will ensure pre-existed ports will be always cleanup.","commit_id":"089f64da7a8673c5e9fe253ca24725083616a925"}]}
