)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d93d3305b685f728eaf6e0453968e9ad609ed3b8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Install SNAT rules for ipv4 only"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I37bd770aa0d54a985ac2bec708c571785084e0ec"},{"line_number":10,"context_line":"Closes-Bug: 1309195"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7adec928_41ba1be2","line":10,"updated":"2014-05-23 05:03:32.000000000","message":"nit:  Closes-Bug: #1309195","commit_id":"a864219239b58a817d0207a3fe1b96e4f6487a82"}],"neutron/agent/l3_agent.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a8bc537cadf9c27239f5e8024e89852522cd4979","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                          \u0027-p tcp -m tcp --dport 80 -j REDIRECT \u0027"},{"line_number":680,"context_line":"                          \u0027--to-port %s\u0027 % self.conf.metadata_port))"},{"line_number":681,"context_line":"        return rules"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"    def external_gateway_nat_rules(self, ex_gw_ip, internal_cidrs,"},{"line_number":684,"context_line":"                                   interface_name):"},{"line_number":685,"context_line":"        rules \u003d [(\u0027POSTROUTING\u0027, \u0027! -i %(interface_name)s \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FphA%3D","line":682,"updated":"2014-04-18 14:33:11.000000000","message":"Seems like we need to be careful to only apply this when ex_gw_ip is v4 and for the v4 internal cidr right?","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"cfae31223b8e6bcb7c30d8ebaa7742f1c6873dec","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                          \u0027-p tcp -m tcp --dport 80 -j REDIRECT \u0027"},{"line_number":680,"context_line":"                          \u0027--to-port %s\u0027 % self.conf.metadata_port))"},{"line_number":681,"context_line":"        return rules"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"    def external_gateway_nat_rules(self, ex_gw_ip, internal_cidrs,"},{"line_number":684,"context_line":"                                   interface_name):"},{"line_number":685,"context_line":"        rules \u003d [(\u0027POSTROUTING\u0027, \u0027! -i %(interface_name)s \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FISg%3D","line":682,"in_reply_to":"AAAAXH%2F%2FphA%3D","updated":"2014-04-23 19:54:47.000000000","message":"Correct. But want to make sure your comments is not about \u0027metadata_nat_rules\u0027 but about my change.","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a8bc537cadf9c27239f5e8024e89852522cd4979","unresolved":false,"context_lines":[{"line_number":715,"context_line":""},{"line_number":716,"context_line":"    def internal_network_nat_rules(self, ex_gw_ip, internal_cidr):"},{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FphU%3D","line":718,"updated":"2014-04-18 14:33:11.000000000","message":"Seems like this change should be made in the external_gateway_nat_rules().","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4acb3dd6add91e22bb17ef84c0d451fa1167ea36","unresolved":false,"context_lines":[{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"},{"line_number":722,"context_line":"                     (internal_cidr, ex_gw_ip))]"},{"line_number":723,"context_line":"        return rules"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FphY%3D","line":720,"updated":"2014-04-18 14:32:21.000000000","message":"Should a check like this be done in the caller?  I only see external_gateway_nat_rules() calling this, and even its caller, _handle_router_snat_rules(), only seems to deal with ipv4, so it should only be passing ipv4 cidrs down if you ask me.\n\nIf you go back i the call chain far enough, it almost seems like process_router() should build a v4-only list.\n\nAnd what about any floating IPs?  Do we have to worry about IPv6 addresses in that list too?","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"82124ae5fcc2a62493ab948030e933b586988c62","unresolved":false,"context_lines":[{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"},{"line_number":722,"context_line":"                     (internal_cidr, ex_gw_ip))]"},{"line_number":723,"context_line":"        return rules"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FdY4%3D","line":720,"in_reply_to":"AAAAXH%2F%2FeeQ%3D","updated":"2014-04-21 15:59:41.000000000","message":"Further investigation on the floatingip API revealed a few issues:\n  -- if the external network is associated with multiple subnets, one IP address from each of the subnets is allocated. But the ip address used for the floating ip is picked up randomly. For example, a network could have both an ipv6 and an ipv4 subnet. In my tests, for one of such network, it picked up the ipv4 address; for the other, it picked up the ipv6 address. \n  -- given that one IP is allocated from each subnet, addresses not used for floating ip is wasted.\n  -- Most likely, ipv6 floating ip (with the same mechanism as ipv4) won\u0027t be supported. But the API allows ipv6 addresses to be used as floating ip.\n  -- it allows an IPv4 floating ip to be associated with a port\u0027s ipv6 addresses, and vice versa.\n\nI\u0027d like to address those issues in separate bug(s), and limit the scope of this bug on the SNAT issue only. Let me know if you guys are ok with this approach. thanks.","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"aff791a0241b969b7108d7c189be4a867c769021","unresolved":false,"context_lines":[{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"},{"line_number":722,"context_line":"                     (internal_cidr, ex_gw_ip))]"},{"line_number":723,"context_line":"        return rules"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FeeQ%3D","line":720,"in_reply_to":"AAAAXH%2F%2FphY%3D","updated":"2014-04-21 15:33:05.000000000","message":"To comments from both Mark \u0026 Brian,\nI actually struggled a little bit on whether or not the check should be made at the caller, and made an attempt to build a v4-only list in process_router(). But later I abandoned that idea, thinking that the list of cidrs may be used for other things in the future. The result was the above change directly addressing the snat rules. However, since you guys prefer that, let me redo the change.\n\nI\u0027ll look into the floating ip  list as well.","commit_id":"d6e256260a50141504f434fde835d94ca3095d0e"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"9eb915b607cf7d48cd36bebb2889810769d3586e","unresolved":false,"context_lines":[{"line_number":715,"context_line":""},{"line_number":716,"context_line":"    def internal_network_nat_rules(self, ex_gw_ip, internal_cidr):"},{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FPyI%3D","line":718,"updated":"2014-04-23 02:30:59.000000000","message":"Should we only allow SNAT from IPv4 internal cidr to IPv4 external network? I don\u0027t think we support NAT64 yet. So maybe add an check of the external network version as well?","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"cb199859caa6414b49bbec791291cf9a7a5154eb","unresolved":false,"context_lines":[{"line_number":715,"context_line":""},{"line_number":716,"context_line":"    def internal_network_nat_rules(self, ex_gw_ip, internal_cidr):"},{"line_number":717,"context_line":"        # Install SNAT rules for ipv4 only"},{"line_number":718,"context_line":"        net \u003d netaddr.IPNetwork(internal_cidr)"},{"line_number":719,"context_line":"        rules \u003d []"},{"line_number":720,"context_line":"        if net.version \u003d\u003d 4:"},{"line_number":721,"context_line":"            rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIwM%3D","line":718,"in_reply_to":"AAAAXH%2F%2FPyI%3D","updated":"2014-04-23 19:55:05.000000000","message":"Good point. Currently, it only allows one ip address on the gw port. However, that ip could be ipv6 address as well.\n\nIn this patch https://review.openstack.org/#/c/77471/3 (which is abandoned), it would allow one ipv4 and one ipv6 address on the gw port. To accommodate future enhancement in this area, I\u0027m thinking to grab an ipv4 address if it\u0027s available on the gw port. If there is no ipv4 address, then it should not create any snat rules.","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"f64383fdb78f4910b880390e55cac813c23d8bc9","unresolved":false,"context_lines":[{"line_number":536,"context_line":"                if netaddr.IPNetwork(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"},{"line_number":538,"context_line":"                    break"},{"line_number":539,"context_line":"            if ex_gw_ip:"},{"line_number":540,"context_line":"                for rule in self.external_gateway_nat_rules(ex_gw_ip,"},{"line_number":541,"context_line":"                                                            internal_cidrs,"},{"line_number":542,"context_line":"                                                            interface_name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FCyM%3D","line":539,"updated":"2014-04-24 12:47:45.000000000","message":"Can do...\nelse:\n\nand then remove L534","commit_id":"7e0f3542d31c8727b8f73beb49b9b9d8c4dd9c58"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"a08d7f75ad133fc5c6bdc5f04fd89e84242b818f","unresolved":false,"context_lines":[{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def internal_network_nat_rules(self, ex_gw_ip, internal_cidr):"},{"line_number":725,"context_line":"        rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"},{"line_number":726,"context_line":"            (internal_cidr, ex_gw_ip))]"},{"line_number":727,"context_line":"        return rules"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"    def floating_forward_rules(self, floating_ip, fixed_ip):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FFWk%3D","line":726,"updated":"2014-04-24 06:19:57.000000000","message":"this change is not relevant and causing pep8 failure.","commit_id":"7e0f3542d31c8727b8f73beb49b9b9d8c4dd9c58"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"1db829d01217db56fbade6d9bbdfbe7ec2eb703f","unresolved":false,"context_lines":[{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def internal_network_nat_rules(self, ex_gw_ip, internal_cidr):"},{"line_number":725,"context_line":"        rules \u003d [(\u0027snat\u0027, \u0027-s %s -j SNAT --to-source %s\u0027 %"},{"line_number":726,"context_line":"            (internal_cidr, ex_gw_ip))]"},{"line_number":727,"context_line":"        return rules"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"    def floating_forward_rules(self, floating_ip, fixed_ip):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FCwY%3D","line":726,"in_reply_to":"AAAAXH%2F%2FFWk%3D","updated":"2014-04-24 12:47:54.000000000","message":"good catch. It\u0027s remnant of the previous patch","commit_id":"7e0f3542d31c8727b8f73beb49b9b9d8c4dd9c58"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f245e01fb4b64919722df5f5df97e3850417ec68","unresolved":false,"context_lines":[{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPNetwork(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"},{"line_number":538,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXH%2F%2FBfc%3D","line":535,"updated":"2014-04-24 15:28:45.000000000","message":"Should probably use IPAddress in this case and not IPNetwork but I\u0027m unaware of any significance other than semantic readability.","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"e444d4b3ef762ba81edd91bc59b41344c066a539","unresolved":false,"context_lines":[{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPNetwork(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"},{"line_number":538,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_e99d105b","line":535,"in_reply_to":"7adec928_4a2b6033","updated":"2014-05-21 11:07:43.000000000","message":"+1","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"edf6f7fa840a8594cd5a87c07fcc4e8bc89bbf7f","unresolved":false,"context_lines":[{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPNetwork(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"},{"line_number":538,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_47198b21","line":535,"in_reply_to":"7adec928_e99d105b","updated":"2014-05-21 13:26:43.000000000","message":"I\u0027ll make the change.","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d09a7f844538b577c8f79fd16becbac041b0d636","unresolved":false,"context_lines":[{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPNetwork(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"},{"line_number":538,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_4a2b6033","line":535,"in_reply_to":"AAAAXH%2F%2FBfc%3D","updated":"2014-05-21 01:51:15.000000000","message":"I agree. It\u0027s also more performant. :-)\n\n\n\u003e\u003e\u003e timeit.timeit(\u0027netaddr.IPAddress(\"1.1.1.1\").version\u0027, setup\u003d\u0027import netaddr\u0027, number\u003d100000)\n\n0.2764880657196045\n\n\u003e\u003e\u003e timeit.timeit(\u0027netaddr.IPNetwork(\"1.1.1.1\").version\u0027, setup\u003d\u0027import netaddr\u0027, number\u003d100000)\n\n0.8757820129394531","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"047f722dfe375d38f7529ce5e62fe04b70cb06b1","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if action \u003d\u003d \u0027add_rules\u0027 and ex_gw_port:"},{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPAddress(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_65211cb4","line":534,"updated":"2014-05-21 15:04:33.000000000","message":"you can replace \n\n  ex_gw_ip \u003d None\n  for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:\n    if netaddr.IPAddress(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:\n      ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]\n      break\n  if ex_gw_ip:\n   for rule in self.external_gateway_nat_rules(ex_gw_ip, ...):\n     ri.iptables_manager ...\n\nby \n  for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:\n    if netaddr.IPAddress(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:\n      ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]\n      for rule in self.external_gateway_nat_rules(ex_gw_ip, ...):\n        ri.iptables_manager ...\n      break","commit_id":"7c870daca0b08b50d812e44c5bb2de24e2392a9b"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"c8c17cd2fb50c4e62693a5ea48b740eaec5802da","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if action \u003d\u003d \u0027add_rules\u0027 and ex_gw_port:"},{"line_number":532,"context_line":"            # ex_gw_port should not be None in this case"},{"line_number":533,"context_line":"            # NAT rules are added only if ex_gw_port has an IPv4 address"},{"line_number":534,"context_line":"            ex_gw_ip \u003d None"},{"line_number":535,"context_line":"            for ip_addr in ex_gw_port[\u0027fixed_ips\u0027]:"},{"line_number":536,"context_line":"                if netaddr.IPAddress(ip_addr[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":537,"context_line":"                    ex_gw_ip \u003d ip_addr[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_cb492190","line":534,"in_reply_to":"7adec928_65211cb4","updated":"2014-05-21 15:57:15.000000000","message":"I guess that I can do that too. done.","commit_id":"7c870daca0b08b50d812e44c5bb2de24e2392a9b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"cdd690b51005332523ce91017a62d7ef0d7e03a7","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            interface_name \u003d self.get_external_device_name(ex_gw_port_id)"},{"line_number":463,"context_line":"        if ex_gw_port and not ri.ex_gw_port:"},{"line_number":464,"context_line":"            self._set_subnet_info(ex_gw_port)"},{"line_number":465,"context_line":"            self.external_gateway_added(ri, ex_gw_port,"},{"line_number":466,"context_line":"                                        interface_name, internal_cidrs)"},{"line_number":467,"context_line":"        elif not ex_gw_port and ri.ex_gw_port:"},{"line_number":468,"context_line":"            self.external_gateway_removed(ri, ri.ex_gw_port,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3ae8d1ca_a99061ed","line":465,"updated":"2014-05-27 21:10:51.000000000","message":"Note to self.  I\u0027m noticing here that external_gateway_added/removed ignore internal_cidrs.","commit_id":"d23bc8fa6e2d8a735a2aa75224b1bc96a3b992f5"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"b1537674759d875445719814b35964a5c3978cdf","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        # IpTablesRule instances"},{"line_number":665,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":666,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":667,"context_line":"        self.assertEqual(len(nat_rules_delta), 0)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    def test_process_router_ipv6v4_interface_added(self):"},{"line_number":670,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FfN0%3D","line":667,"updated":"2014-04-21 11:49:43.000000000","message":"nit, put expected value first (the first arg is expected and second actual).","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"d74960a951783a28a4f7ff40e212221745e4d681","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        # IpTablesRule instances"},{"line_number":665,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":666,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":667,"context_line":"        self.assertEqual(len(nat_rules_delta), 0)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    def test_process_router_ipv6v4_interface_added(self):"},{"line_number":670,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2Fed8%3D","line":667,"in_reply_to":"AAAAXH%2F%2FfN0%3D","updated":"2014-04-21 13:42:16.000000000","message":"sure","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"b1537674759d875445719814b35964a5c3978cdf","unresolved":false,"context_lines":[{"line_number":702,"context_line":"        # IpTablesRule instances"},{"line_number":703,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":704,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":705,"context_line":"        self.assertEqual(len(nat_rules_delta), 1)"},{"line_number":706,"context_line":"        self._verify_snat_rules(nat_rules_delta, router)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"    def test_process_router_interface_removed(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FfNc%3D","line":705,"updated":"2014-04-21 11:49:43.000000000","message":"ditto","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"d74960a951783a28a4f7ff40e212221745e4d681","unresolved":false,"context_lines":[{"line_number":702,"context_line":"        # IpTablesRule instances"},{"line_number":703,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":704,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":705,"context_line":"        self.assertEqual(len(nat_rules_delta), 1)"},{"line_number":706,"context_line":"        self._verify_snat_rules(nat_rules_delta, router)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"    def test_process_router_interface_removed(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2Fed4%3D","line":705,"in_reply_to":"AAAAXH%2F%2FfNc%3D","updated":"2014-04-21 13:42:16.000000000","message":"sure","commit_id":"58f59d2d528f7b059bfcb207e9877abe418ec509"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d09a7f844538b577c8f79fd16becbac041b0d636","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        router \u003d self._prepare_router_data()"},{"line_number":681,"context_line":"        ri \u003d l3_agent.RouterInfo(router[\u0027id\u0027], self.conf.root_helper,"},{"line_number":682,"context_line":"                                 self.conf.use_namespaces, router\u003drouter)"},{"line_number":683,"context_line":"        agent.external_gateway_added \u003d mock.Mock()"},{"line_number":684,"context_line":"        # Process with NAT"},{"line_number":685,"context_line":"        agent.process_router(ri)"},{"line_number":686,"context_line":"        orig_nat_rules \u003d ri.iptables_manager.ipv4[\u0027nat\u0027].rules[:]"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_2aed34f0","line":683,"updated":"2014-05-21 01:51:15.000000000","message":"Why not use mock.patch like the test above for consistency?","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"edf6f7fa840a8594cd5a87c07fcc4e8bc89bbf7f","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        router \u003d self._prepare_router_data()"},{"line_number":681,"context_line":"        ri \u003d l3_agent.RouterInfo(router[\u0027id\u0027], self.conf.root_helper,"},{"line_number":682,"context_line":"                                 self.conf.use_namespaces, router\u003drouter)"},{"line_number":683,"context_line":"        agent.external_gateway_added \u003d mock.Mock()"},{"line_number":684,"context_line":"        # Process with NAT"},{"line_number":685,"context_line":"        agent.process_router(ri)"},{"line_number":686,"context_line":"        orig_nat_rules \u003d ri.iptables_manager.ipv4[\u0027nat\u0027].rules[:]"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_e710d7aa","line":683,"in_reply_to":"7adec928_2aed34f0","updated":"2014-05-21 13:26:43.000000000","message":"I think it can be done that way.\nSimilar thing is done in other places in this file, and that\u0027s actually where I copied it from. I think that this is just another way of mocking a method. If you don\u0027t mind, I will keep it as is.","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d09a7f844538b577c8f79fd16becbac041b0d636","unresolved":false,"context_lines":[{"line_number":708,"context_line":"        router \u003d self._prepare_router_data()"},{"line_number":709,"context_line":"        ri \u003d l3_agent.RouterInfo(router[\u0027id\u0027], self.conf.root_helper,"},{"line_number":710,"context_line":"                                 self.conf.use_namespaces, router\u003drouter)"},{"line_number":711,"context_line":"        agent.external_gateway_added \u003d mock.Mock()"},{"line_number":712,"context_line":"        # Process with NAT"},{"line_number":713,"context_line":"        agent.process_router(ri)"},{"line_number":714,"context_line":"        orig_nat_rules \u003d ri.iptables_manager.ipv4[\u0027nat\u0027].rules[:]"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_4ab9a0eb","line":711,"updated":"2014-05-21 01:51:15.000000000","message":"same here","commit_id":"a6ba569e4f1a3156c9338b8149f30f6e8faddbf8"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"c8c5857c080f8901bc9993627c792f1ecfadff36","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        # IpTablesRule instances"},{"line_number":702,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":703,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":704,"context_line":"        self.assertEqual(0, len(nat_rules_delta))"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def test_process_router_ipv6v4_interface_added(self):"},{"line_number":707,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5adbc538_6e4aed84","line":704,"updated":"2014-05-26 08:07:13.000000000","message":"self.assertFalse(nat_rules_delta)","commit_id":"28b02c1d5a7686e2b9bdd4f42a2e8e1af38a89ce"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"905b6f443e25b0d6cc4acd934441cb838fdb37ac","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        # IpTablesRule instances"},{"line_number":702,"context_line":"        nat_rules_delta \u003d [r for r in ri.iptables_manager.ipv4[\u0027nat\u0027].rules"},{"line_number":703,"context_line":"                           if r not in orig_nat_rules]"},{"line_number":704,"context_line":"        self.assertEqual(0, len(nat_rules_delta))"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def test_process_router_ipv6v4_interface_added(self):"},{"line_number":707,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5adbc538_aaa698bf","line":704,"in_reply_to":"5adbc538_6e4aed84","updated":"2014-05-26 12:44:01.000000000","message":"Done","commit_id":"28b02c1d5a7686e2b9bdd4f42a2e8e1af38a89ce"}]}
