)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"d4703793eb3527a42b9b92317040f5f78e38d207","unresolved":false,"context_lines":[{"line_number":25,"context_line":"added or removed from the dvr router that are on the"},{"line_number":26,"context_line":"same network."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Partial Bug: #1493524"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Change-Id: I777d95d9a148fc6b6bad4538f3a1156ae5052bf6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba15a1d1_1b1d49bd","line":28,"range":{"start_line":28,"start_character":0,"end_line":28,"end_character":21},"updated":"2015-09-21 17:14:01.000000000","message":"nit: Partial Bug → Partial-Bug","commit_id":"811bd7bd3ce00fd5963b9c9f16f77076a15fcd18"}],"neutron/agent/l3/dvr_local_router.py":[{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"925cf0d57f5146971b58cc331f0bf7df3bfd4b59","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            ns_ipd \u003d ip_lib.IPDevice(sn_int, namespace\u003dself.ns_name)"},{"line_number":281,"context_line":"            if is_add:"},{"line_number":282,"context_line":"                ns_ipwrapr \u003d ip_lib.IPWrapper(namespace\u003dself.ns_name)"},{"line_number":283,"context_line":"            for port_fixed_ip in sn_port[\u0027fixed_ips\u0027]:"},{"line_number":284,"context_line":"                # Find the first gateway IP address matching this IP version"},{"line_number":285,"context_line":"                port_ip_addr \u003d port_fixed_ip[\u0027ip_address\u0027]"},{"line_number":286,"context_line":"                port_ip_vers \u003d netaddr.IPAddress(port_ip_addr).version"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a26ad4f_986a3eb2","line":283,"updated":"2015-11-03 06:19:33.000000000","message":"Since the break statement is moved away, for multiple IPv6 subnets case, all subnets will be processed, so comment here should be modified.","commit_id":"11bb254eef01d324928c8ad4f221972143d30b52"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                context.session.add(router_port)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        # NOTE: For IPv6 additional subnets we need to update the"},{"line_number":285,"context_line":"        # CSNAT ports with respective IPv6 subnets"},{"line_number":286,"context_line":"        elif subnets and port:"},{"line_number":287,"context_line":"            fixed_ip \u003d {\u0027subnet_id\u0027: subnets[0][\u0027id\u0027]}"},{"line_number":288,"context_line":"            if subnets[0][\u0027ip_version\u0027] \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_c9c34856","line":285,"updated":"2015-09-22 22:33:27.000000000","message":"You use plural subnets yet the code only works with the first one.  I find it confusing.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                context.session.add(router_port)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        # NOTE: For IPv6 additional subnets we need to update the"},{"line_number":285,"context_line":"        # CSNAT ports with respective IPv6 subnets"},{"line_number":286,"context_line":"        elif subnets and port:"},{"line_number":287,"context_line":"            fixed_ip \u003d {\u0027subnet_id\u0027: subnets[0][\u0027id\u0027]}"},{"line_number":288,"context_line":"            if subnets[0][\u0027ip_version\u0027] \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_c76f8cc2","line":285,"in_reply_to":"ba15a1d1_c9c34856","updated":"2015-09-23 16:14:41.000000000","message":"with fix the note.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE: For IPv6 additional subnets we need to update the"},{"line_number":285,"context_line":"        # CSNAT ports with respective IPv6 subnets"},{"line_number":286,"context_line":"        elif subnets and port:"},{"line_number":287,"context_line":"            fixed_ip \u003d {\u0027subnet_id\u0027: subnets[0][\u0027id\u0027]}"},{"line_number":288,"context_line":"            if subnets[0][\u0027ip_version\u0027] \u003d\u003d 6:"},{"line_number":289,"context_line":"                # Add new prefix to an existing ipv6 csnat port with the"},{"line_number":290,"context_line":"                # same network id if one exists"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_49e098fa","line":287,"updated":"2015-09-22 22:33:27.000000000","message":"It isn\u0027t clear why subnets[0] is used here and not some other magic index (like -1 on L304).  At least could you create a local variable to reference it instead of using the magic 0 index over and over?\n\nNow I find myself wondering what is special about the first (0) and last (-1) subnets here.  Is there only one subnet in which case first \u003d\u003d last?","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE: For IPv6 additional subnets we need to update the"},{"line_number":285,"context_line":"        # CSNAT ports with respective IPv6 subnets"},{"line_number":286,"context_line":"        elif subnets and port:"},{"line_number":287,"context_line":"            fixed_ip \u003d {\u0027subnet_id\u0027: subnets[0][\u0027id\u0027]}"},{"line_number":288,"context_line":"            if subnets[0][\u0027ip_version\u0027] \u003d\u003d 6:"},{"line_number":289,"context_line":"                # Add new prefix to an existing ipv6 csnat port with the"},{"line_number":290,"context_line":"                # same network id if one exists"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_e7d09055","line":287,"in_reply_to":"ba15a1d1_49e098fa","updated":"2015-09-23 16:14:41.000000000","message":"At this juncture there will be only one subnet that was added to the router-interface.\nBut the function will return a subnet-list, so I was getting the first entry.\nI can definitely add a local variable and use it as per your suggestion.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        return super(L3_NAT_with_dvr_db_mixin,"},{"line_number":315,"context_line":"                     self)._port_has_ipv6_address(port)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def _find_router_port_by_network_and_device_owner("},{"line_number":318,"context_line":"        self, router, net_id, device_owner):"},{"line_number":319,"context_line":"        for port in router.attached_ports:"},{"line_number":320,"context_line":"            p \u003d port[\u0027port\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_6474a19b","line":317,"updated":"2015-09-22 22:33:27.000000000","message":"There could be more than one matching port, couldn\u0027t there?  Or, are all of the ipv6 subnets collapsed in to one port?","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        return super(L3_NAT_with_dvr_db_mixin,"},{"line_number":315,"context_line":"                     self)._port_has_ipv6_address(port)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def _find_router_port_by_network_and_device_owner("},{"line_number":318,"context_line":"        self, router, net_id, device_owner):"},{"line_number":319,"context_line":"        for port in router.attached_ports:"},{"line_number":320,"context_line":"            p \u003d port[\u0027port\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_47fdbcaf","line":317,"in_reply_to":"ba15a1d1_6474a19b","updated":"2015-09-23 16:14:41.000000000","message":"There will be only one port matching the network and device_owner for the IPv6.\nIn the case of IPv6 addresses when multiple subnets are added to the same network, a single port is appended with the multiple prefix.\n\nHope this helps.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":324,"context_line":"                return port"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"},{"line_number":327,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":328,"context_line":"            if netaddr.IPNetwork(fixed_ip[\u0027ip_address\u0027]).version \u003d\u003d 6:"},{"line_number":329,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_e902cc3d","line":326,"updated":"2015-09-22 22:33:27.000000000","message":"Why do we need a special dvr version of _port_has_ipv6_address in neutron/db/l3_db.py?  It looks the same.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":324,"context_line":"                return port"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"},{"line_number":327,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":328,"context_line":"            if netaddr.IPNetwork(fixed_ip[\u0027ip_address\u0027]).version \u003d\u003d 6:"},{"line_number":329,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_078ee42d","line":326,"in_reply_to":"ba15a1d1_e902cc3d","updated":"2015-09-23 16:14:41.000000000","message":"We have already overridden the _port_has_ipv6_address to neglect the SNAT ports.\nBut this fix is for working on SNAT ports, so I have to introduce this function in the l3_db context.\nSee line L312.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":333,"context_line":"        \"\"\"Checks if the csnat port contains multiple ipv6 prefixes."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        If the csnat port contains multiple ipv6 prefixes for the given"},{"line_number":336,"context_line":"        subnet when a router interface is deleted, make sure we don\u0027t"},{"line_number":337,"context_line":"        delete the port and just update it with the right fixed_ip."},{"line_number":338,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":339,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_89079080","line":336,"updated":"2015-09-22 22:33:27.000000000","message":"In Neutron, a subnet only has one prefix.  Given that, \"multiple ipv6 prefixes for the given subnet\" is a bit confusing.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":333,"context_line":"        \"\"\"Checks if the csnat port contains multiple ipv6 prefixes."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        If the csnat port contains multiple ipv6 prefixes for the given"},{"line_number":336,"context_line":"        subnet when a router interface is deleted, make sure we don\u0027t"},{"line_number":337,"context_line":"        delete the port and just update it with the right fixed_ip."},{"line_number":338,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":339,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_a7e378d7","line":336,"in_reply_to":"ba15a1d1_89079080","updated":"2015-09-23 16:14:41.000000000","message":"In Neutron if multiple subnets are added to the same network, then there will be multiple ipv6 prefixes for the given subnet.\n\nVerify the L594 in l3_db.py.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e5ce50f83a47ed45952aa8f54854e3283ba6567c","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        delete the port and just update it with the right fixed_ip."},{"line_number":338,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":339,"context_line":"        \"\"\""},{"line_number":340,"context_line":"        subnet_id \u003d subnets[0][\u0027id\u0027]"},{"line_number":341,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":342,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":343,"context_line":"            cs_port \u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_69b6bcdd","line":340,"updated":"2015-09-22 22:33:27.000000000","message":"Why does this method accept a list of subnets only to work with the first one?  It would be clearer to just accept a single subnet.  It would also take less faith on the part of the code reviewer to accept that it is okay to reference \"subnets[0]\" without checking that subnets has at least one element.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"fb9a1bf6293367c410b482c34aaace0df5f9149c","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        delete the port and just update it with the right fixed_ip."},{"line_number":338,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":339,"context_line":"        \"\"\""},{"line_number":340,"context_line":"        subnet_id \u003d subnets[0][\u0027id\u0027]"},{"line_number":341,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":342,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":343,"context_line":"            cs_port \u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_0731045a","line":340,"in_reply_to":"ba15a1d1_69b6bcdd","updated":"2015-09-23 16:14:41.000000000","message":"Ok, I will fix this.","commit_id":"99e7d9122a4225f6db4bf68d010317762fb2bcda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":252,"context_line":"        new_port \u003d True"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        if add_by_port:"},{"line_number":255,"context_line":"            port, subnets \u003d self._add_interface_by_port("},{"line_number":256,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":257,"context_line":"        elif add_by_sub:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_8fd47247","line":254,"updated":"2015-09-28 18:48:56.000000000","message":"How do we know this code returns exactly one subnet?","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        # This should be True unless adding an IPv6 prefix to an existing port"},{"line_number":252,"context_line":"        new_port \u003d True"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        if add_by_port:"},{"line_number":255,"context_line":"            port, subnets \u003d self._add_interface_by_port("},{"line_number":256,"context_line":"                    context, router, interface_info[\u0027port_id\u0027], device_owner)"},{"line_number":257,"context_line":"        elif add_by_sub:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_7b519c0d","line":254,"in_reply_to":"9a1a9d01_8fd47247","updated":"2015-09-28 20:25:24.000000000","message":"Let me check this out.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE: For IPv6 additional subnets added to the same"},{"line_number":285,"context_line":"        # network we need to update the CSNAT port with respective"},{"line_number":286,"context_line":"        # IPv6 subnet"},{"line_number":287,"context_line":"        elif subnets and port:"},{"line_number":288,"context_line":"            rtr_subnet \u003d subnets[0]"},{"line_number":289,"context_line":"            fixed_ip \u003d {\u0027subnet_id\u0027: rtr_subnet[\u0027id\u0027]}"},{"line_number":290,"context_line":"            if rtr_subnet[\u0027ip_version\u0027] \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_2c59b4fe","line":287,"updated":"2015-09-28 18:48:56.000000000","message":"I think bool(subnets) must always be True.  Otherwise, L306 would fail because it accesses subnets[-1]","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":303,"context_line":"                    LOG.debug(\"CSNAT port updated for IPv6 subnet: \""},{"line_number":304,"context_line":"                              \"%s\", updated_port)"},{"line_number":305,"context_line":"        router_interface_info \u003d self._make_router_interface_info("},{"line_number":306,"context_line":"            router_id, port[\u0027tenant_id\u0027], port[\u0027id\u0027], subnets[-1][\u0027id\u0027],"},{"line_number":307,"context_line":"            [subnet[\u0027id\u0027] for subnet in subnets])"},{"line_number":308,"context_line":"        self.notify_router_interface_action("},{"line_number":309,"context_line":"            context, router_interface_info, \u0027add\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_4c10a8a8","line":306,"updated":"2015-09-28 18:48:56.000000000","message":"Can you tell me if subnets[-1] referenced here is the same as subnets[0] on L288?  IOW, Will there always be exactly one subnet in this list?  Looking at _add_interface_by_port, I\u0027m not convinced.\n\nIf they\u0027re not the same, why is one part of the code looking at the last subnet in the list and the other part of the code looking at the first one in the list?\n\nIf there is exactly one subnet in the list, should we refactor like I\u0027ve shown in the follow-on I\u0027m uploading to this patch set?  How do you guarantee this is always the case?","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":303,"context_line":"                    LOG.debug(\"CSNAT port updated for IPv6 subnet: \""},{"line_number":304,"context_line":"                              \"%s\", updated_port)"},{"line_number":305,"context_line":"        router_interface_info \u003d self._make_router_interface_info("},{"line_number":306,"context_line":"            router_id, port[\u0027tenant_id\u0027], port[\u0027id\u0027], subnets[-1][\u0027id\u0027],"},{"line_number":307,"context_line":"            [subnet[\u0027id\u0027] for subnet in subnets])"},{"line_number":308,"context_line":"        self.notify_router_interface_action("},{"line_number":309,"context_line":"            context, router_interface_info, \u0027add\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_a0306502","line":306,"in_reply_to":"9a1a9d01_4c10a8a8","updated":"2015-09-28 20:25:24.000000000","message":"Let me check this. I thought I was handling only the case where add_interface_by_subnet is handled in here.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            p \u003d port[\u0027port\u0027]"},{"line_number":323,"context_line":"            if (p[\u0027network_id\u0027] \u003d\u003d net_id and"},{"line_number":324,"context_line":"                p[\u0027device_owner\u0027] \u003d\u003d device_owner and"},{"line_number":325,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":326,"context_line":"                return port"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_2ce9b480","line":325,"updated":"2015-09-28 18:48:56.000000000","message":"Just call self._port_has_ipv6_address(p)","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            p \u003d port[\u0027port\u0027]"},{"line_number":323,"context_line":"            if (p[\u0027network_id\u0027] \u003d\u003d net_id and"},{"line_number":324,"context_line":"                p[\u0027device_owner\u0027] \u003d\u003d device_owner and"},{"line_number":325,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":326,"context_line":"                return port"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_c04a39ac","line":325,"in_reply_to":"9a1a9d01_2ce9b480","updated":"2015-09-28 20:25:24.000000000","message":"Carl, this will return false based on the L315","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bd723b0dc5dd10cec773214a7372dc53e92db0e1","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            p \u003d port[\u0027port\u0027]"},{"line_number":323,"context_line":"            if (p[\u0027network_id\u0027] \u003d\u003d net_id and"},{"line_number":324,"context_line":"                p[\u0027device_owner\u0027] \u003d\u003d device_owner and"},{"line_number":325,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":326,"context_line":"                return port"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_2b71fae0","line":325,"in_reply_to":"9a1a9d01_c04a39ac","updated":"2015-10-01 21:46:41.000000000","message":"I had forgotten about the other override.  Makes sense now.  You might consider calling the super class method directly instead of duplicating it in this class.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":326,"context_line":"                return port"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"},{"line_number":329,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":330,"context_line":"            if netaddr.IPNetwork(fixed_ip[\u0027ip_address\u0027]).version \u003d\u003d 6:"},{"line_number":331,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_4cd508b7","line":328,"updated":"2015-09-28 18:48:56.000000000","message":"The super class has this exact same code in a method call _port_has_ipv6_address.  Don\u0027t duplicate it here.  You don\u0027t need it.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                self._dvr_port_has_ipv6_address(p)):"},{"line_number":326,"context_line":"                return port"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def _dvr_port_has_ipv6_address(self, port):"},{"line_number":329,"context_line":"        for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":330,"context_line":"            if netaddr.IPNetwork(fixed_ip[\u0027ip_address\u0027]).version \u003d\u003d 6:"},{"line_number":331,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_c02b1993","line":328,"in_reply_to":"9a1a9d01_4cd508b7","updated":"2015-09-28 20:25:24.000000000","message":"See my reply above.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _check_dvr_router_remove_required_and_notify_agent("},{"line_number":365,"context_line":"        self, context, router, port, subnets):"},{"line_number":366,"context_line":"        rtr_subnet \u003d subnets[0]"},{"line_number":367,"context_line":"        if router.extra_attributes.distributed:"},{"line_number":368,"context_line":"            is_multiple_prefix_csport \u003d ("},{"line_number":369,"context_line":"                self._check_for_multiprefix_csnat_port_and_update("}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_8c1c8078","line":366,"updated":"2015-09-28 18:48:56.000000000","message":"I\u0027d prefer a separate refactor which changes this method to accept only a single subnet and just let this reference subnets[0] since it does already.  However, I\u0027m not convinced that there is exactly one subnet.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _check_dvr_router_remove_required_and_notify_agent("},{"line_number":365,"context_line":"        self, context, router, port, subnets):"},{"line_number":366,"context_line":"        rtr_subnet \u003d subnets[0]"},{"line_number":367,"context_line":"        if router.extra_attributes.distributed:"},{"line_number":368,"context_line":"            is_multiple_prefix_csport \u003d ("},{"line_number":369,"context_line":"                self._check_for_multiprefix_csnat_port_and_update("}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_00091131","line":366,"in_reply_to":"9a1a9d01_8c1c8078","updated":"2015-09-28 20:25:24.000000000","message":"Let me re-check.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"03847f50cd3aac5e014fe24d70b38257f2a2cdbd","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":398,"context_line":"        device_owner \u003d self._get_device_owner(context, router)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"        if remove_by_port:"},{"line_number":401,"context_line":"            port, subnets \u003d self._remove_interface_by_port("},{"line_number":402,"context_line":"                    context, router_id, port_id, subnet_id, device_owner)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_ef696ebf","line":400,"updated":"2015-09-28 18:48:56.000000000","message":"How do we know this returns a list of exactly one subnet?  The code in _check_dvr_router_remove_required_and_notify_agent assumes it.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5eff2063d37f3b738991723fe69c9b7053665a68","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        router \u003d self._get_router(context, router_id)"},{"line_number":398,"context_line":"        device_owner \u003d self._get_device_owner(context, router)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"        if remove_by_port:"},{"line_number":401,"context_line":"            port, subnets \u003d self._remove_interface_by_port("},{"line_number":402,"context_line":"                    context, router_id, port_id, subnet_id, device_owner)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a1a9d01_9b1ef061","line":400,"in_reply_to":"9a1a9d01_ef696ebf","updated":"2015-09-28 20:25:24.000000000","message":"Let me check this again.","commit_id":"6cc6c3378d4a6443c6673a83d7f227e55c461a10"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"925cf0d57f5146971b58cc331f0bf7df3bfd4b59","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            port, subnets, new_port \u003d self._add_interface_by_subnet("},{"line_number":260,"context_line":"                    context, router, interface_info[\u0027subnet_id\u0027], device_owner)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        # There is exactly one subnet in the list."},{"line_number":263,"context_line":"        subnet \u003d subnets[0]"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"        if new_port:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a26ad4f_1b3948a4","line":262,"updated":"2015-11-03 06:19:33.000000000","message":"Yes, to attach additional v6 subnet case, subnets just contains one subnet. But this comment is confused. It won\u0027t help to case adding router interface by port, while port has multiple subnets.","commit_id":"11bb254eef01d324928c8ad4f221972143d30b52"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"925cf0d57f5146971b58cc331f0bf7df3bfd4b59","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                    context, router_id, subnet_id, device_owner)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # There is exactly one subnet in the list."},{"line_number":410,"context_line":"        subnet \u003d subnets[0]"},{"line_number":411,"context_line":"        router_interface_info \u003d ("},{"line_number":412,"context_line":"            self._check_dvr_router_remove_required_and_notify_agent("},{"line_number":413,"context_line":"                context, router, port, subnet))"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a26ad4f_58fa6644","line":410,"updated":"2015-11-03 06:19:33.000000000","message":"Same to L263.","commit_id":"11bb254eef01d324928c8ad4f221972143d30b52"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"087ed60a56c4320183fb52080acb97e25975b63f","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                    fixed_ips.append(fixed_ip)"},{"line_number":301,"context_line":"                    updated_port \u003d self._core_plugin.update_port("},{"line_number":302,"context_line":"                        context.elevated(),"},{"line_number":303,"context_line":"                        cs_port[\u0027port_id\u0027], {\u0027port\u0027:"},{"line_number":304,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":305,"context_line":"                    LOG.debug(\"CSNAT port updated for IPv6 subnet: \""},{"line_number":306,"context_line":"                              \"%s\", updated_port)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_e70002ad","line":303,"updated":"2015-11-09 09:19:56.000000000","message":"minor nit - you can write this on the same line","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a08b86782c3a60906764606b17ccbc84ca739a22","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                    fixed_ips.append(fixed_ip)"},{"line_number":301,"context_line":"                    updated_port \u003d self._core_plugin.update_port("},{"line_number":302,"context_line":"                        context.elevated(),"},{"line_number":303,"context_line":"                        cs_port[\u0027port_id\u0027], {\u0027port\u0027:"},{"line_number":304,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":305,"context_line":"                    LOG.debug(\"CSNAT port updated for IPv6 subnet: \""},{"line_number":306,"context_line":"                              \"%s\", updated_port)"}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_e3a53604","line":303,"in_reply_to":"da85f559_e70002ad","updated":"2015-11-09 18:42:15.000000000","message":"I can fix it if I roll it back due to the merge conflict","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"087ed60a56c4320183fb52080acb97e25975b63f","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":340,"context_line":"        \"\"\""},{"line_number":341,"context_line":"        subnet_id \u003d subnet[\u0027id\u0027]"},{"line_number":342,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":343,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":344,"context_line":"            cs_port \u003d ("},{"line_number":345,"context_line":"                self._find_router_port_by_network_and_device_owner("}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_a7a67abf","line":342,"updated":"2015-11-09 09:19:56.000000000","message":"is there ever a subnet with an id?","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a08b86782c3a60906764606b17ccbc84ca739a22","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":340,"context_line":"        \"\"\""},{"line_number":341,"context_line":"        subnet_id \u003d subnet[\u0027id\u0027]"},{"line_number":342,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":343,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":344,"context_line":"            cs_port \u003d ("},{"line_number":345,"context_line":"                self._find_router_port_by_network_and_device_owner("}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_a3b08e44","line":342,"in_reply_to":"da85f559_a7a67abf","updated":"2015-11-09 18:42:15.000000000","message":"I am not sure if I understood your comment here.","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"087ed60a56c4320183fb52080acb97e25975b63f","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                    self._core_plugin.update_port("},{"line_number":356,"context_line":"                        context.elevated(),"},{"line_number":357,"context_line":"                        cs_port[\u0027port_id\u0027],"},{"line_number":358,"context_line":"                        {\u0027port\u0027:"},{"line_number":359,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":360,"context_line":"                    return True"},{"line_number":361,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_07fae6bd","line":358,"updated":"2015-11-09 09:19:56.000000000","message":"minor nit - you can write this on the same line","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a08b86782c3a60906764606b17ccbc84ca739a22","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                    self._core_plugin.update_port("},{"line_number":356,"context_line":"                        context.elevated(),"},{"line_number":357,"context_line":"                        cs_port[\u0027port_id\u0027],"},{"line_number":358,"context_line":"                        {\u0027port\u0027:"},{"line_number":359,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":360,"context_line":"                    return True"},{"line_number":361,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_e37c5674","line":358,"in_reply_to":"da85f559_07fae6bd","updated":"2015-11-09 18:42:15.000000000","message":"will fix it if I roll this patch again","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"087ed60a56c4320183fb52080acb97e25975b63f","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                        cs_port[\u0027port_id\u0027],"},{"line_number":358,"context_line":"                        {\u0027port\u0027:"},{"line_number":359,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":360,"context_line":"                    return True"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _check_dvr_router_remove_required_and_notify_agent("},{"line_number":363,"context_line":"        self, context, router, port, subnet):"}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_67873210","line":360,"updated":"2015-11-09 09:19:56.000000000","message":"should the method by default return False?","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a08b86782c3a60906764606b17ccbc84ca739a22","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                        cs_port[\u0027port_id\u0027],"},{"line_number":358,"context_line":"                        {\u0027port\u0027:"},{"line_number":359,"context_line":"                            {\u0027fixed_ips\u0027: fixed_ips}})"},{"line_number":360,"context_line":"                    return True"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _check_dvr_router_remove_required_and_notify_agent("},{"line_number":363,"context_line":"        self, context, router, port, subnet):"}],"source_content_type":"text/x-python","patch_set":20,"id":"da85f559_63bf06fc","line":360,"in_reply_to":"da85f559_67873210","updated":"2015-11-09 18:42:15.000000000","message":"may be it can return false by default.","commit_id":"e9d1be16a2350b871966ffb392a4b035c37b1c41"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"558f88ed00c07ed792239641bc1e450f94e431f7","unresolved":false,"context_lines":[{"line_number":342,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":343,"context_line":"        \"\"\""},{"line_number":344,"context_line":"        subnet_id \u003d subnet[\u0027id\u0027]"},{"line_number":345,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":346,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":347,"context_line":"            cs_port \u003d ("},{"line_number":348,"context_line":"                self._find_router_port_by_network_and_device_owner("}],"source_content_type":"text/x-python","patch_set":21,"id":"da85f559_c004364b","line":345,"updated":"2015-11-11 17:57:21.000000000","message":"it is still not clear to me why you are checking the subnet_id is not None here. The subnet will always exist here. No?\nThis could be :\nif router.gw_port:","commit_id":"63978327e766ee4d62f024394e7d39e0a0351bfe"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"49f707b244f37e6a0d7047b68718fcc2989f2007","unresolved":false,"context_lines":[{"line_number":342,"context_line":"        This function returns true if it is a multiprefix port."},{"line_number":343,"context_line":"        \"\"\""},{"line_number":344,"context_line":"        subnet_id \u003d subnet[\u0027id\u0027]"},{"line_number":345,"context_line":"        if router.gw_port and subnet_id:"},{"line_number":346,"context_line":"            # If router has a gateway port, check if it has IPV6 subnet"},{"line_number":347,"context_line":"            cs_port \u003d ("},{"line_number":348,"context_line":"                self._find_router_port_by_network_and_device_owner("}],"source_content_type":"text/x-python","patch_set":21,"id":"da85f559_f4557fc1","line":345,"in_reply_to":"da85f559_c004364b","updated":"2015-11-11 18:06:11.000000000","message":"It might have been a redundant check in here.\nMay be I will push in a follow on to remove it. \nLet this go through.","commit_id":"63978327e766ee4d62f024394e7d39e0a0351bfe"}]}
