)]}'
{"kuryr_libnetwork/controllers.py":[{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"2ac4548d95fd5b25d96918aa9df96fca55d7cedf","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_aca84421","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"updated":"2017-01-23 15:41:01.000000000","message":"Hi \nThis is added in the patch https://review.openstack.org/#/c/412772/7 .\n\nI thought the reason why this is been added was to avoid delete the port which is not created by kuryr.\n\nThere will be problem in the following case:\nwe have two port with same ip. one is created by kuryr, another is created by user. for example :\n$ neutron port-list\n...\n| 77076624-5d4d-4bf2-9189-da00583c6636 | 015ce550d68cdb511a1664fd397704a9df0e436d620b1be607ab4575cce1c4c4-por | fa:16:3e:76:10:67 | {\"subnet_id\": \"fb3c9133-45e7-47e2-9f06-cbcb1a6c5d68\", \"ip_address\":  |\n|                                      | t                                                                    |                   | \"100.0.0.10\"}                                                        |\n...\n| d3232857-771c-41b2-821b-17ff40e53644 |                                                                      | fa:16:3e:5b:49:0b | {\"subnet_id\": \"3dbbbbb8-a6d8-4aac-98b4-c0bdb4e95f14\", \"ip_address\":  |\n|                                      |                                                                      |                   | \"100.0.0.10\"}                                                        |\n\nwhen we delete container, kuryr will delete all these two ports now.\n\n\nAfter we have tag for port, this should can be avoid at that time.","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"5f6ba8ac0333e65756738e9d64748f2e213d731b","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_3c346148","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_3b8b8c20","updated":"2017-01-24 08:38:32.000000000","message":"Yes Liping, you are right, I didn\u0027t realize the subnet filter was done by cidr instead of subnet_id, so this will indeed remove both ports. I propose an (temporary) extra check at the if condition to ensure the device_name is the device_id ended up with -Port as we do right now when creating the ports from kuryr. Will this be enough until we get the tagging support at Neutron (Armando said hopefully for Ocata)","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"f04f2b5772178617bf1d9eea5d6919d69bda36d0","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_bfe68341","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_3c346148","updated":"2017-01-24 08:52:01.000000000","message":"Hi Luis, it is ok for me to use this as temp solution.","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"54bf25515ba880c381e730a116948ae5cf31621b","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_6381f8fa","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_4285e904","updated":"2017-01-23 22:54:09.000000000","message":"Hi Luis,\nIn Line 1509, it will get all the subnets with same subnet_cidr, in this case, it will also get the subnet which is not created by kuryr.\n\nI manual test this in my local environment with your patch, it will delete both of the ports.\n\nMy Environment is default vagrant environmen in kuryr-libnetwork, built by vagrant up.\n\nReproduce Steps:\n1. Create kuryr network 100.0.0.0/24(Let\u0027s say Kuryr-Network) with docker.\n2. Manual create another neutron network(Let\u0027s say Manual-Network) with subnet 100.0.0.0/24.\n3. Start a docker in Kuryr-Network, in case it get IP : 100.0.0.10.\n4. Manual create a port 100.0.0.10 in Manual-Network.\nNow we will get two same ip 100.0.0.10 one is created by kuryr, another is manually created.\n5. Delete docker container at this time, it will delete both of these two ports.\n\nThanks.","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"8c93b4d7169943665e0017f8b014e9b2f68ed399","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_d2c7d461","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_6381f8fa","updated":"2017-01-24 01:28:39.000000000","message":"Hi Luis, agree with Liping here, this will break using existing Neutron resource case, let\u0027s see others\u0027 opinions. So give my -1 temporary.","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"cbe27f0c6283620806333681ba241949520c586e","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_4285e904","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_aca84421","updated":"2017-01-23 16:03:14.000000000","message":"The if condition in L1520-1521 check both subnet_id and ip, so there should not be two ports with the same IP in the same subnet. So unless I\u0027m missing something, in your example, only one of the ports will be deleted, as the subnet_ids are different","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"e8e779a7a067e085e83fa2e797b7df94368946e1","unresolved":false,"context_lines":[{"line_number":1514,"context_line":"    iface \u003d ipaddress.ip_interface(six.text_type(rel_address))"},{"line_number":1515,"context_line":"    rel_ip_address \u003d six.text_type(iface.ip)"},{"line_number":1516,"context_line":"    try:"},{"line_number":1517,"context_line":"        all_ports \u003d app.neutron.list_ports(device_owner\u003dlib_const.DEVICE_OWNER)"},{"line_number":1518,"context_line":"        for port in all_ports[\u0027ports\u0027]:"},{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_3b8b8c20","side":"PARENT","line":1517,"range":{"start_line":1517,"start_character":43,"end_line":1517,"end_character":78},"in_reply_to":"5a3905b3_d2c7d461","updated":"2017-01-24 06:34:56.000000000","message":"As an option we can temporary use name/description fields of subnet/port in case they are created by kuryr, so making sure on removal that the entity was created by kuryr.\nOr as it was discussed during the weekly meeting, treat trunk/subport as a special case","commit_id":"29c3dcb0b5add6549dfb520a529fd4a5a83e001f"},{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"6be95f7ac480958ca3b25d0b9bf4d2d169aab47d","unresolved":false,"context_lines":[{"line_number":1519,"context_line":"            for tmp_subnet in subnets:"},{"line_number":1520,"context_line":"                if (port[\u0027fixed_ips\u0027][0][\u0027subnet_id\u0027] \u003d\u003d tmp_subnet[\u0027id\u0027] and"},{"line_number":1521,"context_line":"                    port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027] \u003d\u003d rel_ip_address and"},{"line_number":1522,"context_line":"                    port[\u0027name\u0027] \u003d\u003d \u0027-\u0027.join([port[\u0027device_id\u0027],"},{"line_number":1523,"context_line":"                                              lib_utils.PORT_POSTFIX])):"},{"line_number":1524,"context_line":"                    app.neutron.delete_port(port[\u0027id\u0027])"},{"line_number":1525,"context_line":"    except n_exceptions.NeutronClientException as ex:"},{"line_number":1526,"context_line":"        app.logger.error(_LE(\"Error happened while fetching \""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_2d3d098f","line":1523,"range":{"start_line":1522,"start_character":36,"end_line":1523,"end_character":72},"updated":"2017-01-24 09:35:19.000000000","message":"How about to use utils.get_neutron_port_name(port[\u0027device_id\u0027])?","commit_id":"54819f3bdab095b0440bcfac26217706ffb574d2"}],"kuryr_libnetwork/tests/unit/test_kuryr_ipam.py":[{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"29c96bda56f1d959529024c947f68b6325783844","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        ]"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        list_port_response \u003d {\u0027ports\u0027: [fake_port[\u0027port\u0027]]}"},{"line_number":830,"context_line":"        mock_list_ports.return_value \u003d list_port_response"},{"line_number":831,"context_line":""},{"line_number":832,"context_line":"        mock_delete_port.return_value \u003d {}"},{"line_number":833,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_93238055","line":830,"range":{"start_line":830,"start_character":8,"end_line":830,"end_character":57},"updated":"2017-01-24 10:29:58.000000000","message":"Since we gets all ports, the mock_list_ports should contains both fake_port and fake_port_no_kuryr.","commit_id":"3eb6e9c97a2d545ca0ea3dfa10712cd2cf1eedb6"}]}
