)]}'
{"zun/network/kuryr_network.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"071ad52f89aa043160e5e947871601895b91b7f7","unresolved":false,"context_lines":[{"line_number":293,"context_line":"                container_id, network_name, **kwargs)"},{"line_number":294,"context_line":"        except exception.DockerError:"},{"line_number":295,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":296,"context_line":"                self.do_port_cleanup(addresses, port)"},{"line_number":297,"context_line":"        return addresses"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"    def do_port_cleanup(self, addresses, port):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_0acb6453","line":296,"range":{"start_line":296,"start_character":21,"end_line":296,"end_character":36},"updated":"2018-08-04 22:44:06.000000000","message":"Note (to myself): need to consolidate the port cleanup logic after this patch is merged: https://review.openstack.org/#/c/588941/ .","commit_id":"0c7b64009dbfaa5557902cd9a313a5209a332908"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"071ad52f89aa043160e5e947871601895b91b7f7","unresolved":false,"context_lines":[{"line_number":300,"context_line":"        preserve_flag \u003d addresses[0].get(\u0027preserve_on_delete\u0027)"},{"line_number":301,"context_line":"        if preserve_flag:"},{"line_number":302,"context_line":"            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \"\"}}"},{"line_number":303,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d \\"},{"line_number":304,"context_line":"                port.get(BINDING_PROFILE, {})"},{"line_number":305,"context_line":"            port_req_body[\u0027port\u0027][\u0027mac_address\u0027] \u003d port.get(\u0027mac_address\u0027)"},{"line_number":306,"context_line":"            self.neutron_api.update_port(port.get(\u0027id\u0027), port_req_body)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8adc5419","line":303,"range":{"start_line":303,"start_character":34,"end_line":303,"end_character":49},"updated":"2018-08-04 22:44:06.000000000","message":"I guess this is for the SR-IOV scenario to restore the original binding profile?\n\nFirst, you would need admin privilege to update the binding:profile field but line #306 is using a normal privilege.\n\nSecond, a better way to do that is to unset the fields \u0027pci_vendor_info\u0027 and \u0027pci_slot\u0027 and leave other fields untouched, like how nova did it: https://github.com/openstack/nova/blob/c9b7c3577f373477d003706bb5ca748a51bbf023/nova/network/neutronv2/api.py#L633","commit_id":"0c7b64009dbfaa5557902cd9a313a5209a332908"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"071ad52f89aa043160e5e947871601895b91b7f7","unresolved":false,"context_lines":[{"line_number":302,"context_line":"            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \"\"}}"},{"line_number":303,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d \\"},{"line_number":304,"context_line":"                port.get(BINDING_PROFILE, {})"},{"line_number":305,"context_line":"            port_req_body[\u0027port\u0027][\u0027mac_address\u0027] \u003d port.get(\u0027mac_address\u0027)"},{"line_number":306,"context_line":"            self.neutron_api.update_port(port.get(\u0027id\u0027), port_req_body)"},{"line_number":307,"context_line":"        else:"},{"line_number":308,"context_line":"            self.neutron_api.delete_port(port.get(\u0027id\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4ab15ce1","line":305,"range":{"start_line":305,"start_character":61,"end_line":305,"end_character":72},"updated":"2018-08-04 22:44:06.000000000","message":"Note (to myself): the logic to reset binding profile and mac address might need to go to \u0027disconnect_container_from_network\u0027 as well.","commit_id":"0c7b64009dbfaa5557902cd9a313a5209a332908"},{"author":{"_account_id":23829,"name":"weikeyou","email":"wei.keyou@zte.com.cn","username":"weikeyou"},"change_message_id":"2ba00a95b49d068221f1f59456b68912eb425d57","unresolved":false,"context_lines":[{"line_number":304,"context_line":"            port_req_body[\u0027port\u0027][BINDING_HOST_ID] \u003d None"},{"line_number":305,"context_line":"            port_req_body[\u0027port\u0027][\u0027mac_address\u0027] \u003d port.get(\u0027mac_address\u0027)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"            # NOTE: We\u0027re doing this to remove the binding information"},{"line_number":308,"context_line":"            # for the physical device but don\u0027t want to overwrite the other"},{"line_number":309,"context_line":"            # information in the binding profile."},{"line_number":310,"context_line":"            port_profile \u003d port.get(BINDING_PROFILE, {})"},{"line_number":311,"context_line":"            for profile_key in (\u0027pci_vendor_info\u0027, \u0027pci_slot\u0027):"},{"line_number":312,"context_line":"                if profile_key in port_profile:"},{"line_number":313,"context_line":"                    del port_profile[profile_key]"},{"line_number":314,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d port_profile"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"            try:"},{"line_number":317,"context_line":"                # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_4d84f35e","line":314,"range":{"start_line":307,"start_character":0,"end_line":314,"end_character":65},"updated":"2018-08-07 11:40:39.000000000","message":"I think that it is possible to use like this:\n    port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d \\\n                port.get(BINDING_PROFILE, {})\nBecause the port is original port in neutron that has not been used by Zun. All the information in the binding profile is initial information.\n    This is different from the bellow patch: https://review.openstack.org/#/c/589426/  , in this patch ,the port has been used by container.\n    What do you think about?","commit_id":"ff11120c7e03ca2a8c34f426ac82c2afa941765c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"85c73754567b19ea72f031bfa29ce91ca60fdeb8","unresolved":false,"context_lines":[{"line_number":304,"context_line":"            port_req_body[\u0027port\u0027][BINDING_HOST_ID] \u003d None"},{"line_number":305,"context_line":"            port_req_body[\u0027port\u0027][\u0027mac_address\u0027] \u003d port.get(\u0027mac_address\u0027)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"            # NOTE: We\u0027re doing this to remove the binding information"},{"line_number":308,"context_line":"            # for the physical device but don\u0027t want to overwrite the other"},{"line_number":309,"context_line":"            # information in the binding profile."},{"line_number":310,"context_line":"            port_profile \u003d port.get(BINDING_PROFILE, {})"},{"line_number":311,"context_line":"            for profile_key in (\u0027pci_vendor_info\u0027, \u0027pci_slot\u0027):"},{"line_number":312,"context_line":"                if profile_key in port_profile:"},{"line_number":313,"context_line":"                    del port_profile[profile_key]"},{"line_number":314,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d port_profile"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"            try:"},{"line_number":317,"context_line":"                # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_90ae8c96","line":314,"range":{"start_line":307,"start_character":0,"end_line":314,"end_character":65},"in_reply_to":"3f79a3b5_4d84f35e","updated":"2018-08-08 03:27:27.000000000","message":"Make sense. Your approach sounds equally good.","commit_id":"ff11120c7e03ca2a8c34f426ac82c2afa941765c"}]}
