)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I90b4d2485e3e491f496dfb7bdee03d57f393be35"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"5a890539_08fdbf3a","line":10,"updated":"2014-11-13 05:58:04.000000000","message":"What is this 5-tuple?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I90b4d2485e3e491f496dfb7bdee03d57f393be35"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"5a890539_2bfdc76e","line":10,"in_reply_to":"5a890539_08fdbf3a","updated":"2014-11-14 04:34:38.000000000","message":"5-tuple refers to a set of five values that comprise a TCP/IP connection, which includes source IP address/port number, destination IP address/port number and the protocol in use.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7a36f629728d6aa5506349793bceac15ff289641","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-23 17:20:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_34aba98b","line":7,"updated":"2015-04-23 15:10:37.000000000","message":"seperate -\u003e separate\n\nBTW, please consider rewording commit message it is not as readable as your docstrings and comments in code.","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-23 17:20:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_95dc9613","line":7,"in_reply_to":"bab921fb_34aba98b","updated":"2015-04-24 01:24:58.000000000","message":"ok","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7a36f629728d6aa5506349793bceac15ff289641","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_d4c7cd43","line":9,"updated":"2015-04-23 15:10:37.000000000","message":"Conntrack causes security group rule failures...","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_d5d20e00","line":9,"in_reply_to":"bab921fb_d4c7cd43","updated":"2015-04-24 01:24:58.000000000","message":"Done","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7a36f629728d6aa5506349793bceac15ff289641","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_54e29dd6","line":10,"updated":"2015-04-23 15:10:37.000000000","message":"seperate-\u003eseparate","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Use iptables zone to seperate different conntrack"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_f5eab2ab","line":10,"in_reply_to":"bab921fb_54e29dd6","updated":"2015-04-24 01:24:58.000000000","message":"Done","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7a36f629728d6aa5506349793bceac15ff289641","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_f4d1b1fc","line":11,"updated":"2015-04-23 15:10:37.000000000","message":"conntrack zones","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Conntrack will cause security group rule fails when packets share"},{"line_number":10,"context_line":"the same 5-tuple. Use iptables zone option to seperate different"},{"line_number":11,"context_line":"conntrack. Currently this patch only works for OVS agent."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"bab921fb_15e886b3","line":11,"in_reply_to":"bab921fb_f4d1b1fc","updated":"2015-04-24 01:24:58.000000000","message":"Done","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"22e1198687cb804bb4e63470346f7e075e1c81d8","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I90b4d2485e3e491f496dfb7bdee03d57f393be35"},{"line_number":16,"context_line":"Closes-Bug: #1359523"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"3acd31a7_bcdc29e5","line":16,"updated":"2015-04-30 22:07:30.000000000","message":"The change only addresses OVS agent so it should be Partial-Bug:","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"b135633233011b91a633a6520ce8483158df0dd1","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Co-authored-by: shihanzhang \u003cshihanzhang@huawei.com\u003e"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I90b4d2485e3e491f496dfb7bdee03d57f393be35"},{"line_number":16,"context_line":"Closes-Bug: #1359523"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"3acd31a7_c41b4372","line":16,"in_reply_to":"3acd31a7_bcdc29e5","updated":"2015-05-05 03:51:32.000000000","message":"agree, thx","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"}],"neutron/agent/linux/iptables_firewall.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"054061b8a87df3b5e81319de4a5b5bbc8c1815b0","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        net_uuid \u003d self._get_net_uuid(port[\u0027device\u0027])"},{"line_number":102,"context_line":"        if net_uuid not in self.local_zone_map:"},{"line_number":103,"context_line":"            LOG.info(_(\"Net_uuid %s not in local_zone_map\"), net_uuid)"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            lzm \u003d self.local_zone_map[net_uuid]"},{"line_number":106,"context_line":"            lzm.vif_ports.pop(port[\u0027device\u0027], None)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_dc8fce21","line":103,"updated":"2014-09-10 14:48:20.000000000","message":"_LI instead of _","commit_id":"c46cd575b198a984843c2965ea17be6e05ff7683"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7c77c0c466cb139b69c24411148685e496cb47f2","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                self._reclaim_local_zone(net_uuid)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _reclaim_local_zone(self, net_uuid):"},{"line_number":111,"context_line":"        LOG.debug(_(\"Reclaiming local zone of net_uuid %s\"), net_uuid)"},{"line_number":112,"context_line":"        lzm \u003d self.local_zone_map.pop(net_uuid, None)"},{"line_number":113,"context_line":"        if lzm:"},{"line_number":114,"context_line":"            self.available_local_zones.add(lzm.zone)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_c6e3ad31","line":111,"updated":"2014-09-09 02:56:22.000000000","message":"debug no longer should have _()","commit_id":"c46cd575b198a984843c2965ea17be6e05ff7683"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7c77c0c466cb139b69c24411148685e496cb47f2","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _add_raw_chain(self, chain_name):"},{"line_number":164,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":165,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _add_chain_by_name_v4v6(self, chain_name):"},{"line_number":168,"context_line":"        self.iptables.ipv6[\u0027filter\u0027].add_chain(chain_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_c68c8d82","line":165,"updated":"2014-09-09 02:56:22.000000000","message":"Nit: this is the only one that has ipv6 before ipv4.","commit_id":"c46cd575b198a984843c2965ea17be6e05ff7683"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"bc575cb182374c7f2f0cf109e602bebc80d0655d","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        self.sg_members[sg_id] \u003d sg_members"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def prepare_port_filter(self, port):"},{"line_number":101,"context_line":"        LOG.debug(\"Preparing device (%s) filter\", port[\u0027device\u0027])"},{"line_number":102,"context_line":"        self._remove_chains()"},{"line_number":103,"context_line":"        self.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":104,"context_line":"        # each security group has it own chains"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_d9de8b3d","line":101,"updated":"2014-09-15 11:23:25.000000000","message":"Hmm, I know it was commented on Patchset 2 that debug messages should not use _ anymore and Log.Info should use _LI, but you shouldn\u0027t change it elsewhere than your code. Might generate future conflicts as well.","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"96e309c3be831b5397816209843ec7f21a6d318b","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        self.sg_members[sg_id] \u003d sg_members"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def prepare_port_filter(self, port):"},{"line_number":101,"context_line":"        LOG.debug(\"Preparing device (%s) filter\", port[\u0027device\u0027])"},{"line_number":102,"context_line":"        self._remove_chains()"},{"line_number":103,"context_line":"        self.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":104,"context_line":"        # each security group has it own chains"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_1f2d3afe","line":101,"in_reply_to":"fa98f980_d9de8b3d","updated":"2014-09-16 07:18:59.000000000","message":"OK, change them back.","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"bc575cb182374c7f2f0cf109e602bebc80d0655d","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def update_port_filter(self, port):"},{"line_number":109,"context_line":"        LOG.debug(\"Updating device (%s) filter\", port[\u0027device\u0027])"},{"line_number":110,"context_line":"        if port[\u0027device\u0027] not in self.filtered_ports:"},{"line_number":111,"context_line":"            LOG.info(_LI(\u0027Attempted to update port filter which is not \u0027"},{"line_number":112,"context_line":"                       \u0027filtered %s\u0027), port[\u0027device\u0027])"},{"line_number":113,"context_line":"            return"},{"line_number":114,"context_line":"        self._remove_chains()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_39ef97ea","line":111,"updated":"2014-09-15 11:23:25.000000000","message":"ditto","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"bc575cb182374c7f2f0cf109e602bebc80d0655d","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    def remove_port_filter(self, port):"},{"line_number":120,"context_line":"        LOG.debug(\"Removing device (%s) filter\", port[\u0027device\u0027])"},{"line_number":121,"context_line":"        if not self.filtered_ports.get(port[\u0027device\u0027]):"},{"line_number":122,"context_line":"            LOG.info(_LI(\"Attempted to remove port filter which is not \""},{"line_number":123,"context_line":"                       \"filtered %r\"), port)"},{"line_number":124,"context_line":"            return"},{"line_number":125,"context_line":"        self._remove_chains()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_99bfa3cf","line":122,"updated":"2014-09-15 11:23:25.000000000","message":"same","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d97e8a5242f2c9a691b49dc2ecb2d5c3f6cf22d4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        self.enable_ipset \u003d cfg.CONF.SECURITYGROUP.enable_ipset"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_net_uuid(self, vif_id):"},{"line_number":84,"context_line":"        for network_id, zone_mapping in self.local_zone_map.iteritems():"},{"line_number":85,"context_line":"            if vif_id in zone_mapping.vif_ports:"},{"line_number":86,"context_line":"                return network_id"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa98f980_c8802f4c","line":84,"updated":"2014-09-17 12:05:51.000000000","message":"consider items() for py3 compatibility, with loss of performance in py2.x for now)","commit_id":"be36f7fc784ecf8d013680124ad891e48f8046f4"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d97e8a5242f2c9a691b49dc2ecb2d5c3f6cf22d4","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":223,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":224,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":225,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % (device,"},{"line_number":226,"context_line":"                                                                    lzm.zone)"},{"line_number":227,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":228,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa98f980_28f7fbf6","line":225,"updated":"2014-09-17 12:05:51.000000000","message":"nit: could use dict and named format specifiers %(device)s... %(zone)s","commit_id":"be36f7fc784ecf8d013680124ad891e48f8046f4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5e4622be83156b1d7d48c61af72a159825e63a03","unresolved":false,"context_lines":[{"line_number":46,"context_line":"comment_rule \u003d iptables_manager.comment_rule"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class LocalZoneMapping(object):"},{"line_number":50,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":51,"context_line":"        self.zone \u003d zone"},{"line_number":52,"context_line":"        self.vif_ports \u003d vif_ports or {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8c0949_edd17ace","line":49,"updated":"2014-10-31 15:06:13.000000000","message":"that should be really agent-specific and reside on the agent side, or in some common place that could be used by agents.","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"6071f89bfadf68d0df5dede089f11a1541d978eb","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # list of port which has security group"},{"line_number":69,"context_line":"        self.filtered_ports \u003d {}"},{"line_number":70,"context_line":"        self.available_local_zones \u003d set(xrange(constants.MIN_VLAN_TAG,"},{"line_number":71,"context_line":"                                                constants.MAX_VLAN_TAG))"},{"line_number":72,"context_line":"        self.local_zone_map \u003d {}"},{"line_number":73,"context_line":"        self._add_fallback_chain_v4v6()"},{"line_number":74,"context_line":"        self._defer_apply \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8c0949_6b09162c","line":71,"updated":"2014-10-30 08:49:43.000000000","message":"The maximum number of zones you can create is limited with 2^16, see\n\nhttps://github.com/torvalds/linux/commit/5d0aa2ccd4699a01cfdf14886191c249d7b45a01#diff-4d53dd1f3ad5275bc2e79f2c12af6e68R8","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5e4622be83156b1d7d48c61af72a159825e63a03","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # list of port which has security group"},{"line_number":69,"context_line":"        self.filtered_ports \u003d {}"},{"line_number":70,"context_line":"        self.available_local_zones \u003d set(xrange(constants.MIN_VLAN_TAG,"},{"line_number":71,"context_line":"                                                constants.MAX_VLAN_TAG))"},{"line_number":72,"context_line":"        self.local_zone_map \u003d {}"},{"line_number":73,"context_line":"        self._add_fallback_chain_v4v6()"},{"line_number":74,"context_line":"        self._defer_apply \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8c0949_2d02a23e","line":71,"in_reply_to":"7a8c0949_6b09162c","updated":"2014-10-31 15:06:13.000000000","message":"I guess this should be limited to a number of networks L2 implementation supports.\nSo it\u0027s better if agent initializes it. For OVS it\u0027s truly 2^12","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f358de023bea71511befe04387a1e7e55e801352","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":229,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":230,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":231,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":232,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % (device,"},{"line_number":233,"context_line":"                                                                    lzm.zone)"},{"line_number":234,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_de076dc8","line":231,"updated":"2014-10-16 17:39:42.000000000","message":"Will there always be a qvb- port?  What about non-OVS configs?","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5e4622be83156b1d7d48c61af72a159825e63a03","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":229,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":230,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":231,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":232,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % (device,"},{"line_number":233,"context_line":"                                                                    lzm.zone)"},{"line_number":234,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8c0949_ad185285","line":231,"in_reply_to":"7a8c0949_bff7b88b","updated":"2014-10-31 15:06:13.000000000","message":"As I commented previously, code related to zone mapping should reside in the agent, iptables-related code should have interface to accept zone information and code to apply them to devices.","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"eb96cd5dc921871203f4e4d72717dd10ba3dbce5","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":229,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":230,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":231,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":232,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % (device,"},{"line_number":233,"context_line":"                                                                    lzm.zone)"},{"line_number":234,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8c0949_bff7b88b","line":231,"in_reply_to":"9aa7fdbe_c753d96a","updated":"2014-10-30 11:49:34.000000000","message":"I would take (1), much more clean and easier to maintain.","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"eaa6b8f37b0b51e6a0c21c5a8f136d9520c53edf","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":229,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":230,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":231,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":232,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % (device,"},{"line_number":233,"context_line":"                                                                    lzm.zone)"},{"line_number":234,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_c753d96a","line":231,"in_reply_to":"baa201ad_de076dc8","updated":"2014-10-20 02:33:21.000000000","message":"Oh, thanks for your comment. This patch currently supports OVS configs only. To fix this problem, I have two choices:\n\n(1) Move the related code to OVSHybridIptablesFirewallDriver class, so it will take effect only when OVS is configured.\n\n(2) Add if block to check if OVSHybridIptablesFirewallDriver is used via cfg.CONF.firewall_driver. Enable the related code only when OVS is configured.\n\nWhat\u0027s your suggestion?","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7c406ee42eff85a5350ac5b4a2c1258ce341007a","unresolved":false,"context_lines":[{"line_number":617,"context_line":"    def _add_chain(self, port, direction):"},{"line_number":618,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._add_chain(port,"},{"line_number":619,"context_line":"                                                                direction)"},{"line_number":620,"context_line":"        self._add_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8c0949_2978ab8e","line":620,"updated":"2014-11-05 10:55:17.000000000","message":"please, add a newline here","commit_id":"f3c8a98e01f3a042beca7e593b868cfa8d08e0c8"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"308232152cc4fe29463e0c41a00f3646a7d3bea9","unresolved":false,"context_lines":[{"line_number":617,"context_line":"    def _add_chain(self, port, direction):"},{"line_number":618,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._add_chain(port,"},{"line_number":619,"context_line":"                                                                direction)"},{"line_number":620,"context_line":"        self._add_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8c0949_5eb5a1cb","line":620,"in_reply_to":"7a8c0949_2978ab8e","updated":"2014-11-06 08:42:59.000000000","message":"fixed, thanks!","commit_id":"f3c8a98e01f3a042beca7e593b868cfa8d08e0c8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                                               wrap\u003dFalse)"},{"line_number":133,"context_line":"            self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING,"},{"line_number":134,"context_line":"                                               \u0027-j $%s\u0027 % RAW_PREROUTING,"},{"line_number":135,"context_line":"                                               wrap\u003dFalse)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _remove_chains(self):"},{"line_number":138,"context_line":"        \"\"\"Remove ingress and egress chain for a port.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_8b0a891f","line":135,"updated":"2014-11-13 05:58:04.000000000","message":"I\u0027m not sure I know what these are for.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fd5c6cb07bcfd2ed9fb5475c77da61de0315725c","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                                               wrap\u003dFalse)"},{"line_number":133,"context_line":"            self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING,"},{"line_number":134,"context_line":"                                               \u0027-j $%s\u0027 % RAW_PREROUTING,"},{"line_number":135,"context_line":"                                               wrap\u003dFalse)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _remove_chains(self):"},{"line_number":138,"context_line":"        \"\"\"Remove ingress and egress chain for a port.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_db594c36","line":135,"in_reply_to":"5a890539_8b0a891f","updated":"2014-11-24 22:01:15.000000000","message":"Right.  If you want to have neutron manage the PREROUTING chain in the raw table I think you should add this over in the iptables_manager code.\n\nActually, I see that code is already there.  Why does this need to be non-wrapped, which is what the iptables_manager is instantiating?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fd5c6cb07bcfd2ed9fb5475c77da61de0315725c","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            self._remove_chain(port, EGRESS_DIRECTION)"},{"line_number":146,"context_line":"            self._remove_chain(port, SPOOF_FILTER)"},{"line_number":147,"context_line":"        self._remove_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":148,"context_line":"        self._remove_raw_chain(RAW_PREROUTING)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _setup_chain(self, port, DIRECTION):"},{"line_number":151,"context_line":"        self._add_chain(port, DIRECTION)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_1b6674ed","line":148,"updated":"2014-11-24 22:01:15.000000000","message":"If managed by iptables_manager this should go away.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f053bfc1b3b30c7ff05b50879c102f9664b7f7b3","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            self._remove_chain(port, EGRESS_DIRECTION)"},{"line_number":146,"context_line":"            self._remove_chain(port, SPOOF_FILTER)"},{"line_number":147,"context_line":"        self._remove_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":148,"context_line":"        self._remove_raw_chain(RAW_PREROUTING)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _setup_chain(self, port, DIRECTION):"},{"line_number":151,"context_line":"        self._add_chain(port, DIRECTION)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_dc9f0e02","line":148,"in_reply_to":"3a961159_2d9c7b69","updated":"2014-12-08 22:53:20.000000000","message":"But it\u0027s really the iptables_manager\u0027s job to manage these \"base\" chains.  We should be able to clean-up rules correctly without doing this.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"f2779f59ea004c458618de36eb7847eca47ef1f3","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            self._remove_chain(port, EGRESS_DIRECTION)"},{"line_number":146,"context_line":"            self._remove_chain(port, SPOOF_FILTER)"},{"line_number":147,"context_line":"        self._remove_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":148,"context_line":"        self._remove_raw_chain(RAW_PREROUTING)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _setup_chain(self, port, DIRECTION):"},{"line_number":151,"context_line":"        self._add_chain(port, DIRECTION)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_0a63f7dc","line":148,"in_reply_to":"3a961159_dc9f0e02","updated":"2014-12-09 11:38:41.000000000","message":"Though \"PREROUTING\" is a \"base\" chain here, it works like \"SG_CHAIN\". The conntrack zone related iptable rules are inserted directly to this chain. When a port is updated, _remove_chains_apply will be called to remove old iptable rules, then _setup_chains_apply will be called to create new iptable rules.\n\nIf we want to leave this chain to be managed by iptable manager, we need to add a new chain to hold the conntrack zone related iptable rules.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"d1d0a5eef69785ffee0a7fe61653647027ef7757","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            self._remove_chain(port, EGRESS_DIRECTION)"},{"line_number":146,"context_line":"            self._remove_chain(port, SPOOF_FILTER)"},{"line_number":147,"context_line":"        self._remove_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":148,"context_line":"        self._remove_raw_chain(RAW_PREROUTING)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _setup_chain(self, port, DIRECTION):"},{"line_number":151,"context_line":"        self._add_chain(port, DIRECTION)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_2d9c7b69","line":148,"in_reply_to":"5a890539_1b6674ed","updated":"2014-12-08 10:03:46.000000000","message":"Some port related rules will be added to this chain so when ports are updated, this chain needs to be removed and set up again, that\u0027s why I put these codes in iptable_firewall.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        self.iptables.ipv6[\u0027filter\u0027].add_rule(\u0027sg-fallback\u0027, \u0027-j DROP\u0027,"},{"line_number":164,"context_line":"                                              comment\u003dic.UNMATCH_DROP)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _add_raw_chain(self, chain_name):"},{"line_number":167,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":168,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_68c003e1","line":166,"updated":"2014-11-13 05:58:04.000000000","message":"Other methods like this are named with _v4v6.  This looks so similar to _add_chain_by_name_v4v6.  It seems like it should be named consistently.  Maybe even share code?  I\u0027m not sure it is my favorite naming convention but should we be consistent?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":168,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_chain_by_name_v4v6(self, chain_name):"},{"line_number":171,"context_line":"        self.iptables.ipv4[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":172,"context_line":"        self.iptables.ipv6[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_48bd0768","line":170,"updated":"2014-11-13 05:58:04.000000000","message":"nit:  It took me a minute to figure out that you just swapped the ipv4 and ipv6 lines in this method.  Any particular reason?  It doesn\u0027t seem to support this patch.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":168,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_chain_by_name_v4v6(self, chain_name):"},{"line_number":171,"context_line":"        self.iptables.ipv4[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":172,"context_line":"        self.iptables.ipv6[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_cb7c43b8","line":170,"in_reply_to":"5a890539_48bd0768","updated":"2014-11-14 04:34:38.000000000","message":"A comment on the previous patch asked why only in this function \u0027ipv6\u0027 is placed before \u0027ipv4\u0027, so I adjusted their position a bit.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fd5c6cb07bcfd2ed9fb5475c77da61de0315725c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":168,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_chain(chain_name)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _add_chain_by_name_v4v6(self, chain_name):"},{"line_number":171,"context_line":"        self.iptables.ipv4[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":172,"context_line":"        self.iptables.ipv6[\u0027filter\u0027].add_chain(chain_name)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_587ba2bd","line":170,"in_reply_to":"5a890539_cb7c43b8","updated":"2014-11-24 22:01:15.000000000","message":"@Carl, yes that was my nit - an earlier version of _add_raw_chain() had v6/v4 and I pointed it out, guess this one did too.  Probably doesn\u0027t matter but my eye noticed it.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"dd66f4779e88eecd8b45525e19f1df739d37870f","unresolved":false,"context_lines":[{"line_number":608,"context_line":"    def _add_raw_chain_rules(self, port, direction):"},{"line_number":609,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":610,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":611,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":612,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":613,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":614,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_d4acfba2","line":611,"updated":"2014-11-13 16:21:56.000000000","message":"\u0027qvb\u0027 only exists if you are doing hybrid plugging. While it\u0027s correct that security group work only with that kind of plugging, hardcoding this assumption and especially the name is wrong. On the other hand, we are already hardcoding it... in the OVS_HYBRID_TAP_PREFIX constant that you can use here.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":608,"context_line":"    def _add_raw_chain_rules(self, port, direction):"},{"line_number":609,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":610,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":611,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":612,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":613,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":614,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_e807931b","line":611,"updated":"2014-11-13 05:58:04.000000000","message":"Hmmm.  Should qvb be hard-coded here?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fd5c6cb07bcfd2ed9fb5475c77da61de0315725c","unresolved":false,"context_lines":[{"line_number":608,"context_line":"    def _add_raw_chain_rules(self, port, direction):"},{"line_number":609,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":610,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":611,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":612,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":613,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":614,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_98318a5c","line":611,"in_reply_to":"5a890539_d4acfba2","updated":"2014-11-24 22:01:15.000000000","message":"I had the same question about qvb in PS6 and I thought the decision was to:\n\n(1) Move the related code to OVSHybridIptablesFirewallDriver class, so it will take effect only when OVS is configured.\n\nWas that not possible?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"dd66f4779e88eecd8b45525e19f1df739d37870f","unresolved":false,"context_lines":[{"line_number":610,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":611,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":612,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":613,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":614,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":615,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":616,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_f4af3792","line":613,"updated":"2014-11-13 16:21:56.000000000","message":"Is it correct to assume a port will always specify a zone_id? Is there a risk of triggering KeyError?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":610,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":611,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":612,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":613,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":614,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":615,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":616,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_4e5b012e","line":613,"in_reply_to":"5a890539_f4af3792","updated":"2014-11-14 04:34:38.000000000","message":"If OVS agent is used, it will provide zone_id to each port. This is done in \"prepare_devices_filter\" and \"refresh_firewall\" in \"SecurityGroupAgentRpcMixin\" class. I assume this driver will work with OVS agent.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":31,"context_line":"INGRESS_DIRECTION \u003d \u0027ingress\u0027"},{"line_number":32,"context_line":"EGRESS_DIRECTION \u003d \u0027egress\u0027"},{"line_number":33,"context_line":"SPOOF_FILTER \u003d \u0027spoof-filter\u0027"},{"line_number":34,"context_line":"RAW_PREROUTING \u003d \u0027PREROUTING\u0027"},{"line_number":35,"context_line":"CHAIN_NAME_PREFIX \u003d {INGRESS_DIRECTION: \u0027i\u0027,"},{"line_number":36,"context_line":"                     EGRESS_DIRECTION: \u0027o\u0027,"},{"line_number":37,"context_line":"                     SPOOF_FILTER: \u0027s\u0027}"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_bda4f24b","line":34,"updated":"2015-01-12 21:40:44.000000000","message":"This can be removed, see comments below.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _setup_chains_apply(self, ports):"},{"line_number":120,"context_line":"        self._add_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":121,"context_line":"        self._add_raw_chain(RAW_PREROUTING)"},{"line_number":122,"context_line":"        for port in ports.values():"},{"line_number":123,"context_line":"            self._setup_chain(port, INGRESS_DIRECTION)"},{"line_number":124,"context_line":"            self._setup_chain(port, EGRESS_DIRECTION)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_9d1d76c1","line":121,"updated":"2015-01-12 21:40:44.000000000","message":"I don\u0027t think you need to do this.  Since you\u0027re defining the raw PREROUTING chain as a builtin chain in iptables_manager, it will by default add a wrapped chain for it, which will create:\n\n-A PREROUTING -j neutron-openvswi-PREROUTING","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                                               wrap\u003dFalse)"},{"line_number":130,"context_line":"            self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING,"},{"line_number":131,"context_line":"                                               \u0027-j $%s\u0027 % RAW_PREROUTING,"},{"line_number":132,"context_line":"                                               wrap\u003dFalse)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _remove_chains(self):"},{"line_number":135,"context_line":"        \"\"\"Remove ingress and egress chain for a port.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_bde1522c","line":132,"updated":"2015-01-12 21:40:44.000000000","message":"This is adding this rule:\n\n-A PREROUTING -j neutron-openvswi-PREROUTING\n\nBut that\u0027s already there from just instantiating the iptables_manager.  Related to above comment.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            self._remove_chain(port, EGRESS_DIRECTION)"},{"line_number":143,"context_line":"            self._remove_chain(port, SPOOF_FILTER)"},{"line_number":144,"context_line":"        self._remove_chain_by_name_v4v6(SG_CHAIN)"},{"line_number":145,"context_line":"        self._remove_raw_chain(RAW_PREROUTING)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def _setup_chain(self, port, DIRECTION):"},{"line_number":148,"context_line":"        self._add_chain(port, DIRECTION)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_bd71520e","line":145,"updated":"2015-01-12 21:40:44.000000000","message":"This can go away too, as the initial jump chain can just stay around.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":575,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":576,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":577,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":578,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(RAW_PREROUTING, jump_rule)"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"    def _add_chain(self, port, direction):"},{"line_number":581,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._add_chain(port,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_dd929efb","line":578,"updated":"2015-01-12 21:40:44.000000000","message":"These two RAW_PREROUTING occurences can just be \u0027PREROUTING\u0027.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"30a48836bf1663ed5c0eb98eb00b8b64e966b66f","unresolved":false,"context_lines":[{"line_number":580,"context_line":"    def _add_chain(self, port, direction):"},{"line_number":581,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._add_chain(port,"},{"line_number":582,"context_line":"                                                                direction)"},{"line_number":583,"context_line":"        self._add_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_e06075d2","line":583,"updated":"2015-01-13 14:54:34.000000000","message":"You also need to define the remove versions of these two methods as well, that way when the port is torn down the device rules with the \"--zone XX\" are removed as well.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"6c69d8f4a12d38cd2ccee66cf7106d1a0127a3de","unresolved":false,"context_lines":[{"line_number":580,"context_line":"    def _add_chain(self, port, direction):"},{"line_number":581,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._add_chain(port,"},{"line_number":582,"context_line":"                                                                direction)"},{"line_number":583,"context_line":"        self._add_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_9080bb4a","line":583,"in_reply_to":"3a961159_e06075d2","updated":"2015-01-14 12:10:09.000000000","message":"Thanks. I follow your suggestion and overwrite the \"_remove_chain\" function. Now I can leave PREROUTING chain to be managed by iptable manager.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"f5b68cfc2e4b386707e55172f69e52c09e216640","unresolved":false,"context_lines":[{"line_number":575,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":576,"context_line":"        return jump_rule"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"    def _add_raw_chain_rules(self, port, direction):"},{"line_number":579,"context_line":"        jump_rule \u003d self._get_jump_rule(port, direction)"},{"line_number":580,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(\u0027PREROUTING\u0027, jump_rule)"},{"line_number":581,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(\u0027PREROUTING\u0027, jump_rule)"}],"source_content_type":"text/x-python","patch_set":21,"id":"1a930d6b_da6da7cd","line":578,"updated":"2015-01-27 11:08:40.000000000","message":"(no action requires)\n\nKeep the called function next to the caller for better readability.","commit_id":"c1e809d8a4a10b91095481b08c4618b9c07a19da"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"f5b68cfc2e4b386707e55172f69e52c09e216640","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].add_rule(\u0027PREROUTING\u0027, jump_rule)"},{"line_number":581,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].add_rule(\u0027PREROUTING\u0027, jump_rule)"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"    def _remove_raw_chain_rules(self, port, direction):"},{"line_number":584,"context_line":"        jump_rule \u003d self._get_jump_rule(port, direction)"},{"line_number":585,"context_line":"        self.iptables.ipv4[\u0027raw\u0027].remove_rule(\u0027PREROUTING\u0027, jump_rule)"},{"line_number":586,"context_line":"        self.iptables.ipv6[\u0027raw\u0027].remove_rule(\u0027PREROUTING\u0027, jump_rule)"}],"source_content_type":"text/x-python","patch_set":21,"id":"1a930d6b_1a6bafb7","line":583,"updated":"2015-01-27 11:08:40.000000000","message":"(no action requires)\n\nKeep the called function next to the caller for better readability.","commit_id":"c1e809d8a4a10b91095481b08c4618b9c07a19da"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"dbdb80d72c211323a1acb946ae4f98a8b5a9aa53","unresolved":false,"context_lines":[{"line_number":578,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":579,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":580,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":581,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":582,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":583,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":584,"context_line":"        return jump_rule"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_61a6deaf","line":581,"updated":"2015-02-05 09:09:16.000000000","message":"i would prefer we define qvb using a constant","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d450386d10e8469504b482d930672c27551e2c87","unresolved":false,"context_lines":[{"line_number":578,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":579,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":580,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":581,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":582,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":583,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":584,"context_line":"        return jump_rule"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_b6e65642","line":581,"in_reply_to":"da86d52c_61a6deaf","updated":"2015-02-05 12:17:46.000000000","message":"That makes sense, don\u0027t we have qvb as a constant somewhere around the code?","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":581,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":582,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":583,"context_line":"                                                    device, port[\u0027zone_id\u0027])"},{"line_number":584,"context_line":"        return jump_rule"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _add_raw_chain_rules(self, port, direction):"},{"line_number":587,"context_line":"        jump_rule \u003d self._get_jump_rule(port, direction)"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_cd6d5e9b","line":584,"updated":"2015-02-03 10:43:45.000000000","message":"if you\u0027re going to push another patchset please consider merging the two statements above","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":602,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":603,"context_line":"                                                                   direction)"},{"line_number":604,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":605,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_6dde3241","line":604,"updated":"2015-02-03 10:43:45.000000000","message":"question: why is the above if condition required?","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ae6623681c98f07c0a318781db8a9fe79bed4085","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":602,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":603,"context_line":"                                                                   direction)"},{"line_number":604,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":605,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_c72eed42","line":604,"in_reply_to":"da86d52c_6dde3241","updated":"2015-02-04 09:31:34.000000000","message":"The caller of this method \"_remove_chains_apply\" will pass three kinds of \"direction\"s: INGRESS_DIRECTION, EGRESS_DIRECTION and SPOOF_FILTER, only the first two are needed to be handled.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d160a542c168b495a58f9af1401662deb749d057","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":602,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":603,"context_line":"                                                                   direction)"},{"line_number":604,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":605,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_f794f58d","line":604,"in_reply_to":"da86d52c_c72eed42","updated":"2015-02-27 09:13:45.000000000","message":"makes sense, could you add a comment right above explaining why it\u0027s being restricted to those? It\u0027s not obvious from the code.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"de57ae65057c8898ec6a03a5db03737ad9fc43e6","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":602,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":603,"context_line":"                                                                   direction)"},{"line_number":604,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":605,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_2aa3f4b2","line":604,"in_reply_to":"da86d52c_c72eed42","updated":"2015-02-25 08:46:30.000000000","message":"thanks for the explanation","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"7a36f629728d6aa5506349793bceac15ff289641","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        return (self.OVS_HYBRID_TAP_PREFIX + port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":686,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":687,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":688,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":32,"id":"bab921fb_714a5385","line":685,"updated":"2015-04-23 15:10:37.000000000","message":"I think it is better not to uselessly call self._get_device_name in case direction \u003d\u003d INGRESS_DIRECTION, for as I understand in that case the value that was previously assigned to \"device\" is not used. So consider doing something like:\n\nif direction \u003d\u003d INGRESS_DIRECTION:\n    device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]\nelse:\n    device \u003d self._get_device_name(port)","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        return (self.OVS_HYBRID_TAP_PREFIX + port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        device \u003d self._get_device_name(port)"},{"line_number":686,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":687,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":688,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":32,"id":"bab921fb_159ac663","line":685,"in_reply_to":"bab921fb_714a5385","updated":"2015-04-24 01:24:58.000000000","message":"agree, thanks for your review and suggestion","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"9376f0b5358a28f0c12d8f70bb20f27ddfda1eb5","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_1530bc55","line":686,"updated":"2015-04-29 22:37:03.000000000","message":"Is it possible to avoid using qvb? ... as the device name is generated by nova not neutron","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"0a8088a7803699c6ea5638daa6bf6d28782b4c8a","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_3a95e7e3","line":686,"updated":"2015-04-29 22:47:34.000000000","message":"nit: I suggest to wrap this line into a separate method.\n\nWhile from the code stand point it might not make much sense, but from code dependency standpoint in this line you\u0027re making assumption about some external implementation (e.g. usage of qvb prefix) which may change.\nThat\u0027s, imo, the reason to extract this line in a method and provide comments to it.","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b5532dc5131b5aef44465beb40914eecd8d2e0be","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_5c04187d","line":686,"in_reply_to":"3acd31a7_3a95e7e3","updated":"2015-04-30 05:57:39.000000000","message":"In the case of linux bridge we still use the qvb extra bridges??\n\nI\u0027m not sure this work with ML2-LB + qvb... but I\u0027ve never played with LB, I must admit.","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"b135633233011b91a633a6520ce8483158df0dd1","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_0416db4b","line":686,"in_reply_to":"3acd31a7_3cc81922","updated":"2015-05-05 03:51:32.000000000","message":"with ML2+LB, the port will not has \u0027zone_id\u0027, so it can\u0027t go here, you can see line#694, but I agree with enikanorov that wrap this line into a separate method","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"f4f70bbfacc739cd69c1e0cfc9833f4be33d6c25","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_bfaaf417","line":686,"in_reply_to":"3acd31a7_3fab848b","updated":"2015-04-30 11:37:09.000000000","message":"Yeah, but my question is, do this break behavior for a ML2-LB using iptables_firewall (if that can happen, which I\u0027m not sure of).\n\nWhich we target one mechanism it doesn\u0027t mean we can break others :)","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"a4b6633d69a71ba35d97b141bb09fd8ac509d411","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_e569eb8c","line":686,"in_reply_to":"3acd31a7_42a54702","updated":"2015-04-30 19:48:21.000000000","message":"I\u0027m not sure why LB is even discussed here. qvb is created by nova vif driver","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7b0b572b0cfe944d53a6f3f6545f73ebfebcba58","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_3fab848b","line":686,"in_reply_to":"3acd31a7_5c04187d","updated":"2015-04-30 11:27:08.000000000","message":"According to the commit message, the commit only addresses ML2+OVS ... which is strange as ML2+LB seems to address!","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f6aae9f16a2b1a4bd640c806be465b9321e7829d","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_42a54702","line":686,"in_reply_to":"3acd31a7_bfaaf417","updated":"2015-04-30 11:41:16.000000000","message":"it should break nothing as with ML2+LB it defines \"unmatchable\" rules (--physdev-in qvb... is unmatchable with LB) but it\u0027s inefficient and confusing.","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"22e1198687cb804bb4e63470346f7e075e1c81d8","unresolved":false,"context_lines":[{"line_number":683,"context_line":""},{"line_number":684,"context_line":"    def _get_jump_rule(self, port, direction):"},{"line_number":685,"context_line":"        if direction \u003d\u003d INGRESS_DIRECTION:"},{"line_number":686,"context_line":"            device \u003d (\"qvb%s\" % port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":687,"context_line":"        else:"},{"line_number":688,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":689,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_3cc81922","line":686,"in_reply_to":"3acd31a7_e569eb8c","updated":"2015-04-30 22:07:30.000000000","message":"At least, because the change can address also LB? and the change claims to close a bug it only partially solves","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"9376f0b5358a28f0c12d8f70bb20f27ddfda1eb5","unresolved":false,"context_lines":[{"line_number":710,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":711,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":712,"context_line":"                                                                   direction)"},{"line_number":713,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":714,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_b58908cd","line":713,"updated":"2015-04-29 22:37:03.000000000","message":"afaik, there is only 2 directions so the condition is always verified? moreover _add_chain always call _add_raw_chain so _remove_chain should always call _remove_raw_chain?","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b5532dc5131b5aef44465beb40914eecd8d2e0be","unresolved":false,"context_lines":[{"line_number":710,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":711,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":712,"context_line":"                                                                   direction)"},{"line_number":713,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":714,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_bcc7ac44","line":713,"in_reply_to":"3acd31a7_b58908cd","updated":"2015-04-30 05:57:39.000000000","message":"see line 174, we also have \"SPOOF\" direction, ... yeah, not very cool, may be it\u0027s worth adding a comment on top of the if..","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"7b0b572b0cfe944d53a6f3f6545f73ebfebcba58","unresolved":false,"context_lines":[{"line_number":710,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":711,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":712,"context_line":"                                                                   direction)"},{"line_number":713,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":714,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_bf9f945e","line":713,"in_reply_to":"3acd31a7_bcc7ac44","updated":"2015-04-30 11:27:08.000000000","message":"it\u0027s still not coherent with __add_chain behavior","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"b135633233011b91a633a6520ce8483158df0dd1","unresolved":false,"context_lines":[{"line_number":710,"context_line":"    def _remove_chain(self, port, direction):"},{"line_number":711,"context_line":"        super(OVSHybridIptablesFirewallDriver, self)._remove_chain(port,"},{"line_number":712,"context_line":"                                                                   direction)"},{"line_number":713,"context_line":"        if direction in [INGRESS_DIRECTION, EGRESS_DIRECTION]:"},{"line_number":714,"context_line":"            self._remove_raw_chain_rules(port, direction)"}],"source_content_type":"text/x-python","patch_set":34,"id":"3acd31a7_a1e03997","line":713,"in_reply_to":"3acd31a7_bf9f945e","updated":"2015-05-05 03:51:32.000000000","message":"no one called \u0027_add_chain\u0027 with parameter \"SPOOF_FILTER\", but  \nfor code coherent, I agree that it is better to a check as \u0027_remove_chain\u0027","commit_id":"8547aa00fae05bacb3305c402f96bc3230eaa3fa"}],"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7c77c0c466cb139b69c24411148685e496cb47f2","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self.ipv4.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":326,"context_line":"        builtin_chains[4].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":327,"context_line":"        self.ipv6.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":328,"context_line":"        builtin_chains[6].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"        for ip_version in builtin_chains:"},{"line_number":331,"context_line":"            if ip_version \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_a66b0984","line":328,"updated":"2014-09-09 02:56:22.000000000","message":"You\u0027ll need a rebase here as some code merged the other day.\n\nAlso, you\u0027re adding one for IPv6 as well, but is there any code (besides what\u0027s in this patch) that would ever need that?","commit_id":"c46cd575b198a984843c2965ea17be6e05ff7683"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"66f3f51975b6fae3d550d7ca3ee64b314c12e1f3","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self.ipv4.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":326,"context_line":"        builtin_chains[4].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":327,"context_line":"        self.ipv6.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":328,"context_line":"        builtin_chains[6].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"        for ip_version in builtin_chains:"},{"line_number":331,"context_line":"            if ip_version \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_4a502c32","line":328,"in_reply_to":"fa98f980_a66b0984","updated":"2014-09-12 09:39:26.000000000","message":"iptables_firewall will add chain and rule to ipv6[\u0027raw\u0027].","commit_id":"c46cd575b198a984843c2965ea17be6e05ff7683"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"        self.ipv4.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":327,"context_line":"        builtin_chains[4].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":328,"context_line":"        self.ipv6.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":329,"context_line":"        builtin_chains[6].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for ip_version in builtin_chains:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_683563f6","line":328,"updated":"2014-11-13 05:58:04.000000000","message":"I\u0027m not sure how this addition fits with this patch.  Maybe you could help me understand.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"dd66f4779e88eecd8b45525e19f1df739d37870f","unresolved":false,"context_lines":[{"line_number":326,"context_line":"        self.ipv4.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":327,"context_line":"        builtin_chains[4].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":328,"context_line":"        self.ipv6.update({\u0027raw\u0027: IptablesTable(binary_name\u003dself.wrap_name)})"},{"line_number":329,"context_line":"        builtin_chains[6].update({\u0027raw\u0027: [\u0027PREROUTING\u0027, \u0027OUTPUT\u0027]})"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for ip_version in builtin_chains:"},{"line_number":332,"context_line":"            if ip_version \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_1496834c","line":329,"updated":"2014-11-13 16:21:56.000000000","message":"I reckon this is for preparing the agent for handling the raw table as well. Now, this __init__ method could really use some local refactoring (which is outside the scope of this patch)","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"}],"neutron/agent/securitygroups_rpc.py":[{"author":{"_account_id":12215,"name":"Alexey Miroshkin","email":"alexey.miroshkin@ru.ibm.com","username":"amirosh"},"change_message_id":"3edcbbf438a9769206c3ca832c44edf1aa952c23","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"class LocalZoneMapping(object):"},{"line_number":153,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":154,"context_line":"        self.zone \u003d zone"},{"line_number":155,"context_line":"        self.vif_ports \u003d vif_ports or {}"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_7f67d725","line":153,"updated":"2014-11-12 09:25:27.000000000","message":"Nit: vif_ports\u003d{} \nthen later\nself.vif_ports \u003d vif_ports","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"98d21680ee24dd3f898e82c3962e44bdcd24005c","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"class LocalZoneMapping(object):"},{"line_number":153,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":154,"context_line":"        self.zone \u003d zone"},{"line_number":155,"context_line":"        self.vif_ports \u003d vif_ports or {}"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_026913be","line":153,"in_reply_to":"5a890539_7f67d725","updated":"2014-11-12 12:05:14.000000000","message":"No. It\u0027s not a good idea to use a mutable value as a default arg.\n\nhttp://docs.python-guide.org/en/latest/writing/gotchas/","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    \"\"\""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def __init__(self):"},{"line_number":164,"context_line":"        self.available_local_zones \u003d set(moves.xrange(q_const.MIN_VLAN_TAG,"},{"line_number":165,"context_line":"                                                      q_const.MAX_VLAN_TAG))"},{"line_number":166,"context_line":"        self.local_zone_map \u003d {}"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_ab72e5aa","line":164,"updated":"2014-11-13 05:58:04.000000000","message":"nit:  I\u0027m not sure I\u0027d bother with six.moves here.  Just use range.  The imagined performance benefit with python 2 -- which would be imperceivable in this case -- doesn\u0027t justify pulling in six.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    \"\"\""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def __init__(self):"},{"line_number":164,"context_line":"        self.available_local_zones \u003d set(moves.xrange(q_const.MIN_VLAN_TAG,"},{"line_number":165,"context_line":"                                                      q_const.MAX_VLAN_TAG))"},{"line_number":166,"context_line":"        self.local_zone_map \u003d {}"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_0e8ad969","line":164,"in_reply_to":"5a890539_ab72e5aa","updated":"2014-11-14 04:34:38.000000000","message":"honestly I just follow how available_local_vlans is initialized here.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    def provision_local_zone(self, port):"},{"line_number":169,"context_line":"        net_uuid \u003d port[\u0027network_id\u0027]"},{"line_number":170,"context_line":"        if net_uuid not in self.local_zone_map:"},{"line_number":171,"context_line":"            zone_id \u003d self.available_local_zones.pop()"},{"line_number":172,"context_line":"            self.local_zone_map[net_uuid] \u003d LocalZoneMapping(zone_id)"},{"line_number":173,"context_line":"        lzm \u003d self.local_zone_map[net_uuid]"},{"line_number":174,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_43286634","line":171,"updated":"2014-11-13 05:58:04.000000000","message":"What happens when the agent gets restarted?  We throw everything away and start over?  There needs to be some continuity on agent restart.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    def provision_local_zone(self, port):"},{"line_number":169,"context_line":"        net_uuid \u003d port[\u0027network_id\u0027]"},{"line_number":170,"context_line":"        if net_uuid not in self.local_zone_map:"},{"line_number":171,"context_line":"            zone_id \u003d self.available_local_zones.pop()"},{"line_number":172,"context_line":"            self.local_zone_map[net_uuid] \u003d LocalZoneMapping(zone_id)"},{"line_number":173,"context_line":"        lzm \u003d self.local_zone_map[net_uuid]"},{"line_number":174,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_4e2a212d","line":171,"in_reply_to":"5a890539_43286634","updated":"2014-11-14 04:34:38.000000000","message":"After agent gets restarted, agent will reallocate a new local zone for each port. We just need to guarantee that ports in the same network are assigned the same local zone. It\u0027s not necessary that the zone id for each port remains the same.\n\nIt\u0027s true that after restart, ports belonging to the same network but residing in different hosts may have different zone id, however, the \"CT --zone zone_id\" rule we add only takes effect in the local host and will not affect the traffic between hosts.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"77a7e98a778f9614b2945a2a008b465b97e52279","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    def provision_local_zone(self, port):"},{"line_number":169,"context_line":"        net_uuid \u003d port[\u0027network_id\u0027]"},{"line_number":170,"context_line":"        if net_uuid not in self.local_zone_map:"},{"line_number":171,"context_line":"            zone_id \u003d self.available_local_zones.pop()"},{"line_number":172,"context_line":"            self.local_zone_map[net_uuid] \u003d LocalZoneMapping(zone_id)"},{"line_number":173,"context_line":"        lzm \u003d self.local_zone_map[net_uuid]"},{"line_number":174,"context_line":"        lzm.vif_ports[port[\u0027device\u0027]] \u003d port"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_9e018e3a","line":171,"in_reply_to":"5a890539_4e2a212d","updated":"2014-11-14 13:27:43.000000000","message":"Can we avoid a full iptables reload if we re-pick old zone_ids from ports? (reading current iptables at start?).\n\nProbably the extra complexity of reading it\u0027s not worth, as I think we reloaded the tables at start... but..","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":12215,"name":"Alexey Miroshkin","email":"alexey.miroshkin@ru.ibm.com","username":"amirosh"},"change_message_id":"3edcbbf438a9769206c3ca832c44edf1aa952c23","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        with self.firewall.defer_apply():"},{"line_number":259,"context_line":"            for device in devices.values():"},{"line_number":260,"context_line":"                zone_id \u003d self.provision_local_zone(device)"},{"line_number":261,"context_line":"                device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":262,"context_line":"                self.firewall.prepare_port_filter(device)"},{"line_number":263,"context_line":"            if self.use_enhanced_rpc:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_9a21f1a1","line":260,"updated":"2014-11-12 09:25:27.000000000","message":"Is zone_id really needed? Would it to be better to convert to one-liner?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"dd66f4779e88eecd8b45525e19f1df739d37870f","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                device \u003d self.firewall.ports.get(device_id)"},{"line_number":324,"context_line":"                if not device:"},{"line_number":325,"context_line":"                    continue"},{"line_number":326,"context_line":"                self.reclaim_local_zone(device)"},{"line_number":327,"context_line":"                self.firewall.remove_port_filter(device)"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"    @skip_if_noopfirewall_or_firewall_disabled"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_94a273ac","line":326,"updated":"2014-11-13 16:21:56.000000000","message":"I honestly think that at the end of the day we can keep a zone for the whole port lifecycle","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":12215,"name":"Alexey Miroshkin","email":"alexey.miroshkin@ru.ibm.com","username":"amirosh"},"change_message_id":"3edcbbf438a9769206c3ca832c44edf1aa952c23","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        with self.firewall.defer_apply():"},{"line_number":348,"context_line":"            for device in devices.values():"},{"line_number":349,"context_line":"                LOG.debug(_(\"Update port filter for %s\"), device[\u0027device\u0027])"},{"line_number":350,"context_line":"                zone_id \u003d self.provision_local_zone(device)"},{"line_number":351,"context_line":"                device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":352,"context_line":"                self.firewall.update_port_filter(device)"},{"line_number":353,"context_line":"            if self.use_enhanced_rpc:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_1a3501da","line":350,"updated":"2014-11-12 09:25:27.000000000","message":"Same as above","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4ea0e3774ccfd9a993aab2bff340f33052a0ad31","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.sg_agent.security_groups_provider_updated()"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"class LocalZoneMapping(object):"},{"line_number":151,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":152,"context_line":"        self.zone \u003d zone"},{"line_number":153,"context_line":"        self.vif_ports \u003d vif_ports or {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_cf25a4ac","line":150,"updated":"2014-12-08 14:46:10.000000000","message":"Suggestion:\n\nI think instead of introducing new mapping we could use existing mapping in some agents. \n\nFor instance, ovs agent uses local vlan mapping, which is suitable for this task as well.\n\nI think it may be better to pull out this mapping logic to some common place so it could be shared. For instance it doesn\u0027t look appropriate to have this duplication for some agents.","commit_id":"077522781a79953fe3efca7ad21a8a5e2334799a"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"6c6e46ae59f4c45bf9cb0be638d94a102243dcd5","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.sg_agent.security_groups_provider_updated()"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"class LocalZoneMapping(object):"},{"line_number":151,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":152,"context_line":"        self.zone \u003d zone"},{"line_number":153,"context_line":"        self.vif_ports \u003d vif_ports or {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_58f95cc7","line":150,"in_reply_to":"3a961159_cf25a4ac","updated":"2014-12-09 11:39:20.000000000","message":"I find it hard to move this mapping logic to a common place to be shared. Firstly, the structure of mapping is agent specific. Local vlan mapping in ovs agent has \u0027network_type\u0027, \u0027physical_network\u0027 as its members, which may not be required by other agents, like this local zone mapping. Secondly, the reclaiming logic is also agent specific. In ovs agent, only when all ports are removed from a network, the vlan id can be reclaimed.\n\nTo avoid duplication, one simple way is to pass the local_vlan_map to OVSSecurityGroupAgent so it can use the vlan id directly as the zone id. What do you think about this approach?","commit_id":"077522781a79953fe3efca7ad21a8a5e2334799a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"38e1f1e289a58939478c8f3eeb02c8b7fe2ed62d","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.sg_agent.security_groups_provider_updated()"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"class LocalZoneMapping(object):"},{"line_number":151,"context_line":"    def __init__(self, zone, vif_ports\u003dNone):"},{"line_number":152,"context_line":"        self.zone \u003d zone"},{"line_number":153,"context_line":"        self.vif_ports \u003d vif_ports or {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_f6d06255","line":150,"in_reply_to":"3a961159_cf25a4ac","updated":"2014-12-09 01:47:09.000000000","message":"I quite agree here.","commit_id":"077522781a79953fe3efca7ad21a8a5e2334799a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"79830c2f3176835721994397572bf316b8b1e1ae","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"},{"line_number":179,"context_line":"    def use_enhanced_rpc(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_3a009d01","line":176,"updated":"2014-12-19 23:36:03.000000000","message":"With this new approach (compared to PS11) it wouldn\u0027t work for other plugins like linuxbridge, right?","commit_id":"4e1d63969656d5f745e6a64dfc87c93be247a19c"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"13edeae382c80b809fd1a0026a0f6fbd4307ad75","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"},{"line_number":179,"context_line":"    def use_enhanced_rpc(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_67f6fe5e","line":176,"in_reply_to":"3a961159_3a009d01","updated":"2014-12-22 07:23:30.000000000","message":"Yes, as enikanorov suggested, this approach avoids introducing new mapping. But since it depends on local vlan mapping, it won\u0027t work for other plugins.\n\nI replied on PS11 discussing about the difficulty to refactor this mapping logic. Since there is no reply, I try to submit this simple version.\n\nAvoid duplication with limited plugin support, or none limited support with duplication, which one do you think is better? Or do you have any better ideas?","commit_id":"4e1d63969656d5f745e6a64dfc87c93be247a19c"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cc388d3aad7a7b6596df50d3e4f114913767a5d","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"},{"line_number":179,"context_line":"    def use_enhanced_rpc(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_fc0c4044","line":176,"in_reply_to":"3a961159_67f6fe5e","updated":"2014-12-23 08:57:28.000000000","message":"I personally prefer duplication to not having plugin independence.\nAnd of course, I prefer refactoring and getting both implementations together, but I understand the time constraint limits we all have.\n\n@obondarev, May be it\u0027s a good start to have the duplicated mapping here, and leave a TODO note pointing to the other implementation, so it can be eventually be coalesced.\n\nWhat do you think?","commit_id":"4e1d63969656d5f745e6a64dfc87c93be247a19c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"2adccc10f64b735b7604ac05a013e47f1f20a4e8","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        self._use_enhanced_rpc \u003d None"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def set_local_zone(self, device):"},{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_be80c5f7","line":173,"updated":"2014-12-23 18:02:59.000000000","message":"I suggest the attribute is named \u0027local_zone_map\u0027 and for ovs case it refers to local_vlan_map.\n\nHowever I don\u0027t quite like this approach.\nI think it would be better to leave this method empty here, and implement it in OVSSecurityGroupAgent In that case \u0027local_vlan_map\u0027 name for the attribute will make more sense.","commit_id":"dbcf87843d0b5be043b65ddbe2e9a63255009dd7"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"d6adac9e71bde6030983edb5b0cd923706db10c3","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    def set_local_zone(self, device):"},{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_e68018f9","line":175,"updated":"2014-12-23 03:05:30.000000000","message":"When I was trying out this patch, I keep getting KeyError when this line is called. local_vlan_map is still {} when this method is called after local_vlan_map is passed to sg_agent.","commit_id":"dbcf87843d0b5be043b65ddbe2e9a63255009dd7"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"e0ce80477e21b9b6aea6ad3d8690f2cb708cbea3","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    def set_local_zone(self, device):"},{"line_number":173,"context_line":"        if hasattr(self, \u0027local_vlan_map\u0027):"},{"line_number":174,"context_line":"            net_id \u003d device[\u0027network_id\u0027]"},{"line_number":175,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":176,"context_line":"            device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_cf87af5f","line":175,"in_reply_to":"3a961159_e68018f9","updated":"2014-12-23 06:25:54.000000000","message":"So move \"sg_agent.setup_port_filters\" to the end of \"process_network_ports\" doesn\u0027t solve the problem in PS12. Thanks for your testing, I will submit a workable patch soon.","commit_id":"dbcf87843d0b5be043b65ddbe2e9a63255009dd7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"420be33b5cb79dc1425ef125a1acade0d00aca54","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        self.global_refresh_firewall \u003d False"},{"line_number":170,"context_line":"        self._use_enhanced_rpc \u003d None"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def set_local_zone(self, device):"},{"line_number":173,"context_line":"        pass"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_99eeee20","line":172,"updated":"2015-01-07 09:04:57.000000000","message":"I would provide a docstring to explain what we exactly expect from this function implementation down the way.\n\nI know we have the OVS reference implementation, but too much, inheritance is hard to follow sometimes, and a bit of docstring won\u0027t hurt anybody.","commit_id":"01dff43cf2329f1df2afcbd628ec84d741ea1944"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        agent, vlan id of each network can be used as zone id."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        :param device: dictionary of device information, get network id by"},{"line_number":200,"context_line":"        device[\u0027network_id\u0027], and set zone id by device[\u0027zone_id\u0027]"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_2dd19a57","line":200,"updated":"2015-02-03 10:43:45.000000000","message":"honestly rather than passing a dict and requiring it has a network_id and a zone_id attribute I would have changed the prototype of this method to:\n\nset_local_zone(self, network_id, zone_id)\n\nor even better:\n\nset_local_zone(self, network_id):\n....\nreturn zone_id\n\nhave you considered this route?","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d450386d10e8469504b482d930672c27551e2c87","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        agent, vlan id of each network can be used as zone id."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        :param device: dictionary of device information, get network id by"},{"line_number":200,"context_line":"        device[\u0027network_id\u0027], and set zone id by device[\u0027zone_id\u0027]"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_56cd1ab6","line":200,"in_reply_to":"da86d52c_01bd22b7","updated":"2015-02-05 12:17:46.000000000","message":"+1","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"dbdb80d72c211323a1acb946ae4f98a8b5a9aa53","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        agent, vlan id of each network can be used as zone id."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        :param device: dictionary of device information, get network id by"},{"line_number":200,"context_line":"        device[\u0027network_id\u0027], and set zone id by device[\u0027zone_id\u0027]"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_01bd22b7","line":200,"in_reply_to":"da86d52c_2dd19a57","updated":"2015-02-05 09:09:16.000000000","message":"+1","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ae6623681c98f07c0a318781db8a9fe79bed4085","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        agent, vlan id of each network can be used as zone id."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        :param device: dictionary of device information, get network id by"},{"line_number":200,"context_line":"        device[\u0027network_id\u0027], and set zone id by device[\u0027zone_id\u0027]"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_ea0735c8","line":200,"in_reply_to":"da86d52c_2dd19a57","updated":"2015-02-04 09:31:34.000000000","message":"Maybe the doc string above is a bit confusing. This method is only called in \"prepare_devices_filter\" and \"refresh_firewall\" in this module, and these two methods will surely pass the \"device\" with \"network_id\". By saying \"get network id by device[\u0027network_id\u0027]\", I mean that developer *can* get network id using key \"network_id\".\n\nChanging the prototype to \"set_local_zone(self, network_id)\" will require \"prepare_devices_filter\" and \"refresh_firewall\" to add extra validation, like:\n\nnetwork_id \u003d device[\u0027network_id\u0027]\nzone_id \u003d self.set_local_zone(network_id)\nif zone_id:\n    device[\u0027zone_id\u0027] \u003d zone_id\n\nwhile the current implementation just one line:\n\nself.set_local_zone(device)","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"de57ae65057c8898ec6a03a5db03737ad9fc43e6","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        agent, vlan id of each network can be used as zone id."},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        :param device: dictionary of device information, get network id by"},{"line_number":200,"context_line":"        device[\u0027network_id\u0027], and set zone id by device[\u0027zone_id\u0027]"},{"line_number":201,"context_line":"        \"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_aaa444a6","line":200,"in_reply_to":"da86d52c_56cd1ab6","updated":"2015-02-25 08:46:30.000000000","message":"ok, it was just a suggestion","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8344,"name":"fumihiko kakuma","email":"kakuma@valinux.co.jp","username":"kakuma"},"change_message_id":"bd582efdd0f6685ad797d058a1397e5bf14dfab4","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        net_id \u003d device[\u0027network_id\u0027]"},{"line_number":204,"context_line":"        zone_id \u003d 0"},{"line_number":205,"context_line":"        if net_id in self.local_vlan_map:"},{"line_number":206,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":207,"context_line":"        device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":208,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9a80dd14_f419a688","line":205,"updated":"2015-03-20 06:11:19.000000000","message":"self.local_vlan_map may be None.","commit_id":"43817e31dc51662ed8c3e92e85f9e81fa09c8adf"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"a269500458a2ab2d003a4445e46e1fe098083176","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        net_id \u003d device[\u0027network_id\u0027]"},{"line_number":204,"context_line":"        zone_id \u003d 0"},{"line_number":205,"context_line":"        if net_id in self.local_vlan_map:"},{"line_number":206,"context_line":"            zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":207,"context_line":"        device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":208,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9a80dd14_610df58e","line":205,"in_reply_to":"9a80dd14_f419a688","updated":"2015-03-20 08:30:09.000000000","message":"agree,thanks for your review!","commit_id":"43817e31dc51662ed8c3e92e85f9e81fa09c8adf"}],"neutron/plugins/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e263151aeeebe17464f47111e2544366f6cc10bb","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"class OVSSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin):"},{"line_number":91,"context_line":"    def __init__(self, context, plugin_rpc, root_helper):"},{"line_number":92,"context_line":"        super(OVSSecurityGroupAgent, self).__init__()"},{"line_number":93,"context_line":"        self.context \u003d context"},{"line_number":94,"context_line":"        self.plugin_rpc \u003d plugin_rpc"},{"line_number":95,"context_line":"        self.root_helper \u003d root_helper"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_03bc9edb","line":92,"updated":"2014-11-13 05:58:04.000000000","message":"Is this an orthogonal change or am I missing something?","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ff9b03919a6124a9b4d3fef74648cd97143a7ea7","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"class OVSSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin):"},{"line_number":91,"context_line":"    def __init__(self, context, plugin_rpc, root_helper):"},{"line_number":92,"context_line":"        super(OVSSecurityGroupAgent, self).__init__()"},{"line_number":93,"context_line":"        self.context \u003d context"},{"line_number":94,"context_line":"        self.plugin_rpc \u003d plugin_rpc"},{"line_number":95,"context_line":"        self.root_helper \u003d root_helper"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_8b531b6a","line":92,"in_reply_to":"5a890539_03bc9edb","updated":"2014-11-14 04:34:38.000000000","message":"I add __init__() to SecurityGroupAgentRpcMixin to initialize local zone mapping, so here I need to call it explicitly.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"f5275c855274d2eef14f330e609142d56b30f4ef","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1265,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1268,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a930d6b_9c5e2311","line":1267,"updated":"2015-01-23 13:28:01.000000000","message":"why did you need to move these lines?","commit_id":"4ff834556eb997dfa5a1b73d4873f12de3838348"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"98ebe557d3a15a500e22d9c814bac3820c032616","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1265,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1268,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a930d6b_48e31505","line":1267,"in_reply_to":"1a930d6b_9c5e2311","updated":"2015-01-23 16:19:25.000000000","message":"And should the comment above be adjusted/moved/updated? L1224-1225","commit_id":"4ff834556eb997dfa5a1b73d4873f12de3838348"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"93720f6879a6e53c4f2368171653d5ddf7b699bc","unresolved":false,"context_lines":[{"line_number":1264,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1265,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1268,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a930d6b_72230956","line":1267,"in_reply_to":"1a930d6b_9c5e2311","updated":"2015-01-27 03:13:35.000000000","message":"setup_port_filters uses vlan id as zone id to apply iptables rules, so it should be put after treat_devices_added_or_updated, which will assign a vlan id to a new port.","commit_id":"4ff834556eb997dfa5a1b73d4873f12de3838348"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def set_local_zone(self, device):"},{"line_number":97,"context_line":"        net_id \u003d device[\u0027network_id\u0027]"},{"line_number":98,"context_line":"        zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":99,"context_line":"        device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_4d9faeb4","line":98,"updated":"2015-02-03 10:43:45.000000000","message":"sharing a dict between the L2 and security group components of the agent is probably not going to be the right solution in the long term. Not because it might fail or not be scalable, but just for maintanability. It is not evident that this object is shared and therefore users might inadvertently breaking some capability by playing with it.\n\nI would probably wrap the local vlan map in a distinct object with a clear interface which is used by both agents, but I don\u0027t want you to do this in this patch. If you like the idea, you can do that in a follow-up patch.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5881ac164e02d70e6452a4b82595e9a148cbbde0","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def set_local_zone(self, device):"},{"line_number":97,"context_line":"        net_id \u003d device[\u0027network_id\u0027]"},{"line_number":98,"context_line":"        zone_id \u003d self.local_vlan_map[net_id].vlan"},{"line_number":99,"context_line":"        device[\u0027zone_id\u0027] \u003d zone_id"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9a80dd14_c3f70ef4","line":98,"in_reply_to":"da86d52c_4d9faeb4","updated":"2015-03-05 10:57:46.000000000","message":"I Agree, we should go back to having an independent map like we had early in the implementation, but some reviewers asked to reuse the vlan map.\n\nThis is also causing the dependency that needs the port wired before trying to set the filters, because we depend on the vlan mapping ..","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"0624e734950861c21f7a3a63bd668bac653845df","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a80dd14_9f024bb2","line":1283,"updated":"2015-03-09 08:32:33.000000000","message":"hi Salvatore Orlando and Kevin Benton, do you agree that the iptables zone id use a independent map? If you agree, I will address this patch because I have a patch depend on this patch!","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_0da69653","line":1283,"updated":"2015-02-03 10:43:45.000000000","message":"if you will push another patch please consider adding a comment explaining why the configuration of port filters should be performed after wiring the port.\n\nAlso it is worth noting that this might pave the way for a security issue, can you see it?","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5881ac164e02d70e6452a4b82595e9a148cbbde0","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a80dd14_a3593a00","line":1283,"in_reply_to":"9a80dd14_52de8a12","updated":"2015-03-05 10:57:46.000000000","message":"I would prefer the solution of having an independent map.\n\nWhen reusing the vlan map was suggested I believe we were not aware of the dependencies/implications (needing the port wired first to get the right vlan id we\u0027re using for the CT mark).\n\nBut IMHO, needing a safety filter, that we need to remove later just increases the iptables reloads, and it\u0027s just what we\u0027re trying to implement here.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"974c63dd2bc04b9b467770e51f71e861107c52d1","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a80dd14_52de8a12","line":1283,"in_reply_to":"ba7be1f8_f7f795d2","updated":"2015-03-05 10:19:05.000000000","message":"but if we add a safety filter, it must reload iptables three times when creating a VM, it will affact the performance. Of course, the iptables \u0027defer_apply\u0027 can reduce the affact","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d6035412faa331017ff1c70fc106ae0cf5add4bc","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_5e760307","line":1283,"in_reply_to":"da86d52c_0da69653","updated":"2015-02-05 17:23:28.000000000","message":"If this is a security issue then we shouldn\u0027t be doing it.\n\nFrom following treat_devices_added_or_updated() I can see that it will install a flow for inbound traffic on a new port, but we are not installing the filters until here.  I\u0027m assuming that\u0027s the issue Salvatore noticed?","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"1525975ae09bb5c488bd17ba21646588ebfb430f","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_6a81f84c","line":1283,"in_reply_to":"da86d52c_5e760307","updated":"2015-02-08 18:43:41.000000000","message":"There is a little lag, possibly milliseconds, where an interface is not secured. But this is not the problem.\nThe problem is the possibility of failure in the agent between wiring and securing a port. This will leave an interface wired but not secured for an indefinite amount of time. Even if the interface won\u0027t be up, there is still a possibility that nova is not configured for waiting for vif plugged events from neutron. as a result, the vm will boot even with the interface DOWN, and give a tenant a completely unsecured network interface.\n\nAnyway, I think this is not a big deal. I think you can just add a \"safety net\" drop-all rule before wiring the interface and remove it when you apply the appropriate filters.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d160a542c168b495a58f9af1401662deb749d057","unresolved":false,"context_lines":[{"line_number":1280,"context_line":""},{"line_number":1281,"context_line":"        # TODO(salv-orlando): Optimize avoiding applying filters unnecessarily"},{"line_number":1282,"context_line":"        # (eg: when there are no IP address changes)"},{"line_number":1283,"context_line":"        self.sg_agent.setup_port_filters(port_info.get(\u0027added\u0027, set()),"},{"line_number":1284,"context_line":"                                         port_info.get(\u0027updated\u0027, set()))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_f7f795d2","line":1283,"in_reply_to":"da86d52c_6a81f84c","updated":"2015-02-27 09:13:45.000000000","message":"+1 to a safety filter. My hopes and dreams are topped by making neutron networks secure enough that shared networks are safe to use between untrusted tenants.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        except Exception:"},{"line_number":288,"context_line":"            LOG.exception(_LE(\"Failed reporting state!\"))"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _restore_local_vlan_map(self):"},{"line_number":291,"context_line":"        cur_ports \u003d self.int_br.get_vif_ports()"},{"line_number":292,"context_line":"        for port in cur_ports:"},{"line_number":293,"context_line":"            local_vlan_map \u003d self.int_br.db_get_val(\"Port\", port.port_name,"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_4461b838","line":290,"updated":"2015-04-21 08:20:28.000000000","message":"Nice!, finally you found a metadata field we can use to store our state ;)","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":721,"context_line":"        self.int_br.set_db_attribute(\"Port\", port.port_name, \"other_config\","},{"line_number":722,"context_line":"                                     vlan_mapping)"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _bound_devices(self, need_bound_ports):"},{"line_number":725,"context_line":"        for port_detail in need_bound_ports:"},{"line_number":726,"context_line":"            lvm \u003d self.local_vlan_map[port_detail[\u0027network_id\u0027]]"},{"line_number":727,"context_line":"            port \u003d port_detail[\u0027vif_port\u0027]"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_a43bf437","line":724,"updated":"2015-04-21 08:20:28.000000000","message":"bound is the past of the verb, may be we should use\n\"_bind_devices\"\n\nand need_bound_ports could be more correct as\n\"need_binding_ports\" (same for other attributes in the class)\n\nCan a more native speaker check what I\u0027m saying? ^","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":721,"context_line":"        self.int_br.set_db_attribute(\"Port\", port.port_name, \"other_config\","},{"line_number":722,"context_line":"                                     vlan_mapping)"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _bound_devices(self, need_bound_ports):"},{"line_number":725,"context_line":"        for port_detail in need_bound_ports:"},{"line_number":726,"context_line":"            lvm \u003d self.local_vlan_map[port_detail[\u0027network_id\u0027]]"},{"line_number":727,"context_line":"            port \u003d port_detail[\u0027vif_port\u0027]"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_236fd1c6","line":724,"in_reply_to":"dac4157f_a43bf437","updated":"2015-04-21 12:25:27.000000000","message":"agree, I need a help :)","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"        # an OVS ofport configured, as only these ports were considered"},{"line_number":1194,"context_line":"        # for being treated. If that does not happen, it is a potential"},{"line_number":1195,"context_line":"        # error condition of which operators should be aware"},{"line_number":1196,"context_line":"        port_need_bound \u003d True"},{"line_number":1197,"context_line":"        if not vif_port.ofport:"},{"line_number":1198,"context_line":"            LOG.warn(_LW(\"VIF port: %s has no ofport configured, \""},{"line_number":1199,"context_line":"                         \"and might not be able to transmit\"), vif_port.vif_id)"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_e45d6c7a","line":1196,"updated":"2015-04-21 08:20:28.000000000","message":"port_needs_binding \u003d True ?","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"        # an OVS ofport configured, as only these ports were considered"},{"line_number":1194,"context_line":"        # for being treated. If that does not happen, it is a potential"},{"line_number":1195,"context_line":"        # error condition of which operators should be aware"},{"line_number":1196,"context_line":"        port_need_bound \u003d True"},{"line_number":1197,"context_line":"        if not vif_port.ofport:"},{"line_number":1198,"context_line":"            LOG.warn(_LW(\"VIF port: %s has no ofport configured, \""},{"line_number":1199,"context_line":"                         \"and might not be able to transmit\"), vif_port.vif_id)"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_03728dad","line":1196,"in_reply_to":"dac4157f_e45d6c7a","updated":"2015-04-21 12:25:27.000000000","message":"agree","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1204,"context_line":"                                fixed_ips, device_owner, ovs_restarted)"},{"line_number":1205,"context_line":"            else:"},{"line_number":1206,"context_line":"                self.port_dead(vif_port)"},{"line_number":1207,"context_line":"                port_need_bound \u003d False"},{"line_number":1208,"context_line":"        else:"},{"line_number":1209,"context_line":"            LOG.debug(\"No VIF port for port %s defined on agent.\", port_id)"},{"line_number":1210,"context_line":"        return port_need_bound"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_c455c850","line":1207,"updated":"2015-04-21 08:20:28.000000000","message":"ditto.","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1204,"context_line":"                                fixed_ips, device_owner, ovs_restarted)"},{"line_number":1205,"context_line":"            else:"},{"line_number":1206,"context_line":"                self.port_dead(vif_port)"},{"line_number":1207,"context_line":"                port_need_bound \u003d False"},{"line_number":1208,"context_line":"        else:"},{"line_number":1209,"context_line":"            LOG.debug(\"No VIF port for port %s defined on agent.\", port_id)"},{"line_number":1210,"context_line":"        return port_need_bound"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_639ca9c0","line":1207,"in_reply_to":"dac4157f_c455c850","updated":"2015-04-21 12:25:27.000000000","message":"Done","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1207,"context_line":"                port_need_bound \u003d False"},{"line_number":1208,"context_line":"        else:"},{"line_number":1209,"context_line":"            LOG.debug(\"No VIF port for port %s defined on agent.\", port_id)"},{"line_number":1210,"context_line":"        return port_need_bound"},{"line_number":1211,"context_line":""},{"line_number":1212,"context_line":"    def _setup_tunnel_port(self, br, port_name, remote_ip, tunnel_type):"},{"line_number":1213,"context_line":"        ofport \u003d br.add_tunnel_port(port_name,"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_a450945f","line":1210,"updated":"2015-04-21 08:20:28.000000000","message":"ditto.","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1207,"context_line":"                port_need_bound \u003d False"},{"line_number":1208,"context_line":"        else:"},{"line_number":1209,"context_line":"            LOG.debug(\"No VIF port for port %s defined on agent.\", port_id)"},{"line_number":1210,"context_line":"        return port_need_bound"},{"line_number":1211,"context_line":""},{"line_number":1212,"context_line":"    def _setup_tunnel_port(self, br, port_name, remote_ip, tunnel_type):"},{"line_number":1213,"context_line":"        ofport \u003d br.add_tunnel_port(port_name,"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_439f65b4","line":1210,"in_reply_to":"dac4157f_a450945f","updated":"2015-04-21 12:25:27.000000000","message":"Done","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1268,"context_line":""},{"line_number":1269,"context_line":"    def treat_devices_added_or_updated(self, devices, ovs_restarted):"},{"line_number":1270,"context_line":"        skipped_devices \u003d []"},{"line_number":1271,"context_line":"        need_bound_devices \u003d []"},{"line_number":1272,"context_line":"        try:"},{"line_number":1273,"context_line":"            devices_details_list \u003d self.plugin_rpc.get_devices_details_list("},{"line_number":1274,"context_line":"                self.context,"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_c4038841","line":1271,"updated":"2015-04-21 08:20:28.000000000","message":"devices_needing_binding ? \nneed_binding_devices? \n\nNot sure what\u0027s best.","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1268,"context_line":""},{"line_number":1269,"context_line":"    def treat_devices_added_or_updated(self, devices, ovs_restarted):"},{"line_number":1270,"context_line":"        skipped_devices \u003d []"},{"line_number":1271,"context_line":"        need_bound_devices \u003d []"},{"line_number":1272,"context_line":"        try:"},{"line_number":1273,"context_line":"            devices_details_list \u003d self.plugin_rpc.get_devices_details_list("},{"line_number":1274,"context_line":"                self.context,"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_c3ab75d5","line":1271,"in_reply_to":"dac4157f_c4038841","updated":"2015-04-21 12:25:27.000000000","message":"I think need_binding_devices :)","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1291,"context_line":"            if \u0027port_id\u0027 in details:"},{"line_number":1292,"context_line":"                LOG.info(_LI(\"Port %(device)s updated. Details: %(details)s\"),"},{"line_number":1293,"context_line":"                         {\u0027device\u0027: device, \u0027details\u0027: details})"},{"line_number":1294,"context_line":"                need_bound \u003d self.treat_vif_port(port, details[\u0027port_id\u0027],"},{"line_number":1295,"context_line":"                                                 details[\u0027network_id\u0027],"},{"line_number":1296,"context_line":"                                                 details[\u0027network_type\u0027],"},{"line_number":1297,"context_line":"                                                 details[\u0027physical_network\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_84fd903c","line":1294,"updated":"2015-04-21 08:20:28.000000000","message":"needs_binding","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1291,"context_line":"            if \u0027port_id\u0027 in details:"},{"line_number":1292,"context_line":"                LOG.info(_LI(\"Port %(device)s updated. Details: %(details)s\"),"},{"line_number":1293,"context_line":"                         {\u0027device\u0027: device, \u0027details\u0027: details})"},{"line_number":1294,"context_line":"                need_bound \u003d self.treat_vif_port(port, details[\u0027port_id\u0027],"},{"line_number":1295,"context_line":"                                                 details[\u0027network_id\u0027],"},{"line_number":1296,"context_line":"                                                 details[\u0027network_type\u0027],"},{"line_number":1297,"context_line":"                                                 details[\u0027physical_network\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_83b57d32","line":1294,"in_reply_to":"dac4157f_84fd903c","updated":"2015-04-21 12:25:27.000000000","message":"Done","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1303,"context_line":"                if self.prevent_arp_spoofing:"},{"line_number":1304,"context_line":"                    self.setup_arp_spoofing_protection(self.int_br,"},{"line_number":1305,"context_line":"                                                       port, details)"},{"line_number":1306,"context_line":"                if need_bound:"},{"line_number":1307,"context_line":"                    details[\u0027vif_port\u0027] \u003d port"},{"line_number":1308,"context_line":"                    need_bound_devices.append(details)"},{"line_number":1309,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_24c004e0","line":1306,"updated":"2015-04-21 08:20:28.000000000","message":"if needs_binding:","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1303,"context_line":"                if self.prevent_arp_spoofing:"},{"line_number":1304,"context_line":"                    self.setup_arp_spoofing_protection(self.int_br,"},{"line_number":1305,"context_line":"                                                       port, details)"},{"line_number":1306,"context_line":"                if need_bound:"},{"line_number":1307,"context_line":"                    details[\u0027vif_port\u0027] \u003d port"},{"line_number":1308,"context_line":"                    need_bound_devices.append(details)"},{"line_number":1309,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_43864566","line":1306,"in_reply_to":"dac4157f_24c004e0","updated":"2015-04-21 12:25:27.000000000","message":"Done","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3a043ec52b7a50668481836556cfbf1ec3ecd1a1","unresolved":false,"context_lines":[{"line_number":1390,"context_line":"        if devices_added_updated:"},{"line_number":1391,"context_line":"            start \u003d time.time()"},{"line_number":1392,"context_line":"            try:"},{"line_number":1393,"context_line":"                skipped_devices, need_bound_devices \u003d ("},{"line_number":1394,"context_line":"                    self.treat_devices_added_or_updated("},{"line_number":1395,"context_line":"                        devices_added_updated, ovs_restarted))"},{"line_number":1396,"context_line":"                LOG.debug(\"process_network_ports - iteration:%(iter_num)d - \""}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_84ab501d","line":1393,"updated":"2015-04-21 08:20:28.000000000","message":"devices_needing_binding ?\ndevices_need_binding ?","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"19f2b5de1ccb744010386fa168b4692429bf6079","unresolved":false,"context_lines":[{"line_number":1390,"context_line":"        if devices_added_updated:"},{"line_number":1391,"context_line":"            start \u003d time.time()"},{"line_number":1392,"context_line":"            try:"},{"line_number":1393,"context_line":"                skipped_devices, need_bound_devices \u003d ("},{"line_number":1394,"context_line":"                    self.treat_devices_added_or_updated("},{"line_number":1395,"context_line":"                        devices_added_updated, ovs_restarted))"},{"line_number":1396,"context_line":"                LOG.debug(\"process_network_ports - iteration:%(iter_num)d - \""}],"source_content_type":"text/x-python","patch_set":28,"id":"dac4157f_03804d45","line":1393,"in_reply_to":"dac4157f_84ab501d","updated":"2015-04-21 12:25:27.000000000","message":"Done","commit_id":"293fa9eed793b29a466b87b01658d244f54f305b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e0a8134f46be21fc4f389c151db2e61c361f2686","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        self.dvr_agent.bind_port_to_dvr(port, lvm,"},{"line_number":714,"context_line":"                                        fixed_ips,"},{"line_number":715,"context_line":"                                        device_owner)"},{"line_number":716,"context_line":"        vlan_mapping \u003d {}"},{"line_number":717,"context_line":"        vlan_mapping[\"net_uuid\"] \u003d net_uuid"},{"line_number":718,"context_line":"        vlan_mapping[\"network_type\"] \u003d network_type"},{"line_number":719,"context_line":"        vlan_mapping[\"physical_network\"] \u003d physical_network"}],"source_content_type":"text/x-python","patch_set":30,"id":"dac4157f_1ea2a94b","line":716,"updated":"2015-04-22 15:58:42.000000000","message":"nit: could create dict declaratively:\n    vlan_mapping \u003d {\u0027net_uuid\u0027: net_uuid, \u0027network_type\u0027: network_type,...}","commit_id":"c2756b47840fa13148a5a0f72f29f4caab2bfa9b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"bfe34efbf38fb2f5743e71c30306312b58b4984b","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        self.dvr_agent.bind_port_to_dvr(port, lvm,"},{"line_number":714,"context_line":"                                        fixed_ips,"},{"line_number":715,"context_line":"                                        device_owner)"},{"line_number":716,"context_line":"        vlan_mapping \u003d {}"},{"line_number":717,"context_line":"        vlan_mapping[\"net_uuid\"] \u003d net_uuid"},{"line_number":718,"context_line":"        vlan_mapping[\"network_type\"] \u003d network_type"},{"line_number":719,"context_line":"        vlan_mapping[\"physical_network\"] \u003d physical_network"}],"source_content_type":"text/x-python","patch_set":30,"id":"bab921fb_4ad33539","line":716,"in_reply_to":"dac4157f_1ea2a94b","updated":"2015-04-23 04:10:33.000000000","message":"agree, thanks for your review","commit_id":"c2756b47840fa13148a5a0f72f29f4caab2bfa9b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"57b86c5f2ee78e6e93679d9b4bb387600fa05ed5","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if lvm:"},{"line_number":532,"context_line":"            lvid \u003d lvm.vlan"},{"line_number":533,"context_line":"        else:"},{"line_number":534,"context_line":"            if local_vlan and local_vlan in self.available_local_vlans:"},{"line_number":535,"context_line":"                lvid \u003d local_vlan"},{"line_number":536,"context_line":"                self.available_local_vlans.remove(local_vlan)"},{"line_number":537,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"bab921fb_e858bf58","line":534,"updated":"2015-04-23 13:04:10.000000000","message":"Nit: Don\u0027t need to test for none, right?\n    if local_vlan in self.available_local_vlans:","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"dba25ffbc3aec79ef8a599ed20e0da02bb1c7745","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if lvm:"},{"line_number":532,"context_line":"            lvid \u003d lvm.vlan"},{"line_number":533,"context_line":"        else:"},{"line_number":534,"context_line":"            if local_vlan and local_vlan in self.available_local_vlans:"},{"line_number":535,"context_line":"                lvid \u003d local_vlan"},{"line_number":536,"context_line":"                self.available_local_vlans.remove(local_vlan)"},{"line_number":537,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"bab921fb_35ba6ac1","line":534,"in_reply_to":"bab921fb_e858bf58","updated":"2015-04-24 01:24:58.000000000","message":"agree","commit_id":"13c2441fa818256e1b0af080578d06b32e553078"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        # Collect additional bridges to monitor"},{"line_number":255,"context_line":"        self.ancillary_brs \u003d self.setup_ancillary_bridges(integ_br, tun_br)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # Restore local vlan mapping"},{"line_number":258,"context_line":"        self._restore_local_vlan_map()"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        # Security group agent support"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_2d51de62","line":257,"updated":"2015-04-24 14:41:23.000000000","message":"can you add 1-2 comment lines to explain why you are doing this at startup?","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        # Collect additional bridges to monitor"},{"line_number":255,"context_line":"        self.ancillary_brs \u003d self.setup_ancillary_bridges(integ_br, tun_br)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        # Restore local vlan mapping"},{"line_number":258,"context_line":"        self._restore_local_vlan_map()"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        # Security group agent support"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_52db714f","line":257,"in_reply_to":"bab921fb_2d51de62","updated":"2015-04-25 01:21:09.000000000","message":"agree","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            local_vlan_map \u003d self.int_br.db_get_val(\"Port\", port.port_name,"},{"line_number":294,"context_line":"                                                    \"other_config\")"},{"line_number":295,"context_line":"            local_vlan \u003d self.int_br.db_get_val(\"Port\", port.port_name, \"tag\")"},{"line_number":296,"context_line":"            net_uuid \u003d local_vlan_map.get(\u0027net_uuid\u0027)"},{"line_number":297,"context_line":"            if net_uuid and net_uuid not in self.local_vlan_map:"},{"line_number":298,"context_line":"                self.provision_local_vlan(local_vlan_map[\u0027net_uuid\u0027],"},{"line_number":299,"context_line":"                                          local_vlan_map[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_cddee210","line":296,"updated":"2015-04-24 14:41:23.000000000","message":"Can you explain how do you guarantee local_vlan_map is never None? (and always a dict-like type?)","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            local_vlan_map \u003d self.int_br.db_get_val(\"Port\", port.port_name,"},{"line_number":294,"context_line":"                                                    \"other_config\")"},{"line_number":295,"context_line":"            local_vlan \u003d self.int_br.db_get_val(\"Port\", port.port_name, \"tag\")"},{"line_number":296,"context_line":"            net_uuid \u003d local_vlan_map.get(\u0027net_uuid\u0027)"},{"line_number":297,"context_line":"            if net_uuid and net_uuid not in self.local_vlan_map:"},{"line_number":298,"context_line":"                self.provision_local_vlan(local_vlan_map[\u0027net_uuid\u0027],"},{"line_number":299,"context_line":"                                          local_vlan_map[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_e5cd2186","line":296,"in_reply_to":"bab921fb_cddee210","updated":"2015-04-25 01:21:09.000000000","message":"the \u0027other_config\u0027 in ovs db table \u0027Port\u0027 is saved as dict-like.","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                                                    \"other_config\")"},{"line_number":295,"context_line":"            local_vlan \u003d self.int_br.db_get_val(\"Port\", port.port_name, \"tag\")"},{"line_number":296,"context_line":"            net_uuid \u003d local_vlan_map.get(\u0027net_uuid\u0027)"},{"line_number":297,"context_line":"            if net_uuid and net_uuid not in self.local_vlan_map:"},{"line_number":298,"context_line":"                self.provision_local_vlan(local_vlan_map[\u0027net_uuid\u0027],"},{"line_number":299,"context_line":"                                          local_vlan_map[\u0027network_type\u0027],"},{"line_number":300,"context_line":"                                          local_vlan_map[\u0027physical_network\u0027],"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_8d0d8a92","line":297,"updated":"2015-04-24 14:41:23.000000000","message":"can self.local_vlan_map contain None entries?\nIf not perhaps the first part of the if statement is not necessary","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                                                    \"other_config\")"},{"line_number":295,"context_line":"            local_vlan \u003d self.int_br.db_get_val(\"Port\", port.port_name, \"tag\")"},{"line_number":296,"context_line":"            net_uuid \u003d local_vlan_map.get(\u0027net_uuid\u0027)"},{"line_number":297,"context_line":"            if net_uuid and net_uuid not in self.local_vlan_map:"},{"line_number":298,"context_line":"                self.provision_local_vlan(local_vlan_map[\u0027net_uuid\u0027],"},{"line_number":299,"context_line":"                                          local_vlan_map[\u0027network_type\u0027],"},{"line_number":300,"context_line":"                                          local_vlan_map[\u0027physical_network\u0027],"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_e5f76189","line":297,"in_reply_to":"bab921fb_8d0d8a92","updated":"2015-04-25 01:21:09.000000000","message":"I think self.local_vlan_map can\u0027t contain None entries, so you are right, the first part of the if statement can be removed","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if lvm:"},{"line_number":532,"context_line":"            lvid \u003d lvm.vlan"},{"line_number":533,"context_line":"        else:"},{"line_number":534,"context_line":"            if local_vlan in self.available_local_vlans:"},{"line_number":535,"context_line":"                lvid \u003d local_vlan"},{"line_number":536,"context_line":"                self.available_local_vlans.remove(local_vlan)"},{"line_number":537,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_6e0a2d23","line":534,"updated":"2015-04-24 14:41:23.000000000","message":"this kind of operation is safe only as long as the agent keeps having its looping structure. As this might change in the future it might be worth considering making this thread safe.\n\nPlease consider this comment optional","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if lvm:"},{"line_number":532,"context_line":"            lvid \u003d lvm.vlan"},{"line_number":533,"context_line":"        else:"},{"line_number":534,"context_line":"            if local_vlan in self.available_local_vlans:"},{"line_number":535,"context_line":"                lvid \u003d local_vlan"},{"line_number":536,"context_line":"                self.available_local_vlans.remove(local_vlan)"},{"line_number":537,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_d2fae142","line":534,"in_reply_to":"bab921fb_6e0a2d23","updated":"2015-04-25 01:21:09.000000000","message":"I agree with you, considering the concurrency scenario, it is better to add a lock, do you think address it in this patch?","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":539,"context_line":"                    LOG.error(_LE(\"No local VLAN available for net-id\u003d%s\"),"},{"line_number":540,"context_line":"                              net_uuid)"},{"line_number":541,"context_line":"                    return"},{"line_number":542,"context_line":"                lvid \u003d self.available_local_vlans.pop()"},{"line_number":543,"context_line":"            self.local_vlan_map[net_uuid] \u003d LocalVLANMapping(lvid,"},{"line_number":544,"context_line":"                                                             network_type,"},{"line_number":545,"context_line":"                                                             physical_network,"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_4e2409ae","line":542,"updated":"2015-04-24 14:41:23.000000000","message":"if local_vlan is not in self.avalaible_local_vlans, but there are available vlans, is there a case to log something at least?\nAlso in this case lvid would be unset, but then you\u0027ll be calling the statement at line 543 anyway.\n\nPlease correct me if my analysis is wrong.","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":539,"context_line":"                    LOG.error(_LE(\"No local VLAN available for net-id\u003d%s\"),"},{"line_number":540,"context_line":"                              net_uuid)"},{"line_number":541,"context_line":"                    return"},{"line_number":542,"context_line":"                lvid \u003d self.available_local_vlans.pop()"},{"line_number":543,"context_line":"            self.local_vlan_map[net_uuid] \u003d LocalVLANMapping(lvid,"},{"line_number":544,"context_line":"                                                             network_type,"},{"line_number":545,"context_line":"                                                             physical_network,"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_e5f881c5","line":542,"in_reply_to":"bab921fb_4e2409ae","updated":"2015-04-25 01:21:09.000000000","message":"I think I miss a case, when local_vlan is 4095 which means a dead port, it is  not in self.avalaible_local_vlans, but we should not allocate a new lvid for it! thanks very much for your good analysis!","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0aec5c5bd11c34acad01abfd2507c14eed02b525","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                        \u0027physical_network\u0027: physical_network,"},{"line_number":725,"context_line":"                        \u0027segmentation_id\u0027: segmentation_id}"},{"line_number":726,"context_line":"        self.int_br.set_db_attribute(\"Port\", port.port_name, \"other_config\","},{"line_number":727,"context_line":"                                     vlan_mapping)"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"    def _bind_devices(self, need_binding_ports):"},{"line_number":730,"context_line":"        for port_detail in need_binding_ports:"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_cee37932","line":727,"updated":"2015-04-24 14:41:23.000000000","message":"nit. Please do not assume exclusive control of the other_config attribute. By doing so you are assuming no other neutron control plane element will ever use it. You might be right, but we cannot know for certain.\n\nso perhaps first read other_config and then update it with a new vlan_mapping attribute. I believe the performance impact should be negligible.","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"36e00342ec239104599aedf9e2bb7edb7caff07d","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                        \u0027physical_network\u0027: physical_network,"},{"line_number":725,"context_line":"                        \u0027segmentation_id\u0027: segmentation_id}"},{"line_number":726,"context_line":"        self.int_br.set_db_attribute(\"Port\", port.port_name, \"other_config\","},{"line_number":727,"context_line":"                                     vlan_mapping)"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"    def _bind_devices(self, need_binding_ports):"},{"line_number":730,"context_line":"        for port_detail in need_binding_ports:"}],"source_content_type":"text/x-python","patch_set":33,"id":"bab921fb_92b8e9c9","line":727,"in_reply_to":"bab921fb_cee37932","updated":"2015-04-25 01:21:09.000000000","message":"good suggestion, now no other neutron control plane use it, but it is better to read other_config and then update it!","commit_id":"1f2d2de06b515f171f26e6eaf7c2033dcdec43c9"}],"neutron/tests/unit/agent/test_securitygroups_rpc.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"2c391c9d8531dd65136dd73a8e61202d831f6388","unresolved":false,"context_lines":[{"line_number":2944,"context_line":"            local_vlan_map\u003dlocal_vlan_map,"},{"line_number":2945,"context_line":"            defer_refresh_firewall\u003ddefer_refresh_firewall)"},{"line_number":2946,"context_line":""},{"line_number":2947,"context_line":"    def test_prepare_remove_port(self):"},{"line_number":2948,"context_line":"        self.rpc.security_group_rules_for_devices.return_value \u003d self.devices1"},{"line_number":2949,"context_line":"        self._replay_iptables(IPTABLES_FILTER_1, IPTABLES_FILTER_V6_1,"},{"line_number":2950,"context_line":"                              IPTABLES_RAW_DEVICE_1)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3acd31a7_b9be2963","line":2947,"updated":"2015-05-05 09:40:41.000000000","message":"self.expected_calls uses regexes!\n\nobserved sample:\n\n  *nat\n  :neutron-postrouting-bottom - [0:0]\n\nexpected sample (not a string but a string regex):\n  *nat\n  :neutron-postrouting-bottom - \\[0:0\\]","commit_id":"590653f3762e51597944b0a1d5f90614b8f56b6f"}],"neutron/tests/unit/openvswitch/test_ovs_dvr_neutron_agent.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"77a350a1d038709ac2a715c3049fd07c3f450687","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _test_port_bound_for_dvr_on_vlan_network(self, device_owner,"},{"line_number":131,"context_line":"                                                 ip_version\u003d4):"},{"line_number":132,"context_line":"        self._setup_for_dvr_test()"},{"line_number":133,"context_line":"        if ip_version \u003d\u003d 4:"},{"line_number":134,"context_line":"            gateway_ip \u003d \u00271.1.1.1\u0027"},{"line_number":135,"context_line":"            cidr \u003d \u00271.1.1.0/24\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9aa53dc9_302d5bfe","line":132,"updated":"2015-04-10 13:00:30.000000000","message":"This method and the next (and others farther down) seem to have a lot of common logic. Could a helper method be used to reduce duplication (and maybe help with readability through descriptive naming)?","commit_id":"8e931f8b3a743ec06d8bae98ac0b052aed7f4656"}],"neutron/tests/unit/plugins/openvswitch/agent/test_ovs_neutron_agent.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e0a8134f46be21fc4f389c151db2e61c361f2686","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        ) as (set_ovs_db_func, get_ovs_db_func, delete_flows_func):"},{"line_number":165,"context_line":"            self.agent.port_bound(port, net_uuid, \u0027local\u0027, None, None,"},{"line_number":166,"context_line":"                                  fixed_ips, \"compute:None\", False)"},{"line_number":167,"context_line":"        vlan_mapping \u003d {}"},{"line_number":168,"context_line":"        vlan_mapping[\"net_uuid\"] \u003d net_uuid"},{"line_number":169,"context_line":"        vlan_mapping[\"network_type\"] \u003d \u0027local\u0027"},{"line_number":170,"context_line":"        vlan_mapping[\"physical_network\"] \u003d None"}],"source_content_type":"text/x-python","patch_set":30,"id":"dac4157f_bd4ce7c8","line":167,"updated":"2015-04-22 15:58:42.000000000","message":"nit: you can create the dict declaratively:\n    vlan_mapping \u003d {\u0027net_uuid\u0027: net_uuid, \u0027network_type\u0027: \u0027local\u0027,...}","commit_id":"c2756b47840fa13148a5a0f72f29f4caab2bfa9b"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"bfe34efbf38fb2f5743e71c30306312b58b4984b","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        ) as (set_ovs_db_func, get_ovs_db_func, delete_flows_func):"},{"line_number":165,"context_line":"            self.agent.port_bound(port, net_uuid, \u0027local\u0027, None, None,"},{"line_number":166,"context_line":"                                  fixed_ips, \"compute:None\", False)"},{"line_number":167,"context_line":"        vlan_mapping \u003d {}"},{"line_number":168,"context_line":"        vlan_mapping[\"net_uuid\"] \u003d net_uuid"},{"line_number":169,"context_line":"        vlan_mapping[\"network_type\"] \u003d \u0027local\u0027"},{"line_number":170,"context_line":"        vlan_mapping[\"physical_network\"] \u003d None"}],"source_content_type":"text/x-python","patch_set":30,"id":"bab921fb_cace2583","line":167,"in_reply_to":"dac4157f_bd4ce7c8","updated":"2015-04-23 04:10:33.000000000","message":"Done","commit_id":"c2756b47840fa13148a5a0f72f29f4caab2bfa9b"}],"neutron/tests/unit/test_iptables_firewall.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"bc575cb182374c7f2f0cf109e602bebc80d0655d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.v4filter_inst \u003d mock.Mock()"},{"line_number":53,"context_line":"        self.v6filter_inst \u003d mock.Mock()"},{"line_number":54,"context_line":"        self.v4raw_inst \u003d mock.Mock()"},{"line_number":55,"context_line":"        self.v6raw_inst \u003d mock.Mock()"},{"line_number":56,"context_line":"        self.iptables_inst.ipv4 \u003d {\u0027filter\u0027: self.v4filter_inst,"},{"line_number":57,"context_line":"                                   \u0027raw\u0027: self.v4filter_inst"},{"line_number":58,"context_line":"                                   }"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_f9a42fa7","line":55,"updated":"2014-09-15 11:23:25.000000000","message":"Those 2 variables are not used.\n\nI suppose you created those vraw_inst to use for \u0027raw\u0027 entry on the dicts below.\n\nAnd since Jenkins passed either way, what were their point?","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"96e309c3be831b5397816209843ec7f21a6d318b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.v4filter_inst \u003d mock.Mock()"},{"line_number":53,"context_line":"        self.v6filter_inst \u003d mock.Mock()"},{"line_number":54,"context_line":"        self.v4raw_inst \u003d mock.Mock()"},{"line_number":55,"context_line":"        self.v6raw_inst \u003d mock.Mock()"},{"line_number":56,"context_line":"        self.iptables_inst.ipv4 \u003d {\u0027filter\u0027: self.v4filter_inst,"},{"line_number":57,"context_line":"                                   \u0027raw\u0027: self.v4filter_inst"},{"line_number":58,"context_line":"                                   }"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa98f980_5ffc2272","line":55,"in_reply_to":"fa98f980_f9a42fa7","updated":"2014-09-16 07:18:59.000000000","message":"Oh, yes. In the dicts below, \u0027filter\u0027 and \u0027raw\u0027 can share the same mock object, so v4raw_inst and v6raw_inst are useless. I have removed them in the next patch.","commit_id":"e582d7a9451d13a98a1532a854da86720ffd26c6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"dd66f4779e88eecd8b45525e19f1df739d37870f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                   \u0027raw\u0027: self.v4filter_inst"},{"line_number":59,"context_line":"                                   }"},{"line_number":60,"context_line":"        self.iptables_inst.ipv6 \u003d {\u0027filter\u0027: self.v6filter_inst,"},{"line_number":61,"context_line":"                                   \u0027raw\u0027: self.v6filter_inst"},{"line_number":62,"context_line":"                                   }"},{"line_number":63,"context_line":"        iptables_cls.return_value \u003d self.iptables_inst"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_b4a5afb6","line":61,"updated":"2014-11-13 16:21:56.000000000","message":"even if this is not causing any test failure I think that from a maintanability perspective is is better to avoid using the same mock instance for mocking different tables.","commit_id":"e2cb695c009f687194db877ddddebcf0f98641e5"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cd2715f15f266506a13f8b366657ea8538d0da06","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                     \u0027-j $sg-fallback\u0027,"},{"line_number":141,"context_line":"                     comment\u003dNone),"},{"line_number":142,"context_line":"                 mock.call.add_rule(\u0027sg-chain\u0027, \u0027-j ACCEPT\u0027)]"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        self.v4filter_inst.assert_has_calls(calls)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def test_filter_ipv4_ingress(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a961159_62ec62f5","side":"PARENT","line":143,"updated":"2015-01-14 14:50:45.000000000","message":"nit: newline removal","commit_id":"2c94b10d741f3a9d96b548cc051850467468c8de"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"f5b68cfc2e4b386707e55172f69e52c09e216640","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    def _fake_port(self):"},{"line_number":69,"context_line":"        return {\u0027device\u0027: \u0027tapfake_dev\u0027,"},{"line_number":70,"context_line":"                \u0027mac_address\u0027: \u0027ff:ff:ff:ff:ff:ff\u0027,"},{"line_number":71,"context_line":"                \u0027network_id\u0027: \u0027fake_net\u0027,"},{"line_number":72,"context_line":"                \u0027fixed_ips\u0027: [FAKE_IP[\u0027IPv4\u0027],"},{"line_number":73,"context_line":"                              FAKE_IP[\u0027IPv6\u0027]]}"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"1a930d6b_7ab83311","line":71,"updated":"2015-01-27 11:08:40.000000000","message":"nit: I would provide \u0027fake_net\u0027 as a FAKE_NETWORK_ID contant.","commit_id":"c1e809d8a4a10b91095481b08c4618b9c07a19da"}],"neutron/tests/unit/test_iptables_manager.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f358de023bea71511befe04387a1e7e55e801352","unresolved":false,"context_lines":[{"line_number":997,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":998,"context_line":"             \u0027\u0027),"},{"line_number":999,"context_line":"            (mock.call([\u0027iptables\u0027, \u0027-t\u0027, \u0027nat\u0027, \u0027-L\u0027, \u0027OUTPUT\u0027,"},{"line_number":1000,"context_line":"                        \u0027-n\u0027, \u0027-v\u0027, \u0027-x\u0027, \u0027-Z\u0027],"},{"line_number":1001,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":1002,"context_line":"             \u0027\u0027)"},{"line_number":1003,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_fbd52343","line":1000,"updated":"2014-10-16 17:39:42.000000000","message":"Doesn\u0027t seem like this change is necessary as the line length is identical to L995","commit_id":"671d6885163cb97730825f534551c6592187774d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"93fe8d3c02dfa2852a1f16055f51e8d0d72d89de","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":858,"context_line":"             \u0027\u0027),"},{"line_number":859,"context_line":"            (mock.call([\u0027iptables\u0027, \u0027-t\u0027, \u0027nat\u0027, \u0027-L\u0027, \u0027OUTPUT\u0027,"},{"line_number":860,"context_line":"                        \u0027-n\u0027, \u0027-v\u0027, \u0027-x\u0027, \u0027-Z\u0027],"},{"line_number":861,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":862,"context_line":"             \u0027\u0027)"},{"line_number":863,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a961159_c2663dbb","line":860,"updated":"2015-01-12 21:40:44.000000000","message":"This change isn\u0027t necessary for this patch, the -n can stay on the previous line.","commit_id":"5fd41d6b0569db0625bc0a78c81feda39a423986"}],"neutron/tests/unit/test_security_groups_rpc.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"cd2715f15f266506a13f8b366657ea8538d0da06","unresolved":false,"context_lines":[{"line_number":1759,"context_line":"[0:0] -A OUTPUT -j %(bn)s-OUTPUT"},{"line_number":1760,"context_line":"COMMIT"},{"line_number":1761,"context_line":"# Completed by iptables_manager"},{"line_number":1762,"context_line":"\"\"\" % IPTABLES_ARG"},{"line_number":1763,"context_line":""},{"line_number":1764,"context_line":"IPTABLES_NAT \u003d \"\"\"# Generated by iptables_manager"},{"line_number":1765,"context_line":"*nat"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a961159_c293564d","line":1762,"updated":"2015-01-14 14:50:45.000000000","message":"This is unused and can go away.","commit_id":"c4eb465d6f2b1243e942568a94e288197fd697c8"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"f5275c855274d2eef14f330e609142d56b30f4ef","unresolved":false,"context_lines":[{"line_number":1725,"context_line":"# Completed by iptables_manager"},{"line_number":1726,"context_line":"\"\"\" % IPTABLES_ARG"},{"line_number":1727,"context_line":""},{"line_number":1728,"context_line":"IPTABLES_RAW_1 \u003d \"\"\"# Generated by iptables_manager"},{"line_number":1729,"context_line":"*raw"},{"line_number":1730,"context_line":":%(bn)s-OUTPUT - [0:0]"},{"line_number":1731,"context_line":":%(bn)s-PREROUTING - [0:0]"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a930d6b_3cfa8fbd","line":1728,"updated":"2015-01-23 13:28:01.000000000","message":"nit: could you use a more self explanatory name, for example IPTABLES_RAW_DEVICE_1","commit_id":"4ff834556eb997dfa5a1b73d4873f12de3838348"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"93720f6879a6e53c4f2368171653d5ddf7b699bc","unresolved":false,"context_lines":[{"line_number":1725,"context_line":"# Completed by iptables_manager"},{"line_number":1726,"context_line":"\"\"\" % IPTABLES_ARG"},{"line_number":1727,"context_line":""},{"line_number":1728,"context_line":"IPTABLES_RAW_1 \u003d \"\"\"# Generated by iptables_manager"},{"line_number":1729,"context_line":"*raw"},{"line_number":1730,"context_line":":%(bn)s-OUTPUT - [0:0]"},{"line_number":1731,"context_line":":%(bn)s-PREROUTING - [0:0]"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a930d6b_92add5eb","line":1728,"in_reply_to":"1a930d6b_3cfa8fbd","updated":"2015-01-27 03:13:35.000000000","message":"done","commit_id":"4ff834556eb997dfa5a1b73d4873f12de3838348"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fca600c84aaf0b44c9667d250d8ec046fa2471d1","unresolved":false,"context_lines":[{"line_number":2623,"context_line":"    def _init_agent(self, defer_refresh_firewall):"},{"line_number":2624,"context_line":"        self.agent \u003d sg_rpc.SecurityGroupAgentRpc("},{"line_number":2625,"context_line":"                context\u003dNone, plugin_rpc\u003dself.rpc, root_helper\u003d\u0027sudo\u0027,"},{"line_number":2626,"context_line":"                defer_refresh_firewall\u003ddefer_refresh_firewall)"},{"line_number":2627,"context_line":""},{"line_number":2628,"context_line":"    def _device(self, device, ip, mac_address, rule):"},{"line_number":2629,"context_line":"        return {\u0027device\u0027: device,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_0dbf75d1","line":2626,"updated":"2015-02-03 10:43:45.000000000","message":"can\u0027t see the point of introducing this method, but it does no harm","commit_id":"d349e039c23125e1feac491be85b46438373bc53"},{"author":{"_account_id":8646,"name":"yangxurong","email":"yangxurong@huawei.com","username":"yangxurong"},"change_message_id":"ae6623681c98f07c0a318781db8a9fe79bed4085","unresolved":false,"context_lines":[{"line_number":2623,"context_line":"    def _init_agent(self, defer_refresh_firewall):"},{"line_number":2624,"context_line":"        self.agent \u003d sg_rpc.SecurityGroupAgentRpc("},{"line_number":2625,"context_line":"                context\u003dNone, plugin_rpc\u003dself.rpc, root_helper\u003d\u0027sudo\u0027,"},{"line_number":2626,"context_line":"                defer_refresh_firewall\u003ddefer_refresh_firewall)"},{"line_number":2627,"context_line":""},{"line_number":2628,"context_line":"    def _device(self, device, ip, mac_address, rule):"},{"line_number":2629,"context_line":"        return {\u0027device\u0027: device,"}],"source_content_type":"text/x-python","patch_set":22,"id":"da86d52c_e732115e","line":2626,"in_reply_to":"da86d52c_0dbf75d1","updated":"2015-02-04 09:31:34.000000000","message":"TestSecurityGroupAgentWithOVSIptables needs a different agent, I move the agent initialization code into this function so TestSecurityGroupAgentWithOVSIptables can overwrite it.","commit_id":"d349e039c23125e1feac491be85b46438373bc53"}]}
