)]}'
{"octavia/amphorae/backends/agent/api_server/plug.py":[{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"7f52a311878ff9d9f1259f7a8353e20edd749cfd","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                json\u003ddict(message\u003d\"Interface already exists\"), status\u003d409)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # This is the interface prior to moving into the netns"},{"line_number":86,"context_line":"        default_netns_interface \u003d self._interface_by_mac(mac_address)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # Always put the VIP interface as eth1"},{"line_number":89,"context_line":"        primary_interface \u003d consts.NETNS_PRIMARY_INTERFACE"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_fa751f99","side":"PARENT","line":86,"updated":"2019-07-29 17:15:15.000000000","message":"We may still need to have a way to poke the kernel to re-enumerate the PCI bus.","commit_id":"f4094381fdefffa2c23dfb6555765c48e5b77ba1"},{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"7f52a311878ff9d9f1259f7a8353e20edd749cfd","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return webob.Response(json\u003ddict("},{"line_number":183,"context_line":"                message\u003d\"Invalid network port\"), status\u003d400)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        default_netns_interface \u003d self._interface_by_mac(mac_address)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"        # We need to determine the interface name when inside the namespace"},{"line_number":188,"context_line":"        # to avoid name conflicts"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_9a642be7","line":185,"updated":"2019-07-29 17:15:15.000000000","message":"If we decide we don\u0027t need this, we can remove _interface_by_mac or...","commit_id":"d63bdfd475dc6292b059d0686538e8b8989494c7"},{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"7f52a311878ff9d9f1259f7a8353e20edd749cfd","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def _interface_by_mac(self, mac):"},{"line_number":227,"context_line":"        for interface in netifaces.interfaces():"},{"line_number":228,"context_line":"            if netifaces.AF_LINK in netifaces.ifaddresses(interface):"},{"line_number":229,"context_line":"                for link in netifaces.ifaddresses("},{"line_number":230,"context_line":"                        interface)[netifaces.AF_LINK]:"},{"line_number":231,"context_line":"                    if link.get(\u0027addr\u0027, \u0027\u0027).lower() \u003d\u003d mac.lower():"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_9aa98bde","line":228,"updated":"2019-07-29 17:15:15.000000000","message":"... or if we do still need it and keep this line, we\u0027ll have to wrap it around a try-catch for ValueError.","commit_id":"d63bdfd475dc6292b059d0686538e8b8989494c7"},{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"f4d7abff38eb865d44a715f6c51745f5f1c0ba91","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def _interface_by_mac(self, mac):"},{"line_number":230,"context_line":"        for interface in netifaces.interfaces():"},{"line_number":231,"context_line":"            if netifaces.AF_LINK in netifaces.ifaddresses(interface):"},{"line_number":232,"context_line":"                for link in netifaces.ifaddresses("},{"line_number":233,"context_line":"                        interface)[netifaces.AF_LINK]:"},{"line_number":234,"context_line":"                    if link.get(\u0027addr\u0027, \u0027\u0027).lower() \u003d\u003d mac.lower():"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_114819ca","line":231,"range":{"start_line":231,"start_character":36,"end_line":231,"end_character":68},"updated":"2019-07-30 07:09:47.000000000","message":"This can still raise ValueError when the interface is renamed between L230 and L231. I\u0027d suggest replacing this for-loop with a MAC address lookup. If the desired one is found, good, return. Else, re-enumerate the PCI bus and raise 404.","commit_id":"c021c8ff5b829c57f9bf31f1581def970ed2d00e"},{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"b8ff1cb873138ed9d3fcf3eeb3885ed5688e6a6c","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                addr \u003d ipr.get_links(idx)[0]"},{"line_number":233,"context_line":"                for attr in addr[\u0027attrs\u0027]:"},{"line_number":234,"context_line":"                    if attr[0] \u003d\u003d \u0027IFLA_IFNAME\u0027:"},{"line_number":235,"context_line":"                        return attr[1]"},{"line_number":236,"context_line":"        except Exception as e:"},{"line_number":237,"context_line":"            LOG.info(\u0027Unable to find interface with MAC: %s, rescanning \u0027"},{"line_number":238,"context_line":"                     \u0027and returning 404. Reported error: %s\u0027, mac, str(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_31b77cf8","line":235,"updated":"2019-08-12 17:27:28.000000000","message":"nit: _interface_by_mac is called only in L85 and is a \"private\" scoped method. We could break interface here by not returning the interface name but whatever. It could be useful some day.","commit_id":"2529fa33abfe17c645c4fdf23b0098b5908f11aa"}]}
