)]}'
{"networking_bagpipe/agent/bagpipe_bgp_agent.py":[{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            )"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"def has_ipvpn_attachement(bgpvpn_info):"},{"line_number":202,"context_line":"    return has_attachement(bgpvpn_info, IPVPN)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"class PortInfo(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_e8531238","line":202,"range":{"start_line":201,"start_character":0,"end_line":202,"end_character":46},"updated":"2017-04-11 14:21:57.000000000","message":"to remove, not really useful","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"class NetworkInfo(object):"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def __init__(self, network_id, gateway_ip):"},{"line_number":220,"context_line":"        self.network_id \u003d network_id"},{"line_number":221,"context_line":"        self.gateway_ip \u003d gateway_ip"},{"line_number":222,"context_line":"        self.gateway_mac \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_a88063f6","line":219,"range":{"start_line":219,"start_character":33,"end_line":219,"end_character":45},"updated":"2017-04-11 14:21:57.000000000","message":"It doesn\u0027t sound right to have gateway_ip appear here as a particular case. See other comments below (lines 1015 and 758)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                    LOG.info(\"Sending all registered ports to bagpipe-bgp\")"},{"line_number":324,"context_line":"                    LOG.debug(\"Registered ports list: %s\" %"},{"line_number":325,"context_line":"                              self.ports_info)"},{"line_number":326,"context_line":"                    for port_id, port_info in self.ports_info.items():"},{"line_number":327,"context_line":"                        self._do_local_port_plug(port_id)"},{"line_number":328,"context_line":"                else:"},{"line_number":329,"context_line":"                    LOG.info(\"No attachment to send to bagpipe-bgp\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_78f593ec","line":326,"range":{"start_line":326,"start_character":24,"end_line":326,"end_character":69},"updated":"2017-04-11 14:21:57.000000000","message":"for port_id in self.port_info \n\n?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        status_loop.start(interval\u003dping_interval,"},{"line_number":338,"context_line":"                          initial_delay\u003dping_interval)  # TM: why not zero ?"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _gen_fallback_info(self, dst_mac):"},{"line_number":341,"context_line":"        return {\u0027fallback\u0027: {\u0027dst_mac\u0027: dst_mac,"},{"line_number":342,"context_line":"                             \u0027src_mac\u0027: FALLBACK_SRC_MAC,"},{"line_number":343,"context_line":"                             \u0027ovs_port_number\u0027: self.patch_mpls_to_int_ofport"},{"line_number":344,"context_line":"                             }"},{"line_number":345,"context_line":"                }"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def _add_fallback_info(self, net_info, details, vpn_type):"},{"line_number":348,"context_line":"        # if a gateway_mac is known, we will add fallback information"},{"line_number":349,"context_line":"        # to \u0027details\u0027"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        if (self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS and"},{"line_number":352,"context_line":"                vpn_type \u003d\u003d IPVPN and net_info.gateway_mac):"},{"line_number":353,"context_line":"            details.update("},{"line_number":354,"context_line":"                self._gen_fallback_info(net_info.gateway_mac)"},{"line_number":355,"context_line":"            )"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def _get_common_plug_details(self, port_info):"},{"line_number":358,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_4ec0e2e1","line":355,"range":{"start_line":340,"start_character":1,"end_line":355,"end_character":13},"updated":"2017-04-11 14:21:57.000000000","message":"Merge into one method ?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        if self.agent_type \u003d\u003d n_const.AGENT_TYPE_LINUXBRIDGE:"},{"line_number":388,"context_line":"            common_plug_details.update({\u0027linuxbr\u0027: net_info.linuxbr})"},{"line_number":389,"context_line":"        elif self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":390,"context_line":"            local_port.update(net_info.local_port)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"        common_plug_details.update({\u0027local_port\u0027: local_port})"},{"line_number":393,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_d8381fa1","line":390,"range":{"start_line":390,"start_character":12,"end_line":390,"end_character":50},"updated":"2017-04-11 14:21:57.000000000","message":"FIXME/TBC: should local_port/ovs sthings really be *stored* in net_info ?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        return common_plug_details"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def _populate_vpntype_ipaddress2details(self, vpn_instance_id, vpn_type,"},{"line_number":397,"context_line":"                                            service_name, services_info,"},{"line_number":398,"context_line":"                                            net_info, common_plug_details,"},{"line_number":399,"context_line":"                                            vpntype_ipaddress2details):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_8bc9195a","line":396,"range":{"start_line":396,"start_character":8,"end_line":396,"end_character":43},"updated":"2017-04-11 14:21:57.000000000","message":"(the name of this method is a bit obscure to me, but if, as suggested elsewhere below, we avoid storing information specific to bagpipe-bgp API calls in network_info, and only keep RPC info, then this this method will look totally different I think)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":434,"context_line":""},{"line_number":435,"context_line":"                plug_details.update(common_plug_details)"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"                if IPVPN \u003d\u003d vpn_type:"},{"line_number":438,"context_line":"                    for vpntype_ipaddress in vpntype_ipaddress2details:"},{"line_number":439,"context_line":"                        if EVPN in vpntype_ipaddress:"},{"line_number":440,"context_line":"                            plug_details[\u0027local_port\u0027] \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_38202b48","line":437,"range":{"start_line":437,"start_character":19,"end_line":437,"end_character":36},"updated":"2017-04-11 14:21:57.000000000","message":"nit: \"vpn_type \u003d\u003d IPVPN\" would be more natural to read","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                        (vpn_type, static_route)"},{"line_number":460,"context_line":"                        ] \u003d deepcopy(plug_details)"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _compile_local_port_plug_details(self, port_id, vpn_types\u003dVPN_TYPES,"},{"line_number":463,"context_line":"                                         services\u003dBAGPIPE_SERVICES):"},{"line_number":464,"context_line":"        port_info \u003d self.ports_info[port_id]"},{"line_number":465,"context_line":"        vpn_instance_id \u003d port_info.network.network_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_8bafd928","line":462,"range":{"start_line":462,"start_character":8,"end_line":462,"end_character":40},"updated":"2017-04-11 14:21:57.000000000","message":"If, as suggested elsewhere below, we avoid storing information specific to bagpipe-bgp API calls in network_info, and only keep RPC info, then this test will (I think) go away as well, then the outline of this function would become something like (partially  in pseudocode, incomplete, and in fact certainly partially wrong, but here to give you an idea of what I have in mind):\n\nservices \u003d union(port_info.service_info.keys(),\n                 port_info.service_info.keys())\n\nattach_info \u003d _get_common_plug_details(port_info)\n\nservice_attach_info \u003d {}\n\nfor service in services:\n    service_info \u003d copy(network_info.service_info[service])\n    service_info.update(port_info.service_info[service])\n\n    service_attach_info[service] \u003d self._\u003cservice\u003e_attach_info(service_info, port_info)\n    # retrieve the method to use with self.getattr(\u0027_%s_attach_info\u0027, service)\n    # see examples below for self._bgpvpn__attach_info and \n    # self._bagpipe__attach_info\n\n# merge base_info and attach info:\nfor vpn_type in VPN_TYPES:\n    for service in services:\n        attach_info[vpn_type].update(service_attach_info[service][vpn_type])\n    \n------\n\ndef _bgpvpn_attach_info(self, service_info, port_info)\n    attach_info \u003d {}\n    for (bgpvpn_type, rt_type) in product(service_info, [\u0027import_rt\u0027, \u0027export_rt\u0027]):\n        attach_info[BGPVPN_TYPES_MAP[bgpvpn_type]][rt_type] \u003d service_info[bgpvpn_type][rt_type]\n\n    if \u003c\u003cOVS... and there is an IPVPN attachement\u003e\u003e:\n       # add OVS VLAN info to attach_info\n       attach_info[IPVPN].update( ... )\n   \n       # add fallback information if needed as well\n       if port_info.net_info.gateway_mac:\n          attach_info[IPVPN].update( self.fallback_info(port_info.net_info.gateway_mac))\n\n    return attach_info\n\n-----\n\ndef _bagpipe_attach_info(self, service_info, port_info):    \n\n    attach_info[EVPN] \u003d service_info\n\n---------------\n\nOne thing that the above does not take into account is the things in _populate_vpntype_ipaddress2details that are done to support static routes and the possibility of pluging an evpn into an ipvpn.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                        (vpn_type, static_route)"},{"line_number":460,"context_line":"                        ] \u003d deepcopy(plug_details)"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _compile_local_port_plug_details(self, port_id, vpn_types\u003dVPN_TYPES,"},{"line_number":463,"context_line":"                                         services\u003dBAGPIPE_SERVICES):"},{"line_number":464,"context_line":"        port_info \u003d self.ports_info[port_id]"},{"line_number":465,"context_line":"        vpn_instance_id \u003d port_info.network.network_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_7e5458fe","line":462,"range":{"start_line":462,"start_character":17,"end_line":462,"end_character":22},"updated":"2017-04-11 14:21:57.000000000","message":"we can remove \u0027local\u0027 and \"vpn_types\u003dVPN_TYPES,                                       services\u003dBAGPIPE_SERVICES\" are useless parameters (no call results in using anything else than the default values)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":461,"context_line":""},{"line_number":462,"context_line":"    def _compile_local_port_plug_details(self, port_id, vpn_types\u003dVPN_TYPES,"},{"line_number":463,"context_line":"                                         services\u003dBAGPIPE_SERVICES):"},{"line_number":464,"context_line":"        port_info \u003d self.ports_info[port_id]"},{"line_number":465,"context_line":"        vpn_instance_id \u003d port_info.network.network_id"},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        all_plug_details \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_58d1af22","line":464,"range":{"start_line":464,"start_character":20,"end_line":464,"end_character":44},"updated":"2017-04-11 14:21:57.000000000","message":"add a self.getPortInfo(port_id) ?\n(same for network)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":462,"context_line":"    def _compile_local_port_plug_details(self, port_id, vpn_types\u003dVPN_TYPES,"},{"line_number":463,"context_line":"                                         services\u003dBAGPIPE_SERVICES):"},{"line_number":464,"context_line":"        port_info \u003d self.ports_info[port_id]"},{"line_number":465,"context_line":"        vpn_instance_id \u003d port_info.network.network_id"},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        all_plug_details \u003d {}"},{"line_number":468,"context_line":"        vpntype_ipaddress2details \u003d OrderedDict()"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_98a8578c","line":465,"range":{"start_line":465,"start_character":26,"end_line":465,"end_character":54},"updated":"2017-04-11 14:21:57.000000000","message":"Weren\u0027t we adding \"_ipvn\" to the network uuid to build the vpn_instance_id ?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":473,"context_line":"                             port_info.services_info]"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        for vpn_type, service_name, services_info in list("},{"line_number":476,"context_line":"                itertools.product(vpn_types, services, all_services_info)):"},{"line_number":477,"context_line":"            self._populate_vpntype_ipaddress2details(vpn_instance_id,"},{"line_number":478,"context_line":"                                                     vpn_type,"},{"line_number":479,"context_line":"                                                     service_name,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_5e02b470","line":476,"range":{"start_line":476,"start_character":45,"end_line":476,"end_character":53},"updated":"2017-04-11 14:21:57.000000000","message":"BAGPIPE_SERVICES","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":473,"context_line":"                             port_info.services_info]"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        for vpn_type, service_name, services_info in list("},{"line_number":476,"context_line":"                itertools.product(vpn_types, services, all_services_info)):"},{"line_number":477,"context_line":"            self._populate_vpntype_ipaddress2details(vpn_instance_id,"},{"line_number":478,"context_line":"                                                     vpn_type,"},{"line_number":479,"context_line":"                                                     service_name,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_9e0cbca5","line":476,"range":{"start_line":476,"start_character":34,"end_line":476,"end_character":43},"updated":"2017-04-11 14:21:57.000000000","message":"VPN_TYPES","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        LOG.debug(\u0027Local port %s details %s\u0027 % (port_id, all_plug_details))"},{"line_number":495,"context_line":"        return all_plug_details"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def request_ping(self):"},{"line_number":498,"context_line":"        \"\"\"Send ping request to bagpipe-bgp to get sequence number\"\"\""},{"line_number":499,"context_line":"        try:"},{"line_number":500,"context_line":"            response \u003d self.get(\u0027ping\u0027)"},{"line_number":501,"context_line":"            LOG.debug(\"bagpipe-bgp PING response received with \""},{"line_number":502,"context_line":"                      \"sequence number %s\" % response)"},{"line_number":503,"context_line":"            return response"},{"line_number":504,"context_line":"        except BaGPipeBGPException as e:"},{"line_number":505,"context_line":"            LOG.warning(str(e))"},{"line_number":506,"context_line":"            return -1"},{"line_number":507,"context_line":""},{"line_number":508,"context_line":"    def send_attach_local_port(self, local_port_details):"},{"line_number":509,"context_line":"        \"\"\"Send local port attach request to BaGPipe-BGP if running\"\"\""},{"line_number":510,"context_line":"        if self.bagpipe_bgp_status is self.BAGPIPEBGP_UP:"},{"line_number":511,"context_line":"            try:"},{"line_number":512,"context_line":"                self.post(\u0027attach_localport\u0027, local_port_details)"},{"line_number":513,"context_line":"                LOG.debug(\"Local port has been attached to bagpipe-bgp with \""},{"line_number":514,"context_line":"                          \"details %s\" % local_port_details)"},{"line_number":515,"context_line":"            except BaGPipeBGPException as e:"},{"line_number":516,"context_line":"                LOG.error(\"Can\u0027t attach local port on bagpipe-bgp: %s\", str(e))"},{"line_number":517,"context_line":"        else:"},{"line_number":518,"context_line":"            LOG.debug(\"Local port not yet attached to bagpipe-bgp (not up)\")"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"    def send_detach_local_port(self, local_port_details):"},{"line_number":521,"context_line":"        \"\"\"Send local port detach request to BaGPipe-BGP if running\"\"\""},{"line_number":522,"context_line":"        if self.bagpipe_bgp_status is self.BAGPIPEBGP_UP:"},{"line_number":523,"context_line":"            try:"},{"line_number":524,"context_line":"                self.post(\u0027detach_localport\u0027, local_port_details)"},{"line_number":525,"context_line":"                LOG.debug(\"Local port has been detached from bagpipe-bgp \""},{"line_number":526,"context_line":"                          \"with details %s\" % local_port_details)"},{"line_number":527,"context_line":"            except BaGPipeBGPException as e:"},{"line_number":528,"context_line":"                LOG.error(\"Can\u0027t detach local port from bagpipe-bgp: %s\","},{"line_number":529,"context_line":"                          str(e))"},{"line_number":530,"context_line":"                raise"},{"line_number":531,"context_line":"        else:"},{"line_number":532,"context_line":"            LOG.debug(\"Local port not yet detached from bagpipe-bgp (not up)\")"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"    def setup_mpls_br(self):"},{"line_number":535,"context_line":"        \u0027\u0027\u0027Setup the MPLS bridge for bagpipe-bgp."},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"        Creates MPLS bridge, and links it to the integration and tunnel"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_7ee7b8ad","line":534,"range":{"start_line":497,"start_character":0,"end_line":534,"end_character":28},"updated":"2017-04-11 14:21:57.000000000","message":"we could rename these methods to _...","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":692,"context_line":"                                 dl_src\u003dgateway_mac,"},{"line_number":693,"context_line":"                                 arp_sha\u003dgateway_mac)"},{"line_number":694,"context_line":""},{"line_number":695,"context_line":"    def _do_local_port_plug(self, port_id):"},{"line_number":696,"context_line":"        \"\"\"Send local port attach request to bagpipe-bgp.\"\"\""},{"line_number":697,"context_line":"        all_plug_details \u003d self._compile_local_port_plug_details(port_id)"},{"line_number":698,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_1b0c3e3f","line":695,"range":{"start_line":695,"start_character":12,"end_line":695,"end_character":17},"updated":"2017-04-11 14:21:57.000000000","message":"For readability, we will move these do_local_port_(un)plug methods to the top of the file, but let\u0027s do this in a subsequent change to keep a readable/useful diff\n\nAlso I think we can remove \u0027local\u0027 from the names.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":702,"context_line":"            for plug_detail in all_plug_details[vpn_type]:"},{"line_number":703,"context_line":"                self.send_attach_local_port(plug_detail)"},{"line_number":704,"context_line":""},{"line_number":705,"context_line":"    def _do_local_port_unplug(self, port_id, vpn_types\u003dNone, services\u003dNone):"},{"line_number":706,"context_line":"        \"\"\"Send local port detach request to bagpipe-bgp.\"\"\""},{"line_number":707,"context_line":"        vpn_types \u003d vpn_types if vpn_types else VPN_TYPES"},{"line_number":708,"context_line":"        services \u003d services if services else BAGPIPE_SERVICES"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_9e315c5d","line":705,"range":{"start_line":705,"start_character":43,"end_line":705,"end_character":74},"updated":"2017-04-11 14:21:57.000000000","message":"remove, no caller is specifying them","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":708,"context_line":"        services \u003d services if services else BAGPIPE_SERVICES"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"        all_unplug_details \u003d ("},{"line_number":711,"context_line":"            self._compile_local_port_plug_details(port_id,"},{"line_number":712,"context_line":"                                                  vpn_types\u003dvpn_types,"},{"line_number":713,"context_line":"                                                  services\u003dservices)"},{"line_number":714,"context_line":"        )"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"        # First unplug IP-VPNs because E-VPNs could be plugged into them"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_5e37544e","line":713,"range":{"start_line":711,"start_character":57,"end_line":713,"end_character":67},"updated":"2017-04-11 14:21:57.000000000","message":"remove/obsolete","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        # See if we need to update gateway redirection and gateway ARP"},{"line_number":725,"context_line":"        # voodoo"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"        vlan \u003d net_info.local_port[\u0027ovs\u0027][\u0027vlan\u0027]"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        # NOTE(tmorin): can be improved, only needed on first plug..."},{"line_number":730,"context_line":"        self._enable_gw_redirect(vlan, net_info.gateway_ip)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_1b755ecb","line":727,"range":{"start_line":727,"start_character":14,"end_line":727,"end_character":49},"updated":"2017-04-11 14:21:57.000000000","message":"I think we should use the vlanmanager here, so as to avoid storing this information in net_info.\n\nOr perhaps we can store the vlan in NetworkInfo, but then not in a similar way as the way it will later be passed to bagpipe-bgp (or this becomes confusing).","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        # if last port for this network, then cleanup gateway redirection"},{"line_number":746,"context_line":"        # NOTE(tmorin): shouldn\u0027t we check for last *ipvpn* attachment?"},{"line_number":747,"context_line":"        if len(net_info.ports) \u003d\u003d 1:"},{"line_number":748,"context_line":"            LOG.debug(\u0027last unplug, undoing voodoo ARP\u0027)"},{"line_number":749,"context_line":"            # NOTE(tmorin): vlan lookup might break if port is already"},{"line_number":750,"context_line":"            # unplugged from bridge ?"},{"line_number":751,"context_line":"            vlan \u003d net_info.local_port[\u0027ovs\u0027][\u0027vlan\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_bb61d2ab","line":748,"range":{"start_line":748,"start_character":22,"end_line":748,"end_character":23},"updated":"2017-04-11 14:21:57.000000000","message":"why change the quotes ?  :)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":755,"context_line":"        return"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"    def _initiate_network_info(self, net_id, service_port_info):"},{"line_number":758,"context_line":"        gateway_ip \u003d service_port_info.pop(\u0027gateway_ip\u0027)"},{"line_number":759,"context_line":"        if net_id not in self.networks_info:"},{"line_number":760,"context_line":"            net_info \u003d NetworkInfo(net_id, gateway_ip)"},{"line_number":761,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_68c49b40","line":758,"range":{"start_line":758,"start_character":0,"end_line":758,"end_character":56},"updated":"2017-04-11 14:21:57.000000000","message":"(cf other comments elsewhere:)\nI don\u0027t see a reason why gateway_ip is treated fundamentaly differently from gateway_mac.\nI think this method should be clean\u0026simple and simply allocate\u0026register a new NetworkInfo if none already exist.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":762,"context_line":"            net_info \u003d self.networks_info[net_id]"},{"line_number":763,"context_line":"        return net_info"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    def _initiate_port_info(self, port_id, service_port_info):"},{"line_number":766,"context_line":"        ip_address \u003d service_port_info.pop(\u0027ip_address\u0027)"},{"line_number":767,"context_line":"        mac_address \u003d service_port_info.pop(\u0027mac_address\u0027)"},{"line_number":768,"context_line":"        if port_id not in self.ports_info:"},{"line_number":769,"context_line":"            port_info \u003d PortInfo(port_id, ip_address, mac_address)"},{"line_number":770,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_28657346","line":767,"range":{"start_line":765,"start_character":43,"end_line":767,"end_character":58},"updated":"2017-04-11 14:21:57.000000000","message":"I think this should not be done here, because later we will want this information to come from the port dict in agent_ext.handle_port(..).\n\n(see comments below on _build_network_port_base_infos)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                self._unhide_real_gw_arp(vlan, net_info.gateway_mac)"},{"line_number":755,"context_line":"        return"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"    def _initiate_network_info(self, net_id, service_port_info):"},{"line_number":758,"context_line":"        gateway_ip \u003d service_port_info.pop(\u0027gateway_ip\u0027)"},{"line_number":759,"context_line":"        if net_id not in self.networks_info:"},{"line_number":760,"context_line":"            net_info \u003d NetworkInfo(net_id, gateway_ip)"},{"line_number":761,"context_line":"        else:"},{"line_number":762,"context_line":"            net_info \u003d self.networks_info[net_id]"},{"line_number":763,"context_line":"        return net_info"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    def _initiate_port_info(self, port_id, service_port_info):"},{"line_number":766,"context_line":"        ip_address \u003d service_port_info.pop(\u0027ip_address\u0027)"},{"line_number":767,"context_line":"        mac_address \u003d service_port_info.pop(\u0027mac_address\u0027)"},{"line_number":768,"context_line":"        if port_id not in self.ports_info:"},{"line_number":769,"context_line":"            port_info \u003d PortInfo(port_id, ip_address, mac_address)"},{"line_number":770,"context_line":"        else:"},{"line_number":771,"context_line":"            port_info \u003d self.ports_info[port_id]"},{"line_number":772,"context_line":"        return port_info"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    def _set_linuxbridge_localport_to_network_info(self, net_info, net_id):"},{"line_number":775,"context_line":"        if not net_info.linuxbr:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_1b20be47","line":772,"range":{"start_line":757,"start_character":0,"end_line":772,"end_character":24},"updated":"2017-04-11 14:21:57.000000000","message":"these methods should be moved at the top of the class","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            port_info \u003d self.ports_info[port_id]"},{"line_number":772,"context_line":"        return port_info"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    def _set_linuxbridge_localport_to_network_info(self, net_info, net_id):"},{"line_number":775,"context_line":"        if not net_info.linuxbr:"},{"line_number":776,"context_line":"            net_info.linuxbr \u003d LinuxBridgeManager.get_bridge_name(net_id)"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"    def _set_linuxbridge_localport_to_port_info(self, port_info, port_id):"},{"line_number":779,"context_line":"        if not port_info.local_port:"},{"line_number":780,"context_line":"            port_info.local_port[\u0027linuxif\u0027] \u003d ("},{"line_number":781,"context_line":"                LinuxBridgeManager.get_tap_device_name(port_id)"},{"line_number":782,"context_line":"            )"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"    def _set_ovs_localport_to_network_info(self, net_info, port_id):"},{"line_number":785,"context_line":"        if not net_info.local_port:"},{"line_number":786,"context_line":"            vlan \u003d self.vlan_manager.get(net_info.network_id).vlan"},{"line_number":787,"context_line":"            net_info.local_port \u003d {"},{"line_number":788,"context_line":"                \u0027ovs\u0027: {"},{"line_number":789,"context_line":"                    \u0027plugged\u0027: True,"},{"line_number":790,"context_line":"                    \u0027port_number\u0027: self.patch_mpls_from_tun_ofport,"},{"line_number":791,"context_line":"                    \u0027to_vm_port_number\u0027: self.patch_mpls_to_tun_ofport,"},{"line_number":792,"context_line":"                    \u0027vlan\u0027: vlan"},{"line_number":793,"context_line":"                }"},{"line_number":794,"context_line":"            }"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"    def _set_ovs_localport_to_port_info(self, net_id, port_info, port_id):"},{"line_number":797,"context_line":"        if not port_info.local_port:"},{"line_number":798,"context_line":"            vlan \u003d self.vlan_manager.get(net_id).vlan"},{"line_number":799,"context_line":"            port_info.local_port[\u0027linuxif\u0027] \u003d \u0027%s:%s\u0027 % (LINUXIF_PREFIX, vlan)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _build_network_port_base_infos(self, net_id, port_id, service_info):"},{"line_number":802,"context_line":"        net_info \u003d self._initiate_network_info(net_id, service_info)"},{"line_number":803,"context_line":"        port_info \u003d self._initiate_port_info(port_id, service_info)"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        if self.agent_type \u003d\u003d n_const.AGENT_TYPE_LINUXBRIDGE:"},{"line_number":806,"context_line":"            self._set_linuxbridge_localport_to_network_info(net_info, net_id)"},{"line_number":807,"context_line":"            self._set_linuxbridge_localport_to_port_info(port_info, port_id)"},{"line_number":808,"context_line":"        elif self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":809,"context_line":"            self._set_ovs_localport_to_network_info(net_info, port_id)"},{"line_number":810,"context_line":"            self._set_ovs_localport_to_port_info(net_id, port_info, port_id)"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        return (net_info, port_info)"},{"line_number":813,"context_line":""},{"line_number":814,"context_line":"    def _set_gw_mac_to_network_info(self, net_info, gateway_mac):"},{"line_number":815,"context_line":"        if gateway_mac:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_be32e00e","line":812,"range":{"start_line":774,"start_character":0,"end_line":812,"end_character":36},"updated":"2017-04-11 14:21:57.000000000","message":"As said in another comment, I don\u0027t think we should store anything related to bagpipe-bgp API into net_info or port_info: all this should only happen at the compile_local_port_plug step.\n\n(Also, I don\u0027t find it nice to split things into this many sub-methods called only from one place. It makes the code more complicated to understand, because the reader needs to identify where the thing is called from and tries to guess which architectural role it plays)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        return (net_info, port_info)"},{"line_number":813,"context_line":""},{"line_number":814,"context_line":"    def _set_gw_mac_to_network_info(self, net_info, gateway_mac):"},{"line_number":815,"context_line":"        if gateway_mac:"},{"line_number":816,"context_line":"            net_info.gateway_mac \u003d gateway_mac"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def _add_service_info_to_network_info(self, net_info, service_name,"},{"line_number":819,"context_line":"                                          service_info):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_0cfae3bb","line":816,"range":{"start_line":814,"start_character":0,"end_line":816,"end_character":46},"updated":"2017-04-11 14:21:57.000000000","message":"This should be moved in a setGatewayMac method of NetworkInfo.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":815,"context_line":"        if gateway_mac:"},{"line_number":816,"context_line":"            net_info.gateway_mac \u003d gateway_mac"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def _add_service_info_to_network_info(self, net_info, service_name,"},{"line_number":819,"context_line":"                                          service_info):"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        if not service_info:"},{"line_number":822,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_bbc8b221","line":819,"range":{"start_line":818,"start_character":0,"end_line":819,"end_character":56},"updated":"2017-04-11 14:21:57.000000000","message":"If the role of this method is essentially to modify net_info, then it should be, I think, a method of the NetworkInfo class.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":827,"context_line":"            orig_info \u003d net_info.services_info[service_name]"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"            for vpn_type in VPN_TYPES:"},{"line_number":830,"context_line":"                if vpn_type in service_info:"},{"line_number":831,"context_line":"                    if vpn_type not in orig_info:"},{"line_number":832,"context_line":"                        orig_info.update({vpn_type: service_info[vpn_type]})"},{"line_number":833,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_1e3f8cb4","line":830,"range":{"start_line":830,"start_character":19,"end_line":830,"end_character":43},"updated":"2017-04-11 14:21:57.000000000","message":"I think there is something wrong here: my understanding is that the service info added by each service to network info would simply be info coming from RPCs.  Here we are starting to translate this RPC information into bagpipe-bgp API constructs.  I think that this should be delayed to the compile_local_port_plug_details step.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        else:"},{"line_number":827,"context_line":"            orig_info \u003d net_info.services_info[service_name]"},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"            for vpn_type in VPN_TYPES:"},{"line_number":830,"context_line":"                if vpn_type in service_info:"},{"line_number":831,"context_line":"                    if vpn_type not in orig_info:"},{"line_number":832,"context_line":"                        orig_info.update({vpn_type: service_info[vpn_type]})"},{"line_number":833,"context_line":"                    else:"},{"line_number":834,"context_line":"                        for rt_type in [\u0027import_rt\u0027, \u0027export_rt\u0027]:"},{"line_number":835,"context_line":"                            if rt_type in service_info[vpn_type]:"},{"line_number":836,"context_line":"                                orig_info[vpn_type][rt_type] +\u003d list("},{"line_number":837,"context_line":"                                    set(service_info[vpn_type][rt_type]) -"},{"line_number":838,"context_line":"                                    set(orig_info[vpn_type][rt_type]))"},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"            net_info.services_info[service_name] \u003d orig_info"},{"line_number":841,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_8cbdd3d9","line":838,"range":{"start_line":829,"start_character":0,"end_line":838,"end_character":70},"updated":"2017-04-11 14:21:57.000000000","message":"Recomputing the list of RT at each addition/removal of a service leads to this complicated set manipulation.  If we move this RT set computation step to the compile_local_port_plug_details step, then things will be much easier because we will have the whole list of active service and we simply compute the list of RTs from zero, so we won\u0027t have to compare before/after to see what needs to be added/removed.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":863,"context_line":""},{"line_number":864,"context_line":"            return (not orig_info, orig_info)"},{"line_number":865,"context_line":""},{"line_number":866,"context_line":"    def _register_network_and_port_info(self, net_info, port_info):"},{"line_number":867,"context_line":"        if port_info not in net_info.ports:"},{"line_number":868,"context_line":"            net_info.ports.append(port_info)"},{"line_number":869,"context_line":"        self.networks_info[net_info.network_id] \u003d net_info"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_88afdf28","line":866,"range":{"start_line":866,"start_character":8,"end_line":866,"end_character":39},"updated":"2017-04-11 14:21:57.000000000","message":"I think this method should perhaps not be needed, if we consider that services should first call _initiate_(network|port)_info and then get an object (that is already registered) which then can update.  Registering the object again later does not seem required.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":866,"context_line":"    def _register_network_and_port_info(self, net_info, port_info):"},{"line_number":867,"context_line":"        if port_info not in net_info.ports:"},{"line_number":868,"context_line":"            net_info.ports.append(port_info)"},{"line_number":869,"context_line":"        self.networks_info[net_info.network_id] \u003d net_info"},{"line_number":870,"context_line":"        port_info.network \u003d net_info"},{"line_number":871,"context_line":"        self.ports_info[port_info.port_id] \u003d port_info"},{"line_number":872,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_3ba4a2a5","line":869,"range":{"start_line":869,"start_character":26,"end_line":869,"end_character":47},"updated":"2017-04-11 14:21:57.000000000","message":"what if the network is not yet in self.network_info ?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":863,"context_line":""},{"line_number":864,"context_line":"            return (not orig_info, orig_info)"},{"line_number":865,"context_line":""},{"line_number":866,"context_line":"    def _register_network_and_port_info(self, net_info, port_info):"},{"line_number":867,"context_line":"        if port_info not in net_info.ports:"},{"line_number":868,"context_line":"            net_info.ports.append(port_info)"},{"line_number":869,"context_line":"        self.networks_info[net_info.network_id] \u003d net_info"},{"line_number":870,"context_line":"        port_info.network \u003d net_info"},{"line_number":871,"context_line":"        self.ports_info[port_info.port_id] \u003d port_info"},{"line_number":872,"context_line":""},{"line_number":873,"context_line":"    def _unregister_network_and_port_info(self, net_id, port_id):"},{"line_number":874,"context_line":"        port_info \u003d self.ports_info[port_id]"},{"line_number":875,"context_line":"        net_info \u003d self.networks_info[net_id]"},{"line_number":876,"context_line":"        net_info.ports.remove(port_info)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_fbd75aed","line":873,"range":{"start_line":866,"start_character":0,"end_line":873,"end_character":65},"updated":"2017-04-11 14:21:57.000000000","message":"Have you checked if these methods needs to be protected by a lock ?\n\nBtw, these two methods should be moved at the top of the class.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        net_info \u003d self.networks_info[net_id]"},{"line_number":876,"context_line":"        net_info.ports.remove(port_info)"},{"line_number":877,"context_line":"        del self.ports_info[port_id]"},{"line_number":878,"context_line":"        if not net_info.ports:"},{"line_number":879,"context_line":"            del self.networks_info[net_id]"},{"line_number":880,"context_line":""},{"line_number":881,"context_line":"    @log_helpers.log_method_call"},{"line_number":882,"context_line":"    @lockutils.synchronized(\u0027bagpipe-bgp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_fe47484b","line":879,"range":{"start_line":878,"start_character":0,"end_line":879,"end_character":42},"updated":"2017-04-11 14:21:57.000000000","message":"Have you checked whether we can do this ?\n(make sure we don\u0027t lose gateway_ip information in networks_info that comes from RPCs which we would lose by deleting the entry ??)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":879,"context_line":"            del self.networks_info[net_id]"},{"line_number":880,"context_line":""},{"line_number":881,"context_line":"    @log_helpers.log_method_call"},{"line_number":882,"context_line":"    @lockutils.synchronized(\u0027bagpipe-bgp-agent\u0027)"},{"line_number":883,"context_line":"    def bagpipe_port_attach(self, context, port_bagpipe_info):"},{"line_number":884,"context_line":"        port_id \u003d port_bagpipe_info.pop(\u0027id\u0027)"},{"line_number":885,"context_line":"        net_id \u003d port_bagpipe_info.pop(\u0027network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_5b8526ce","line":882,"range":{"start_line":882,"start_character":4,"end_line":882,"end_character":48},"updated":"2017-04-11 14:21:57.000000000","message":"Perhaps we need to discuss what needs to be synchronized...","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":884,"context_line":"        port_id \u003d port_bagpipe_info.pop(\u0027id\u0027)"},{"line_number":885,"context_line":"        net_id \u003d port_bagpipe_info.pop(\u0027network_id\u0027)"},{"line_number":886,"context_line":""},{"line_number":887,"context_line":"        net_info, port_info \u003d ("},{"line_number":888,"context_line":"            self._build_network_port_base_infos(net_id,"},{"line_number":889,"context_line":"                                                port_id,"},{"line_number":890,"context_line":"                                                port_bagpipe_info)"},{"line_number":891,"context_line":"        )"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        self._add_service_info_to_network_info(net_info,"},{"line_number":894,"context_line":"                                               BAGPIPE_L2_SERVICE,"},{"line_number":895,"context_line":"                                               port_bagpipe_info)"},{"line_number":896,"context_line":""},{"line_number":897,"context_line":"        self._register_network_and_port_info(net_info, port_info)"},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"        self._do_local_port_plug(port_id)"},{"line_number":900,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_2b020d0b","line":897,"range":{"start_line":887,"start_character":0,"end_line":897,"end_character":65},"updated":"2017-04-11 14:21:57.000000000","message":"Based on my comment above, this would I think become:\n\n net_info \u003d self._initiate_network_info(net_id)\n port_info \u003d self._initiate_network_info(port_id)\n net_info.add_port(port_id)\n\n(these three call can be wrapped in a method, because it will I think be used also in bgpvpn)\n\nthen:\n\n port_info.ip_address \u003d port_bagpipe_info.pop(...)\n port_info.mac_address \u003d port_bagpipe_info.pop(...)\n net_info.gateway_ip \u003d port_bagpipe_info.pop(...)\n\n(again, these three calls can be wrapped in a method, because it will I think be used also in bgpvpn, but we should I think do this in another method than the one suggested right before in this comments, because later this information will come from agent_extension.handle_port())\n\nthen:\n\n net_info._add_service_info(BAGPIPE_L2_SERVICE,\n                            port_bagpipe_info[\u0027evpn\u0027])\n\n\n(for this last line, see also the pseudo code proposal for compile local port plug, _bagpipe_attach_info)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":936,"context_line":"        net_id \u003d bgpvpn.pop(\u0027network_id\u0027)"},{"line_number":937,"context_line":"        gateway_mac \u003d bgpvpn.pop(\u0027gateway_mac\u0027, None)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"        for bgpvpn_type in BGPVPN_TYPES:"},{"line_number":940,"context_line":"            if bgpvpn_type in bgpvpn:"},{"line_number":941,"context_line":"                bgpvpn[BGPVPN_TYPES_MAP[bgpvpn_type]] \u003d ("},{"line_number":942,"context_line":"                    bgpvpn.pop(bgpvpn_type)"},{"line_number":943,"context_line":"                )"},{"line_number":944,"context_line":""},{"line_number":945,"context_line":"        if net_id in self.networks_info:"},{"line_number":946,"context_line":"            net_info \u003d self.networks_info[net_id]"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_e8078b17","line":943,"range":{"start_line":939,"start_character":0,"end_line":943,"end_character":17},"updated":"2017-04-11 14:21:57.000000000","message":"in the same line as what is discussed above, this \"type translation\" should rather be part of the compile_local_port_plug step","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":945,"context_line":"        if net_id in self.networks_info:"},{"line_number":946,"context_line":"            net_info \u003d self.networks_info[net_id]"},{"line_number":947,"context_line":""},{"line_number":948,"context_line":"            if self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":949,"context_line":"                if has_ipvpn_attachement(bgpvpn):"},{"line_number":950,"context_line":"                    self._check_arp_voodoo_plug(net_info, gateway_mac)"},{"line_number":951,"context_line":""},{"line_number":952,"context_line":"            self._set_gw_mac_to_network_info(net_info, gateway_mac)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_2e535e41","line":949,"range":{"start_line":948,"start_character":0,"end_line":949,"end_character":49},"updated":"2017-04-11 14:21:57.000000000","message":"Move these checks into check_arp_voodo ?","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":973,"context_line":"                    net_id, BGPVPN_SERVICE, bgpvpn)"},{"line_number":974,"context_line":"            )"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"            if self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":977,"context_line":"                if (last_service or not has_ipvpn_attachement(updated_info)):"},{"line_number":978,"context_line":"                    self._check_arp_voodoo_unplug(net_id)"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"            if last_service:"},{"line_number":981,"context_line":"                for port_info in net_info.ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_2c800746","line":978,"range":{"start_line":976,"start_character":0,"end_line":978,"end_character":57},"updated":"2017-04-11 14:21:57.000000000","message":"Something to check/discuss: this is to do on the last BGPVPN dissassociate, not on last service, I think.","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":977,"context_line":"                if (last_service or not has_ipvpn_attachement(updated_info)):"},{"line_number":978,"context_line":"                    self._check_arp_voodoo_unplug(net_id)"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"            if last_service:"},{"line_number":981,"context_line":"                for port_info in net_info.ports:"},{"line_number":982,"context_line":"                    self._do_local_port_unplug(port_info.port_id)"},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"                del(net_info.services_info[BGPVPN_SERVICE])"},{"line_number":985,"context_line":"            else:"},{"line_number":986,"context_line":"                net_info.services_info[BGPVPN_SERVICE] \u003d updated_info"},{"line_number":987,"context_line":""},{"line_number":988,"context_line":"                for port_info in net_info.ports:"},{"line_number":989,"context_line":"                    self._do_local_port_plug(port_info.port_id)"},{"line_number":990,"context_line":""},{"line_number":991,"context_line":"    @log_helpers.log_method_call"},{"line_number":992,"context_line":"    @lockutils.synchronized(\u0027bagpipe-bgp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_4cc90baa","line":989,"range":{"start_line":980,"start_character":0,"end_line":989,"end_character":63},"updated":"2017-04-11 14:21:57.000000000","message":"This should, I think, be moved out of BGPVPN code in a method\nthat can be called e.g. on a bagpipe detach.\n\nOr we can leave this aside, since the target is to do this on a ext.delete_port ...","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":995,"context_line":"        net_id \u003d port_bgpvpn_info.pop(\u0027network_id\u0027)"},{"line_number":996,"context_line":"        gateway_mac \u003d port_bgpvpn_info.pop(\u0027gateway_mac\u0027, None)"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"        # Map l2vpn, l3vpn keys to evpn, ipvpn ones"},{"line_number":999,"context_line":"        for bgpvpn_type in BGPVPN_TYPES:"},{"line_number":1000,"context_line":"            if bgpvpn_type in port_bgpvpn_info:"},{"line_number":1001,"context_line":"                port_bgpvpn_info[BGPVPN_TYPES_MAP[bgpvpn_type]] \u003d ("},{"line_number":1002,"context_line":"                    port_bgpvpn_info.pop(bgpvpn_type)"},{"line_number":1003,"context_line":"                )"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        net_info, port_info \u003d ("},{"line_number":1006,"context_line":"            self._build_network_port_base_infos(net_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_a8150342","line":1003,"range":{"start_line":998,"start_character":0,"end_line":1003,"end_character":17},"updated":"2017-04-11 14:21:57.000000000","message":"in the same line as what is discussed above, this \"type translation\" should rather be part of the compile_local_port_plug step","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"            if IPVPN in port_bgpvpn_info:"},{"line_number":1013,"context_line":"                self._check_arp_voodoo_plug(net_info, gateway_mac)"},{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"        self._set_gw_mac_to_network_info(net_info, gateway_mac)"},{"line_number":1016,"context_line":""},{"line_number":1017,"context_line":"        self._add_service_info_to_network_info(net_info,"},{"line_number":1018,"context_line":"                                               BGPVPN_SERVICE,"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_68c81b73","line":1015,"range":{"start_line":1015,"start_character":0,"end_line":1015,"end_character":63},"updated":"2017-04-11 14:21:57.000000000","message":"I would expect gateway_ip to be stored in network_info here at the same time, why not ?\n\nI don\u0027t think it makes sense to have gateway_ip stored in net_info via _build_network_port_base_infos/_initiate_network_info .","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b33deb2779590b3da3319d47edd105fa7e0082d4","unresolved":false,"context_lines":[{"line_number":1043,"context_line":"            finally:"},{"line_number":1044,"context_line":"                self._unregister_network_and_port_info(net_id, port_id)"},{"line_number":1045,"context_line":"        else:"},{"line_number":1046,"context_line":"            LOG.warning(\u0027bagpipe-bgp agent inconsistent for BGPVPN or updated \u0027"},{"line_number":1047,"context_line":"                        \u0027with another detach\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bff0334d_ee3d76dd","line":1047,"range":{"start_line":1046,"start_character":24,"end_line":1047,"end_character":46},"updated":"2017-04-11 14:21:57.000000000","message":"(unclear)","commit_id":"8b426d7b6840f9a23f84ed1f4ccd3d0e48fbf787"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":71,"context_line":"BAGPIPE_L2_SERVICE \u003d \u0027bagpipe_l2\u0027"},{"line_number":72,"context_line":"BGPVPN_SERVICE \u003d \u0027bgpvpn\u0027"},{"line_number":73,"context_line":"BAGPIPE_SERVICES \u003d [BAGPIPE_L2_SERVICE, BGPVPN_SERVICE]"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"EVPN \u003d \u0027evpn\u0027"},{"line_number":76,"context_line":"IPVPN \u003d \u0027ipvpn\u0027"},{"line_number":77,"context_line":"VPN_TYPES \u003d [EVPN, IPVPN]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_826813b9","line":74,"updated":"2017-05-10 14:33:35.000000000","message":"add a comment:\n\n# bagpipe-bgp VPN types","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":75,"context_line":"EVPN \u003d \u0027evpn\u0027"},{"line_number":76,"context_line":"IPVPN \u003d \u0027ipvpn\u0027"},{"line_number":77,"context_line":"VPN_TYPES \u003d [EVPN, IPVPN]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"BGPVPN_L2 \u003d \u0027l2vpn\u0027"},{"line_number":80,"context_line":"BGPVPN_L3 \u003d \u0027l3vpn\u0027"},{"line_number":81,"context_line":"BGPVPN_TYPES \u003d [BGPVPN_L2, BGPVPN_L3]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_425e8b12","line":78,"updated":"2017-05-10 14:33:35.000000000","message":"# BGPVPN service VPN types","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":79,"context_line":"BGPVPN_L2 \u003d \u0027l2vpn\u0027"},{"line_number":80,"context_line":"BGPVPN_L3 \u003d \u0027l3vpn\u0027"},{"line_number":81,"context_line":"BGPVPN_TYPES \u003d [BGPVPN_L2, BGPVPN_L3]"},{"line_number":82,"context_line":"BGPVPN_TYPES_MAP \u003d {BGPVPN_L2: EVPN, BGPVPN_L3: IPVPN}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"RT_IMPORT \u003d \u0027import_rt\u0027"},{"line_number":85,"context_line":"RT_EXPORT \u003d \u0027export_rt\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_02a2c3fd","line":82,"updated":"2017-05-10 14:33:35.000000000","message":"# map from BGPVPN service VPN types to bagpipe-bgp VPN types:","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def __init__(self, id):"},{"line_number":209,"context_line":"        self.id \u003d id"},{"line_number":210,"context_line":"        self.services_info \u003d dict()"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def add_service_info(self, service_name, service_info):"},{"line_number":213,"context_line":"        if not service_info:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_c7ce2db3","line":210,"range":{"start_line":210,"start_character":13,"end_line":210,"end_character":26},"updated":"2017-05-10 14:33:35.000000000","message":"service_infos would sound better (several service_info entries), no ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        if service_info !\u003d self.services_info.get(service_name, {}):"},{"line_number":217,"context_line":"            self.services_info[service_name] \u003d service_info"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def is_last_info_for_service(self, service_name, service_info):"},{"line_number":220,"context_line":"        if service_name not in self.services_info:"},{"line_number":221,"context_line":"            return"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_62198720","line":219,"range":{"start_line":219,"start_character":7,"end_line":219,"end_character":40},"updated":"2017-05-10 14:33:35.000000000","message":"after reading all the code, I think this logic does not belong here and should be only in delete_bgpvpn","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        orig_info \u003d deepcopy(self.services_info[service_name])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        for vpn_type in VPN_TYPES + BGPVPN_TYPES:"},{"line_number":226,"context_line":"            if vpn_type in service_info:"},{"line_number":227,"context_line":"                if vpn_type in orig_info:"},{"line_number":228,"context_line":"                    for rt_type in [\u0027import_rt\u0027, \u0027export_rt\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_876825b9","line":225,"range":{"start_line":225,"start_character":23,"end_line":225,"end_character":48},"updated":"2017-05-10 14:33:35.000000000","message":"That looks surprising: why do we end up mixing RPC/Service types and bagpipe-bgp types ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for vpn_type in VPN_TYPES + BGPVPN_TYPES:"},{"line_number":226,"context_line":"            if vpn_type in service_info:"},{"line_number":227,"context_line":"                if vpn_type in orig_info:"},{"line_number":228,"context_line":"                    for rt_type in [\u0027import_rt\u0027, \u0027export_rt\u0027]:"},{"line_number":229,"context_line":"                        if rt_type in service_info[vpn_type]:"},{"line_number":230,"context_line":"                            orig_info[vpn_type][rt_type] \u003d list("},{"line_number":231,"context_line":"                                set(orig_info[vpn_type][rt_type]) -"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_274f116c","line":228,"range":{"start_line":228,"start_character":36,"end_line":228,"end_character":59},"updated":"2017-05-10 14:33:35.000000000","message":"use the constants, now that they are defined ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        return (not orig_info, orig_info)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"class PortInfo(BaseServiceInfo):"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def __init__(self, port_id):"},{"line_number":246,"context_line":"        super(PortInfo, self).__init__(port_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_67e2b9a2","line":243,"range":{"start_line":243,"start_character":6,"end_line":243,"end_character":14},"updated":"2017-05-10 14:33:35.000000000","message":"I think it would be better to have setter methods for ip_address and mac_address, so that service-specific code does not manipulate them independently","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.local_port \u003d dict(linuxif\u003dlinuxif)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def set_network(self, network_id):"},{"line_number":257,"context_line":"        if not self.network:"},{"line_number":258,"context_line":"            self.network \u003d network_id"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"class NetworkInfo(BaseServiceInfo):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_676bd984","line":258,"range":{"start_line":257,"start_character":0,"end_line":258,"end_character":37},"updated":"2017-05-10 14:33:35.000000000","message":"silently failing on a second call sounds risky: at least generate a warning no ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.gateway_ip \u003d None"},{"line_number":267,"context_line":"        self.gateway_mac \u003d None"},{"line_number":268,"context_line":"        self.ports \u003d list()"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def set_gateway_mac(self, gateway_mac):"},{"line_number":271,"context_line":"        self.gateway_mac \u003d gateway_mac"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_e2da3749","line":268,"range":{"start_line":268,"start_character":21,"end_line":268,"end_character":27},"updated":"2017-05-10 14:33:35.000000000","message":"make it a set() ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self.gateway_mac \u003d None"},{"line_number":268,"context_line":"        self.ports \u003d list()"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def set_gateway_mac(self, gateway_mac):"},{"line_number":271,"context_line":"        self.gateway_mac \u003d gateway_mac"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def add_port(self, port_info):"},{"line_number":274,"context_line":"        if port_info not in self.ports:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_070c15eb","line":271,"range":{"start_line":270,"start_character":0,"end_line":271,"end_character":38},"updated":"2017-05-10 14:33:35.000000000","message":"why a setter for gateway mac and not for gateway_ip ?\ndo we need a setter ?\n\nI think we should have a setter for both.","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":270,"context_line":"    def set_gateway_mac(self, gateway_mac):"},{"line_number":271,"context_line":"        self.gateway_mac \u003d gateway_mac"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def add_port(self, port_info):"},{"line_number":274,"context_line":"        if port_info not in self.ports:"},{"line_number":275,"context_line":"            self.ports.append(port_info)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def remove_port(self, port_info):"},{"line_number":278,"context_line":"        if port_info in self.ports:"},{"line_number":279,"context_line":"            self.ports.remove(port_info)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"class BaGPipeBGPAgent(HTTPClientBase,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_670079ac","line":279,"range":{"start_line":273,"start_character":0,"end_line":279,"end_character":40},"updated":"2017-05-10 14:33:35.000000000","message":"(as above: silently failing on a second call seems risky)","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":270,"context_line":"    def set_gateway_mac(self, gateway_mac):"},{"line_number":271,"context_line":"        self.gateway_mac \u003d gateway_mac"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def add_port(self, port_info):"},{"line_number":274,"context_line":"        if port_info not in self.ports:"},{"line_number":275,"context_line":"            self.ports.append(port_info)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def remove_port(self, port_info):"},{"line_number":278,"context_line":"        if port_info in self.ports:"},{"line_number":279,"context_line":"            self.ports.remove(port_info)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"class BaGPipeBGPAgent(HTTPClientBase,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_82e5b30b","line":279,"range":{"start_line":273,"start_character":0,"end_line":279,"end_character":40},"updated":"2017-05-10 14:33:35.000000000","message":"you can remove these methods if you use a set","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"5729558546ec0356b820b2801ce0cd3ac318a494","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        If a restart is detected, re-send all registered attachments to"},{"line_number":358,"context_line":"        bagpipe-bgp."},{"line_number":359,"context_line":"        \"\"\""},{"line_number":360,"context_line":"        new_seq_num \u003d self.request_ping()"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        # Check bagpipe-bgp restart"},{"line_number":363,"context_line":"        if new_seq_num !\u003d self.seq_num:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_13544cfe","line":360,"range":{"start_line":360,"start_character":27,"end_line":360,"end_character":41},"updated":"2017-05-10 22:08:53.000000000","message":"should be _request_ping\n\n(see failing tempest test)","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        status_loop.start(interval\u003dping_interval,"},{"line_number":390,"context_line":"                          initial_delay\u003dping_interval)  # TM: why not zero ?"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _get_network_info(self, net_id):"},{"line_number":393,"context_line":"        return self.networks_info.get(net_id)"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def _get_port_info(self, port_id):"},{"line_number":396,"context_line":"        return self.ports_info.get(port_id)"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def _initiate_network_info(self, net_id):"},{"line_number":399,"context_line":"        if not self._get_network_info(net_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_27a391b4","line":396,"range":{"start_line":392,"start_character":1,"end_line":396,"end_character":43},"updated":"2017-05-10 14:33:35.000000000","message":"are these methods really needed, the code isn\u0027t really shorted in the end, right ?","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    def _get_port_info(self, port_id):"},{"line_number":396,"context_line":"        return self.ports_info.get(port_id)"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def _initiate_network_info(self, net_id):"},{"line_number":399,"context_line":"        if not self._get_network_info(net_id):"},{"line_number":400,"context_line":"            self.networks_info[net_id] \u003d NetworkInfo(net_id)"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        return self._get_network_info(net_id)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def _initiate_port_info(self, port_id):"},{"line_number":405,"context_line":"        if not self._get_port_info(port_id):"},{"line_number":406,"context_line":"            self.ports_info[port_id] \u003d PortInfo(port_id)"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"        return self._get_port_info(port_id)"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    def _get_network_port_infos(self, net_id, port_id):"},{"line_number":411,"context_line":"        net_info \u003d self._initiate_network_info(net_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_e78009c2","line":408,"range":{"start_line":398,"start_character":0,"end_line":408,"end_character":43},"updated":"2017-05-10 14:33:35.000000000","message":"these methods are only used once, I think it is better to wrap the content in _get_network_... meethods below","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        return net_info, port_info"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _set_network_port_base_infos(self, net_info, port_info,"},{"line_number":419,"context_line":"                                     port_service_info):"},{"line_number":420,"context_line":"        port_info.ip_address \u003d port_service_info.pop(\u0027ip_address\u0027)"},{"line_number":421,"context_line":"        port_info.mac_address \u003d port_service_info.pop(\u0027mac_address\u0027)"},{"line_number":422,"context_line":"        net_info.gateway_ip \u003d port_service_info.pop(\u0027gateway_ip\u0027)"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    def _remove_network_port_infos(self, net_id, port_id):"},{"line_number":425,"context_line":"        port_info \u003d self._get_port_info(port_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_a72681cd","line":422,"range":{"start_line":418,"start_character":0,"end_line":422,"end_character":65},"updated":"2017-05-10 14:33:35.000000000","message":"I think this should be removed and replaced by the use of setters methods in service-specific RPC code.","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":839,"context_line":"        for bgpvpn_type, rt_type in list("},{"line_number":840,"context_line":"                itertools.product(BGPVPN_TYPES, RT_TYPES)):"},{"line_number":841,"context_line":"            if rt_type in service_info.get(bgpvpn_type, {}):"},{"line_number":842,"context_line":"                if BGPVPN_TYPES_MAP[bgpvpn_type] not in attach_info:"},{"line_number":843,"context_line":"                    attach_info[BGPVPN_TYPES_MAP[bgpvpn_type]] \u003d defaultdict(list)"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"                attach_info[BGPVPN_TYPES_MAP[bgpvpn_type]][rt_type] +\u003d ("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_a26b0fb5","line":842,"range":{"start_line":842,"start_character":19,"end_line":842,"end_character":48},"updated":"2017-05-10 14:33:35.000000000","message":"I would suggest:\n\n   bagpipe_bpg_vpn_type \u003d BGPVPN_TYPES_MAP[bgpvpn_type]\n\nand then reuse.\n\nThis helps understand that what we read from BGPVPN_TYPES_MAP are bagpipe-bgp VPN types.","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        return attach_info"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"    def ovs_restarted_bgpvpn(self):"},{"line_number":885,"context_line":"        for net_id, net_info in self.networks_info.items():"},{"line_number":886,"context_line":"            if net_info.ports and net_info.gateway_mac is not None:"},{"line_number":887,"context_line":"                bgpvpn_info \u003d net_info.services_info.get(BGPVPN_SERVICE)"},{"line_number":888,"context_line":"                if has_attachement(bgpvpn_info, BGPVPN_L3):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_42ba0b0a","line":885,"range":{"start_line":885,"start_character":8,"end_line":885,"end_character":59},"updated":"2017-05-10 14:33:35.000000000","message":"for net_info in self.networks_info.values():","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":909,"context_line":"        net_info.set_gateway_mac(gateway_mac)"},{"line_number":910,"context_line":""},{"line_number":911,"context_line":"        net_info.add_service_info(BGPVPN_SERVICE, bgpvpn)"},{"line_number":912,"context_line":""},{"line_number":913,"context_line":"        for port_info in net_info.ports:"},{"line_number":914,"context_line":"            self._do_port_plug(port_info.id)"},{"line_number":915,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_8272537a","line":912,"updated":"2017-05-10 14:33:35.000000000","message":"I haven\u0027t checked, but I wonder if in all cases we end up calling check_arp_voodo, or if perhaps there are cases where that would be skipped (e.g. if RTs did not change, or...).\n\nIt\u0027s probably ok, but I want to be sure.","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":925,"context_line":""},{"line_number":926,"context_line":"        # Check if remaining BGPVPN informations, otherwise unplug"},{"line_number":927,"context_line":"        # port from bagpipe-bgp"},{"line_number":928,"context_line":"        last_bgpvpn, updated_info \u003d ("},{"line_number":929,"context_line":"            net_info.is_last_info_for_service(BGPVPN_SERVICE, bgpvpn)"},{"line_number":930,"context_line":"        )"},{"line_number":931,"context_line":""},{"line_number":932,"context_line":"        if self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":933,"context_line":"            if (last_bgpvpn or"},{"line_number":934,"context_line":"                    not has_attachement(updated_info, BGPVPN_L3)):"},{"line_number":935,"context_line":"                self._check_arp_voodoo_unplug(net_id)"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"        if last_bgpvpn:"},{"line_number":938,"context_line":"            if len(net_info.services_info) \u003d\u003d 1:"},{"line_number":939,"context_line":"                for port_info in net_info.ports:"},{"line_number":940,"context_line":"                    self._do_port_unplug(port_info.id)"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"                del(net_info.services_info[BGPVPN_SERVICE])"},{"line_number":943,"context_line":"            else:"},{"line_number":944,"context_line":"                del(net_info.services_info[BGPVPN_SERVICE])"},{"line_number":945,"context_line":""},{"line_number":946,"context_line":"                for port_info in net_info.ports:"},{"line_number":947,"context_line":"                    self._do_port_plug(port_info.id)"},{"line_number":948,"context_line":"        else:"},{"line_number":949,"context_line":"            net_info.services_info[BGPVPN_SERVICE] \u003d updated_info"},{"line_number":950,"context_line":""},{"line_number":951,"context_line":"            for port_info in net_info.ports:"},{"line_number":952,"context_line":"                self._do_port_plug(port_info.id)"},{"line_number":953,"context_line":""},{"line_number":954,"context_line":"    @log_helpers.log_method_call"},{"line_number":955,"context_line":"    @lockutils.synchronized(\u0027bagpipe-bgp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_22649f49","line":952,"range":{"start_line":928,"start_character":0,"end_line":952,"end_character":48},"updated":"2017-05-10 14:33:35.000000000","message":"I need to think more about this part.\n\n(see also my comments on bgpvpn_port_detach)","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":988,"context_line":""},{"line_number":989,"context_line":"        if self._get_port_info(port_id):"},{"line_number":990,"context_line":"            try:"},{"line_number":991,"context_line":"                self._do_port_unplug(port_id)"},{"line_number":992,"context_line":"                if self.agent_type \u003d\u003d n_const.AGENT_TYPE_OVS:"},{"line_number":993,"context_line":"                    net_info \u003d self._get_network_info(net_id)"},{"line_number":994,"context_line":"                    bgpvpn_info \u003d net_info.services_info.get(BGPVPN_SERVICE)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_22ba5fc0","line":991,"range":{"start_line":991,"start_character":16,"end_line":991,"end_character":45},"updated":"2017-05-10 14:33:35.000000000","message":"This is something we will have to discuss in future change: we should not unplug here is another service (e.g. sfc) has a reason for wanting to still be connected.\n\nI think that in fact the do_port_plug/unplug should not directly be called by service-specific code, but that service-specific code should call a refresh_plugs method that would check if ports need to be unplugged.\n\nLet\u0027s tackle this in a later patch.","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d2ce4fb10a3f4257f17b7db80f486002df658c34","unresolved":false,"context_lines":[{"line_number":999,"context_line":"                LOG.error(\"Can\u0027t detach BGPVPN port from bagpipe-bgp %s\","},{"line_number":1000,"context_line":"                          str(e))"},{"line_number":1001,"context_line":"            finally:"},{"line_number":1002,"context_line":"                self._remove_network_port_infos(net_id, port_id)"},{"line_number":1003,"context_line":"        else:"},{"line_number":1004,"context_line":"            LOG.warning(\u0027bagpipe-bgp agent inconsistent for BGPVPN or updated \u0027"},{"line_number":1005,"context_line":"                        \u0027with another detach\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_a26e6f2c","line":1002,"range":{"start_line":1002,"start_character":16,"end_line":1002,"end_character":64},"updated":"2017-05-10 14:33:35.000000000","message":"I\u0027m realizing that, if this RPC is called when a port association is removed (not something we have today, but we might have this tomorrow), doing this will kill bagpipe L2 !\n\nIt would be better if here we would do:\n- remove all BGPVPN service info from network_inf\n- then, *if* no service info remains, then call _remove_network_port_info .","commit_id":"2c3c3602346c94700e925d2d4fd3b84447bec827"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"9d04d2fe0d47d72a57e845a10e4a5f36657942ba","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            )"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"class BaseServiceInfo(object):"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def __init__(self, id):"},{"line_number":210,"context_line":"        self.id \u003d id"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_796c1036","line":207,"range":{"start_line":207,"start_character":6,"end_line":207,"end_character":17},"updated":"2017-05-15 10:26:01.000000000","message":"CommonInfo ?","commit_id":"563791821d29721a4a59a35d5db8c6ab3f931482"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"9d04d2fe0d47d72a57e845a10e4a5f36657942ba","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            self.network \u003d network"},{"line_number":241,"context_line":"        else:"},{"line_number":242,"context_line":"            LOG.warning(\u0027Network reference has already been set for port\u0027)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"class NetworkInfo(BaseServiceInfo):"},{"line_number":246,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_b97df86f","line":243,"updated":"2017-05-15 10:26:01.000000000","message":"This objet needs proper __hash__ and __eq__ .\n\nHashing on self.id key and testing equality of .id field will do just what we need.","commit_id":"563791821d29721a4a59a35d5db8c6ab3f931482"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"9d04d2fe0d47d72a57e845a10e4a5f36657942ba","unresolved":false,"context_lines":[{"line_number":252,"context_line":"        self.ports \u003d set()"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    def set_gateway_info(self, gateway_info):"},{"line_number":255,"context_line":"        self.gateway_ip \u003d gateway_info.ip"},{"line_number":256,"context_line":"        self.gateway_mac \u003d gateway_info.mac"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"GatewayInfo \u003d namedtuple(\u0027GatewayInfo\u0027, [\u0027mac\u0027, \u0027ip\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_b9b5f8f0","line":256,"range":{"start_line":255,"start_character":0,"end_line":256,"end_character":42},"updated":"2017-05-15 10:26:01.000000000","message":"store in a self.gateway_info attribute ?","commit_id":"563791821d29721a4a59a35d5db8c6ab3f931482"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"9d04d2fe0d47d72a57e845a10e4a5f36657942ba","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        status_loop.start(interval\u003dping_interval,"},{"line_number":371,"context_line":"                          initial_delay\u003dping_interval)  # TM: why not zero ?"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def _get_network_info(self, net_id, initial\u003dFalse):"},{"line_number":374,"context_line":"        if initial and net_id not in self.networks_info:"},{"line_number":375,"context_line":"            self.networks_info[net_id] \u003d NetworkInfo(net_id)"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"        return self.networks_info.get(net_id)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def _get_port_info(self, port_id, initial\u003dFalse):"},{"line_number":380,"context_line":"        if initial and port_id not in self.ports_info:"},{"line_number":381,"context_line":"            self.ports_info[port_id] \u003d PortInfo(port_id)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        return self.ports_info.get(port_id)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def _get_network_port_infos(self, net_id, port_id):"},{"line_number":386,"context_line":"        net_info \u003d self._get_network_info(net_id, initial\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_b9405809","line":383,"range":{"start_line":373,"start_character":8,"end_line":383,"end_character":43},"updated":"2017-05-15 10:26:01.000000000","message":"use a defaultdict ?","commit_id":"563791821d29721a4a59a35d5db8c6ab3f931482"}],"networking_bagpipe/tests/unit/agent/bagpipe_bgp_agent/test_service_bgpvpn.py":[{"author":{"_account_id":19990,"name":"Yannick Thomas","email":"ythomas1.ext@orange.com","username":"ythomas1"},"change_message_id":"ebb719089bda80b86a2a29e1fb42ac186716a673","unresolved":false,"context_lines":[{"line_number":863,"context_line":"            self.assertEqual(1, tun_delete_flows.call_count)"},{"line_number":864,"context_line":"            self.assertEqual(1, int_delete_flows.call_count)"},{"line_number":865,"context_line":""},{"line_number":866,"context_line":"            tun_delete_flows.assert_has_calls(["},{"line_number":867,"context_line":"                mock.call(table\u003dmock.ANY,"},{"line_number":868,"context_line":"                          proto\u003d\u0027arp\u0027,"},{"line_number":869,"context_line":"                          arp_op\u003d0x01,"},{"line_number":870,"context_line":"                          arp_tpa\u003d\u002710.0.0.1\u0027,"},{"line_number":871,"context_line":"                          dl_vlan\u003dmock.ANY,"},{"line_number":872,"context_line":"                          )])"},{"line_number":873,"context_line":"            int_delete_flows.assert_has_calls(["},{"line_number":874,"context_line":"                mock.call(table\u003dmock.ANY,"},{"line_number":875,"context_line":"                          proto\u003d\u0027arp\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_4217dd52","line":872,"range":{"start_line":866,"start_character":0,"end_line":872,"end_character":29},"updated":"2017-05-17 07:10:45.000000000","message":"Add missing lines introduced by commit 5007b9f17d5dc149d8d742b6f4d89cd0aa00dcda\n\n@@ -1769,6 +1769,8 @@ def test_gateway_arp_voodoo(self):\n \n             tun_delete_flows.assert_has_calls([\n                 mock.call(table\u003dmock.ANY,\n+                          priority\u003d2,\n+                          strict\u003dTrue,\n                           proto\u003d\u0027arp\u0027,\n                           arp_op\u003d0x01,\n                           arp_tpa\u003d\u002710.0.0.1\u0027,","commit_id":"8d2da33b37794322271e41c7fadcd97390be6b6a"}],"networking_bagpipe/tests/unit/agent/bagpipe_bgp_agent/test_service_combined.py":[{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"9143d1cd1557e2d875e0826a42bce89ff2ec4a21","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import BAGPIPE_L2_SERVICE"},{"line_number":19,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import BGPVPN_L2"},{"line_number":20,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import BGPVPN_L3"},{"line_number":21,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import BGPVPN_SERVICE"},{"line_number":22,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import EVPN"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from networking_bagpipe.agent.bagpipe_bgp_agent import BaGPipeBGPException"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":27,"context_line":"    import BaseTestBaGPipeBGPAgentLinuxBridge"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":30,"context_line":"    import BAGPIPE_EVPN_RT1"},{"line_number":31,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":32,"context_line":"    import BAGPIPE_EVPN_RT2"},{"line_number":33,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":34,"context_line":"    import BGPVPN_L2_RT10"},{"line_number":35,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":36,"context_line":"    import BGPVPN_L2_RT20"},{"line_number":37,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":38,"context_line":"    import BGPVPN_L3_RT100"},{"line_number":39,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":40,"context_line":"    import BGPVPN_L3_RT200"},{"line_number":41,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \\"},{"line_number":42,"context_line":"    import DummyPort"},{"line_number":43,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base import NETWORK1"},{"line_number":44,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base import NETWORK2"},{"line_number":45,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base import PORT10"},{"line_number":46,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base import PORT11"},{"line_number":47,"context_line":"from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base import PORT20"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"class TestServiceCombinedMixin(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_ef30520a","line":47,"range":{"start_line":18,"start_character":0,"end_line":47,"end_character":77},"updated":"2017-05-15 10:54:50.000000000","message":"it is better (more in the openstack codestyle) to avoid such direct imports, and prefer:\n\n  from networking_bagpipe.agent.bagpipe_bgp_agent as agent\n  from networking_bagpipe.tests.unit.agent.bagpipe_bgp_agent.base \n\nAnd then use, e.g. agent.BGPVPN_L2 and base.DummyPort .","commit_id":"563791821d29721a4a59a35d5db8c6ab3f931482"}]}
