)]}'
{"neutron/agent/linux/iptables_firewall.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"e9ac805ad3bd99a00223318722229f4f5fe368f2","unresolved":false,"context_lines":[{"line_number":721,"context_line":"    def _get_br_device_name(self, port):"},{"line_number":722,"context_line":"        return (\u0027qvb\u0027 + port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _populate_initial_zone_map(self):"},{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_e39d440b","line":724,"updated":"2015-07-31 08:22:33.000000000","message":"Probably, it\u0027s meaningful for a follow up patch (unrelated to this bug) to move this up to the IptablesFirewallDriver ? -by shihanzhag comments, it would fix the issue of cleaning a whole zone when there\u0027s a change affecting a port only-","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":721,"context_line":"    def _get_br_device_name(self, port):"},{"line_number":722,"context_line":"        return (\u0027qvb\u0027 + port[\u0027device\u0027])[:LINUX_DEV_LEN]"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _populate_initial_zone_map(self):"},{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_84ad3f9d","line":724,"in_reply_to":"3a50d1a3_e39d440b","updated":"2015-08-01 01:09:32.000000000","message":"yeah, i think a follow up patch is better. linux bridge doesn\u0027t use zones in the same way right now so it will require more work to have this as part of the main firewall driver.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"5fceaf1436c25076ce96fa5ec7b6a9ccbd9eb396","unresolved":false,"context_lines":[{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _populate_initial_zone_map(self):"},{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_88a826dd","line":726,"updated":"2015-07-31 03:13:57.000000000","message":"Given that I will clean a port ip_conntrack in a zone when its related sg rule was deleted or updated, do this value can be self.device_zone_map, because I will use it in other class","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"9379a7e05403a4ecf4fb5fe07dacade06f5a693f","unresolved":false,"context_lines":[{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _populate_initial_zone_map(self):"},{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_a835e2a8","line":726,"in_reply_to":"3a50d1a3_88a826dd","updated":"2015-07-31 03:17:11.000000000","message":"No need, I can add a new method to get a device zone.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":723,"context_line":""},{"line_number":724,"context_line":"    def _populate_initial_zone_map(self):"},{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_4477373b","line":726,"in_reply_to":"3a50d1a3_a835e2a8","updated":"2015-08-01 01:09:32.000000000","message":"just use _get_device_zone. I\u0027ll rename it to get_device_zone so it\u0027s more public.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"},{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_d1348be0","line":728,"updated":"2015-07-31 10:22:41.000000000","message":"perhaps this debug statement generates a bit too much noise.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"},{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_8a480cce","line":728,"in_reply_to":"3a50d1a3_d1348be0","updated":"2015-07-31 11:33:44.000000000","message":"probably can go out once debugged.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":725,"context_line":"        \"\"\"Setup the map between devices and zones based on current rules.\"\"\""},{"line_number":726,"context_line":"        self._device_zone_map \u003d {}"},{"line_number":727,"context_line":"        rules \u003d self.iptables.get_rules_for_table(\u0027raw\u0027)"},{"line_number":728,"context_line":"        LOG.debug(\"Populating initial Zone map using rules: %s\", rules)"},{"line_number":729,"context_line":"        for rule in rules:"},{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_a48e3b25","line":728,"in_reply_to":"3a50d1a3_d1348be0","updated":"2015-08-01 01:09:32.000000000","message":"whoops, those were leftover from my testing.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_1ea1a246","line":733,"updated":"2015-07-31 10:22:41.000000000","message":"maybe a regex...","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_6a14a09e","line":733,"in_reply_to":"3a50d1a3_1ea1a246","updated":"2015-07-31 11:33:44.000000000","message":"Regex are cleaner I guess :)","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":730,"context_line":"            if \u0027--physdev-in \u0027 in rule and \u0027-j CT --zone\u0027 in rule:"},{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_4a43c16c","line":733,"in_reply_to":"3a50d1a3_6a14a09e","updated":"2015-08-01 01:09:32.000000000","message":"Done","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""},{"line_number":737,"context_line":"                                  \"connections may be interrupted.\"), rule)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_1e14424b","line":734,"updated":"2015-07-31 10:22:41.000000000","message":"let\u0027s hope we will never change the length of the interface name prefix...\nmaybe as we have a constant for this (OVS_HYBRID_TAP_PREFIX I think) you can use that constant length to be safer.\n\n(but the literals qvb and qvo are widely used anyway, so this a bit pointless pedantry)","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""},{"line_number":737,"context_line":"                                  \"connections may be interrupted.\"), rule)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_6d59f734","line":734,"in_reply_to":"3a50d1a3_1e14424b","updated":"2015-08-01 01:09:32.000000000","message":"Done","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":731,"context_line":"                try:"},{"line_number":732,"context_line":"                    dev \u003d rule.split(\u0027--physdev-in \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":733,"context_line":"                    zone \u003d rule.split(\u0027-j CT --zone \u0027)[1].strip().split(\u0027 \u0027)[0]"},{"line_number":734,"context_line":"                    self._device_zone_map[dev[3:]] \u003d int(zone)"},{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""},{"line_number":737,"context_line":"                                  \"connections may be interrupted.\"), rule)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_2a37784e","line":734,"in_reply_to":"3a50d1a3_1e14424b","updated":"2015-07-31 11:33:44.000000000","message":"Yes, using the const name, or define a PREFIX_LEN in constants wouldn\u0027t be bad either.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""},{"line_number":737,"context_line":"                                  \"connections may be interrupted.\"), rule)"},{"line_number":738,"context_line":"        LOG.debug(\"Zone map: %s\", self._device_zone_map)"},{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def _get_device_zone(self, device):"},{"line_number":741,"context_line":"        # strip the first three chars because we want the bridge and the tap"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_aa1aa8c4","line":738,"updated":"2015-07-31 11:33:44.000000000","message":"I guess it can be removed once debugged too.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":735,"context_line":"                except (IndexError, ValueError):"},{"line_number":736,"context_line":"                    LOG.error(_LE(\"Error checking existing zone rule \u0027%s\u0027. VM \""},{"line_number":737,"context_line":"                                  \"connections may be interrupted.\"), rule)"},{"line_number":738,"context_line":"        LOG.debug(\"Zone map: %s\", self._device_zone_map)"},{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def _get_device_zone(self, device):"},{"line_number":741,"context_line":"        # strip the first three chars because we want the bridge and the tap"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_c406e784","line":738,"in_reply_to":"3a50d1a3_aa1aa8c4","updated":"2015-08-01 01:09:32.000000000","message":"I think leaving this one in might not be a bad idea so we can see the zones when debugging conntrack stuff.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":749,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":750,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":751,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":752,"context_line":"        # free up any zones from removed ports first"},{"line_number":753,"context_line":"        existing_ports \u003d [self._get_device_name(port)[3:] for port in"},{"line_number":754,"context_line":"                          (self.filtered_ports.values() +"},{"line_number":755,"context_line":"                           self.unfiltered_ports.values())]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_cada94e9","line":752,"updated":"2015-07-31 11:33:44.000000000","message":"nit: I\u0027d split the cleanup block to a separate function, and probably call it from the _generate_device_zone caller too (extra pedantry).","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":749,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":750,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":751,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":752,"context_line":"        # free up any zones from removed ports first"},{"line_number":753,"context_line":"        existing_ports \u003d [self._get_device_name(port)[3:] for port in"},{"line_number":754,"context_line":"                          (self.filtered_ports.values() +"},{"line_number":755,"context_line":"                           self.unfiltered_ports.values())]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_f05cfa1a","line":752,"in_reply_to":"3a50d1a3_cada94e9","updated":"2015-08-01 01:09:32.000000000","message":"Done","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":750,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":751,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":752,"context_line":"        # free up any zones from removed ports first"},{"line_number":753,"context_line":"        existing_ports \u003d [self._get_device_name(port)[3:] for port in"},{"line_number":754,"context_line":"                          (self.filtered_ports.values() +"},{"line_number":755,"context_line":"                           self.unfiltered_ports.values())]"},{"line_number":756,"context_line":"        removed \u003d set(self._device_zone_map) - set(existing_ports)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_715497c9","line":753,"updated":"2015-07-31 10:22:41.000000000","message":"I don\u0027t know why your doing _get_device_name and then removing the prefix it appended.\n\nit seems you need to limit by LINUX_DEVICE_LEN, so perhaps it makes sense even if not a lot.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":750,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":751,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":752,"context_line":"        # free up any zones from removed ports first"},{"line_number":753,"context_line":"        existing_ports \u003d [self._get_device_name(port)[3:] for port in"},{"line_number":754,"context_line":"                          (self.filtered_ports.values() +"},{"line_number":755,"context_line":"                           self.unfiltered_ports.values())]"},{"line_number":756,"context_line":"        removed \u003d set(self._device_zone_map) - set(existing_ports)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_ed5c271b","line":753,"in_reply_to":"3a50d1a3_715497c9","updated":"2015-08-01 01:09:32.000000000","message":"it\u0027s LINUX_DEVICE_LEN - 3 because of the stripped prefix. I\u0027ll put that in here to make it more clear.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":770,"context_line":"            elif (used - used[index - 1]) !\u003d 1:"},{"line_number":771,"context_line":"                # gap found, let\u0027s use it!"},{"line_number":772,"context_line":"                self._device_zone_map[device] \u003d used - 1"},{"line_number":773,"context_line":"                break"},{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_f4c895aa","line":773,"updated":"2015-07-31 10:22:41.000000000","message":"why always iterate over the sorted array when in most cases you\u0027ll be appending (and a spot can be anywhere)\n\nThis maybe is easier:\n\ndef find_spot(x):\n\n    y\u003dsorted(x, reverse\u003dTrue)\n\n    previous \u003d y[0]\n\n    if previous \u003c 65535:\n\n        return previous + 1\n\n    for idx, item in enumerate(y):\n\n        if item \u003c previous - 1:\n\n            return previous -1\n\n        previous \u003d item\n\n\nx1 \u003d [3, 4, 2, 6, 8]\n\nx2 \u003d [6, 8, 25, 65535, 65534]\n\n\n\nprint \"%s:%s\" %(x1, find_spot(x1))\n\nprint \"%s:%s\" %(x2, find_spot(x2))","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":770,"context_line":"            elif (used - used[index - 1]) !\u003d 1:"},{"line_number":771,"context_line":"                # gap found, let\u0027s use it!"},{"line_number":772,"context_line":"                self._device_zone_map[device] \u003d used - 1"},{"line_number":773,"context_line":"                break"},{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_cd2e0ba5","line":773,"in_reply_to":"3a50d1a3_f4c895aa","updated":"2015-08-01 01:09:32.000000000","message":"I suppose. I\u0027m filling from the bottom up though after it hits the ceiling. :)","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":770,"context_line":"            elif (used - used[index - 1]) !\u003d 1:"},{"line_number":771,"context_line":"                # gap found, let\u0027s use it!"},{"line_number":772,"context_line":"                self._device_zone_map[device] \u003d used - 1"},{"line_number":773,"context_line":"                break"},{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_c53925da","line":773,"in_reply_to":"3a50d1a3_f4c895aa","updated":"2015-07-31 11:33:44.000000000","message":"It\u0027s just totally subjective, but I like finding lower available values.\n\nBoth implementations may work, but Salvatore\u0027s seem faster until you fill up the upper space.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":773,"context_line":"                break"},{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"},{"line_number":777,"context_line":"            if zone \u003e 65535:"},{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_257ec96a","line":776,"updated":"2015-07-31 11:33:44.000000000","message":"max(zones_in_use) \u003d-\u003e zones_in_use[-1] (since it\u0027s sorted?), saves one list iteration.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"},{"line_number":777,"context_line":"            if zone \u003e 65535:"},{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""},{"line_number":780,"context_line":"                                \"was randomly assigned to zone %(z)s.\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_e5bea1ff","line":777,"updated":"2015-07-31 11:33:44.000000000","message":"MAX_CONNTRACK_ZONES \u003d 65535 ?","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":774,"context_line":"        else:"},{"line_number":775,"context_line":"            # no gaps, we increment"},{"line_number":776,"context_line":"            zone \u003d (max(zones_in_use) + 1) if zones_in_use else 1"},{"line_number":777,"context_line":"            if zone \u003e 65535:"},{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""},{"line_number":780,"context_line":"                                \"was randomly assigned to zone %(z)s.\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_30aa62d3","line":777,"in_reply_to":"3a50d1a3_e5bea1ff","updated":"2015-08-01 01:09:32.000000000","message":"Done","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"99632ebc2b75126c3f06c445742c50aa8c984b01","unresolved":false,"context_lines":[{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""},{"line_number":780,"context_line":"                                \"was randomly assigned to zone %(z)s.\"),"},{"line_number":781,"context_line":"                            {\u0027p\u0027: device, \u0027z\u0027: zone})"},{"line_number":782,"context_line":"            self._device_zone_map[device] \u003d zone"},{"line_number":783,"context_line":"        LOG.debug(\"Zone assigned to device %s: %\","},{"line_number":784,"context_line":"                  (device, self._device_zone_map[device]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_91fda3b3","line":781,"updated":"2015-07-31 10:22:41.000000000","message":"It\u0027s safer to fail imho.\nIf we don\u0027t know the implication of this decision, let\u0027s just fail.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ce14998a1082fbc2f4a5d9107e959ef79ffd11e8","unresolved":false,"context_lines":[{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""},{"line_number":780,"context_line":"                                \"was randomly assigned to zone %(z)s.\"),"},{"line_number":781,"context_line":"                            {\u0027p\u0027: device, \u0027z\u0027: zone})"},{"line_number":782,"context_line":"            self._device_zone_map[device] \u003d zone"},{"line_number":783,"context_line":"        LOG.debug(\"Zone assigned to device %s: %\","},{"line_number":784,"context_line":"                  (device, self._device_zone_map[device]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_2d90cf4d","line":781,"in_reply_to":"3a50d1a3_25cc89ba","updated":"2015-08-01 01:09:32.000000000","message":"ok :(","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"55590c689953a0b5e8cbb59505c6d7c5fb11f1e0","unresolved":false,"context_lines":[{"line_number":778,"context_line":"                zone \u003d random.choice(zones_in_use)"},{"line_number":779,"context_line":"                LOG.warning(_LW(\"Unique iptables zones exhausted. Port %(p)s \""},{"line_number":780,"context_line":"                                \"was randomly assigned to zone %(z)s.\"),"},{"line_number":781,"context_line":"                            {\u0027p\u0027: device, \u0027z\u0027: zone})"},{"line_number":782,"context_line":"            self._device_zone_map[device] \u003d zone"},{"line_number":783,"context_line":"        LOG.debug(\"Zone assigned to device %s: %\","},{"line_number":784,"context_line":"                  (device, self._device_zone_map[device]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_25cc89ba","line":781,"in_reply_to":"3a50d1a3_91fda3b3","updated":"2015-07-31 11:33:44.000000000","message":"It doesn\u0027t feel that bad since we\u0027ve been without zones for ages. \n\nSaid that, It should be ok to fail, since 65535 means lots of ports, probably we only have chances to hit that with containers, if we even do...\n\nNo strong opinion here, but what @salvatore says makes sense.","commit_id":"f68015b389765e91812b3fed10cc937e176efc55"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"68ce4e546c1f1f6cd7cae9c76f6c8ad935e8ceeb","unresolved":false,"context_lines":[{"line_number":742,"context_line":"            return self._device_zone_map[device]"},{"line_number":743,"context_line":"        except KeyError:"},{"line_number":744,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":745,"context_line":"            return self._generate_device_zone(device)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _free_zones_from_removed_ports(self):"},{"line_number":748,"context_line":"        \"\"\"Clears any entries from the zone map of removed ports.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_0f0e193d","line":745,"updated":"2015-08-02 11:21:56.000000000","message":"if l2 agent reboots, the device zone will change, but its former ip_conntrack remain in old zone, what can we do for this case?","commit_id":"4487d2a2fd1b15280341214634c29ddcdcc00bda"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"965a60c5623a46ddc81e3eda104975de71b2d762","unresolved":false,"context_lines":[{"line_number":742,"context_line":"            return self._device_zone_map[device]"},{"line_number":743,"context_line":"        except KeyError:"},{"line_number":744,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":745,"context_line":"            return self._generate_device_zone(device)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _free_zones_from_removed_ports(self):"},{"line_number":748,"context_line":"        \"\"\"Clears any entries from the zone map of removed ports.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_bb65e3af","line":745,"in_reply_to":"3a50d1a3_0f0e193d","updated":"2015-08-02 18:40:51.000000000","message":"No, it shouldn\u0027t change. That\u0027s what the populate initial zone map function is for.","commit_id":"4487d2a2fd1b15280341214634c29ddcdcc00bda"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"ea03d3f80e19ddf98f0edcb28e18e31b143eed21","unresolved":false,"context_lines":[{"line_number":742,"context_line":"            return self._device_zone_map[device]"},{"line_number":743,"context_line":"        except KeyError:"},{"line_number":744,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":745,"context_line":"            return self._generate_device_zone(device)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _free_zones_from_removed_ports(self):"},{"line_number":748,"context_line":"        \"\"\"Clears any entries from the zone map of removed ports.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_3669e5f8","line":745,"in_reply_to":"3a50d1a3_bb65e3af","updated":"2015-08-03 01:52:59.000000000","message":"I got it, thx for your explanation","commit_id":"4487d2a2fd1b15280341214634c29ddcdcc00bda"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"d1063fa702fb27c46d26f805fba4bd1a75a9677a","unresolved":false,"context_lines":[{"line_number":759,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":760,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":761,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":762,"context_line":"        # look for any gaps before incrementing. We call set to dedup"},{"line_number":763,"context_line":"        # because old ports may be mapped to the same zone."},{"line_number":764,"context_line":"        zone \u003d self._find_open_zone()"},{"line_number":765,"context_line":"        self._device_zone_map[device] \u003d zone"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_cf80ad49","line":762,"updated":"2015-08-03 14:34:54.000000000","message":"Seems that _find_open_zone method looks for gaps only if it can\u0027t just increment the last zone number. In this case this comment should be updated. Or am I missing something?","commit_id":"86d323bfab2e7054440a256ee29f916b1159cb85"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"da43e0101e0b5710b7147c566bdaf7a71a88fc71","unresolved":false,"context_lines":[{"line_number":759,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":760,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":761,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":762,"context_line":"        # look for any gaps before incrementing. We call set to dedup"},{"line_number":763,"context_line":"        # because old ports may be mapped to the same zone."},{"line_number":764,"context_line":"        zone \u003d self._find_open_zone()"},{"line_number":765,"context_line":"        self._device_zone_map[device] \u003d zone"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_1f02ac0b","line":762,"in_reply_to":"1a4dcd0f_cf80ad49","updated":"2015-08-05 23:35:10.000000000","message":"good catch. this was the old approach.","commit_id":"86d323bfab2e7054440a256ee29f916b1159cb85"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"3dd78516f7950cacbbefd7892416d42d4f025d82","unresolved":false,"context_lines":[{"line_number":814,"context_line":"        LOG.debug(\"Populated conntrack zone map: %s\", self._device_zone_map)"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"    def get_device_zone(self, device):"},{"line_number":817,"context_line":"        # we always want the bridge and the tap device in the same zone to we"},{"line_number":818,"context_line":"        # map the bridge int to the tap interface."},{"line_number":819,"context_line":"        if device.startswith(\u0027qvb\u0027):"},{"line_number":820,"context_line":"            device \u003d device.replace(\u0027qvb\u0027, constants.TAP_DEVICE_PREFIX, 1)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_8f7529cc","line":817,"updated":"2015-08-12 01:59:56.000000000","message":"\"same zone to we\", spell mistake?","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"63fe6696f9391a8f05d5f0da9672ebcce453da1b","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        # we always want the bridge and the tap device in the same zone to we"},{"line_number":818,"context_line":"        # map the bridge int to the tap interface."},{"line_number":819,"context_line":"        if device.startswith(\u0027qvb\u0027):"},{"line_number":820,"context_line":"            device \u003d device.replace(\u0027qvb\u0027, constants.TAP_DEVICE_PREFIX, 1)"},{"line_number":821,"context_line":"        try:"},{"line_number":822,"context_line":"            return self._device_zone_map[device]"},{"line_number":823,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_98a309b2","line":820,"updated":"2015-08-12 16:38:43.000000000","message":"This is leaking OVS-specific code into the generic driver, it can be moved to the caller.","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"66c54a7fede8178c3f801d97efcb93b445dc12bf","unresolved":false,"context_lines":[{"line_number":817,"context_line":"        # we always want the bridge and the tap device in the same zone to we"},{"line_number":818,"context_line":"        # map the bridge int to the tap interface."},{"line_number":819,"context_line":"        if device.startswith(\u0027qvb\u0027):"},{"line_number":820,"context_line":"            device \u003d device.replace(\u0027qvb\u0027, constants.TAP_DEVICE_PREFIX, 1)"},{"line_number":821,"context_line":"        try:"},{"line_number":822,"context_line":"            return self._device_zone_map[device]"},{"line_number":823,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_c5ee8921","line":820,"in_reply_to":"1a4dcd0f_98a309b2","updated":"2015-08-12 18:07:21.000000000","message":"that won\u0027t work for the conntrack manager.","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"63fe6696f9391a8f05d5f0da9672ebcce453da1b","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":825,"context_line":"            return self._generate_device_zone(device)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def _free_zones_from_removed_ports(self):"},{"line_number":828,"context_line":"        \"\"\"Clears any entries from the zone map of removed ports.\"\"\""},{"line_number":829,"context_line":"        existing_ports \u003d ["},{"line_number":830,"context_line":"            self._get_device_name(port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_3d23c7be","line":827,"updated":"2015-08-12 16:38:43.000000000","message":"Does this need a lock decorator as well?  It is modifying self._device_zone_map","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"66c54a7fede8178c3f801d97efcb93b445dc12bf","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":825,"context_line":"            return self._generate_device_zone(device)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    def _free_zones_from_removed_ports(self):"},{"line_number":828,"context_line":"        \"\"\"Clears any entries from the zone map of removed ports.\"\"\""},{"line_number":829,"context_line":"        existing_ports \u003d ["},{"line_number":830,"context_line":"            self._get_device_name(port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_055c7117","line":827,"in_reply_to":"1a4dcd0f_3d23c7be","updated":"2015-08-12 18:07:21.000000000","message":"no, popping a missing device is okay. the lock is to prevent two from both thinking a zone is open and assigning a device to it.","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"63fe6696f9391a8f05d5f0da9672ebcce453da1b","unresolved":false,"context_lines":[{"line_number":888,"context_line":"        else:"},{"line_number":889,"context_line":"            device \u003d self._get_device_name(port)"},{"line_number":890,"context_line":"        jump_rule \u003d \u0027-m physdev --physdev-in %s -j CT --zone %s\u0027 % ("},{"line_number":891,"context_line":"            device, self.get_device_zone(device))"},{"line_number":892,"context_line":"        return jump_rule"},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"    def _add_raw_chain_rules(self, port, direction):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_58b26107","line":891,"updated":"2015-08-12 16:38:43.000000000","message":"This should do the qvb check and pass the changed device name along.","commit_id":"072b1d67215e31099e840fee98fa5c9836267a0e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9402be78f3181f9474affb96db624d1f011d74d1","unresolved":false,"context_lines":[{"line_number":812,"context_line":"                             r\u0027.* -j CT --zone (?P\u003czone\u003e\\d+).*\u0027, rule)"},{"line_number":813,"context_line":"            if match:"},{"line_number":814,"context_line":"                # strip off any prefix that the interface is using"},{"line_number":815,"context_line":"                dev \u003d match.group(\u0027dev\u0027)[LINUX_DEV_PREFIX_LEN:]"},{"line_number":816,"context_line":"                self._device_zone_map[dev] \u003d int(match.group(\u0027zone\u0027))"},{"line_number":817,"context_line":"        LOG.debug(\"Populated conntrack zone map: %s\", self._device_zone_map)"},{"line_number":818,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_3b83c504","line":815,"updated":"2015-08-12 21:11:05.000000000","message":"nit: should be port_id to match other code","commit_id":"693b3c2fbeebac654b29b81f7aba979e124ab7e1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"626b542d2cc17b11146121e1c3064f80762a3531","unresolved":false,"context_lines":[{"line_number":812,"context_line":"                             r\u0027.* -j CT --zone (?P\u003czone\u003e\\d+).*\u0027, rule)"},{"line_number":813,"context_line":"            if match:"},{"line_number":814,"context_line":"                # strip off any prefix that the interface is using"},{"line_number":815,"context_line":"                dev \u003d match.group(\u0027dev\u0027)[LINUX_DEV_PREFIX_LEN:]"},{"line_number":816,"context_line":"                self._device_zone_map[dev] \u003d int(match.group(\u0027zone\u0027))"},{"line_number":817,"context_line":"        LOG.debug(\"Populated conntrack zone map: %s\", self._device_zone_map)"},{"line_number":818,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_ca60c903","line":815,"in_reply_to":"1a4dcd0f_3b83c504","updated":"2015-08-13 00:21:41.000000000","message":"Done","commit_id":"693b3c2fbeebac654b29b81f7aba979e124ab7e1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"626b542d2cc17b11146121e1c3064f80762a3531","unresolved":false,"context_lines":[{"line_number":837,"context_line":"        for dev in removed:"},{"line_number":838,"context_line":"            self._device_zone_map.pop(dev, None)"},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":841,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":842,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":843,"context_line":"        zone \u003d self._find_open_zone()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_4a4cb99d","line":840,"updated":"2015-08-13 00:21:41.000000000","message":"This semaphore isn\u0027t necessary. None of the actions between involved in finding and assigning a zone yield.","commit_id":"693b3c2fbeebac654b29b81f7aba979e124ab7e1"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9402be78f3181f9474affb96db624d1f011d74d1","unresolved":false,"context_lines":[{"line_number":838,"context_line":"            self._device_zone_map.pop(dev, None)"},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":841,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":842,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":843,"context_line":"        zone \u003d self._find_open_zone()"},{"line_number":844,"context_line":"        self._device_zone_map[device] \u003d zone"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_5ba331b2","line":841,"updated":"2015-08-12 21:11:05.000000000","message":"nit: arg should be port_id along with debug message.","commit_id":"693b3c2fbeebac654b29b81f7aba979e124ab7e1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"626b542d2cc17b11146121e1c3064f80762a3531","unresolved":false,"context_lines":[{"line_number":838,"context_line":"            self._device_zone_map.pop(dev, None)"},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"    @lockutils.synchronized(\u0027zone-generation\u0027)"},{"line_number":841,"context_line":"    def _generate_device_zone(self, device):"},{"line_number":842,"context_line":"        \"\"\"Generates a unique conntrack zone for the device.\"\"\""},{"line_number":843,"context_line":"        zone \u003d self._find_open_zone()"},{"line_number":844,"context_line":"        self._device_zone_map[device] \u003d zone"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_0a423168","line":841,"in_reply_to":"1a4dcd0f_5ba331b2","updated":"2015-08-13 00:21:41.000000000","message":"Done","commit_id":"693b3c2fbeebac654b29b81f7aba979e124ab7e1"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5d2a66365058712c614d50ed3b496ce2764e04af","unresolved":false,"context_lines":[{"line_number":818,"context_line":"    def get_device_zone(self, port_id):"},{"line_number":819,"context_line":"        # the initial zone map is constructed from device names so we index"},{"line_number":820,"context_line":"        # everything based on the port uuid fragment"},{"line_number":821,"context_line":"        short_port_id \u003d port_id[:(LINUX_DEV_LEN - LINUX_DEV_PREFIX_LEN)]"},{"line_number":822,"context_line":"        try:"},{"line_number":823,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":824,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_21586630","line":821,"updated":"2015-08-13 07:44:53.000000000","message":"What\u0027s the advantage of using only the uuid part for indexing?\n\nI guess I\u0027m missing an important detail here..","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"67527f24154700b849fa23aa5409763e4c378081","unresolved":false,"context_lines":[{"line_number":818,"context_line":"    def get_device_zone(self, port_id):"},{"line_number":819,"context_line":"        # the initial zone map is constructed from device names so we index"},{"line_number":820,"context_line":"        # everything based on the port uuid fragment"},{"line_number":821,"context_line":"        short_port_id \u003d port_id[:(LINUX_DEV_LEN - LINUX_DEV_PREFIX_LEN)]"},{"line_number":822,"context_line":"        try:"},{"line_number":823,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":824,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_d14e196e","line":821,"in_reply_to":"1a4dcd0f_21586630","updated":"2015-08-13 15:16:53.000000000","message":"Miguel - yes, it might need that we need a better comment here, or above in _populate_initial_zone_map().  I\u0027ll try to explain what I know...\n\nIn the initial zone map creation above, all we have is something like \u0027tapfcd99706-45\u0027, so we can only extract 11 chars to populate the zone map with (must drop the \u0027tap\u0027 part).  Once running, callers will be passing an entire port uuid, so we need to take just the first 11 chars so we map that into the same zone map \"bucket\".\n\nThe goal is that all callers dealing with the same port, or set of ports in the tap/qvb cases, get the same zone map and use the same zone id.  The port_id is common across all those so works well as an index.\n\nKevin might have a better explanation...","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a0fb66ee4437e94cae1ed2941c38b2aa80a30504","unresolved":false,"context_lines":[{"line_number":818,"context_line":"    def get_device_zone(self, port_id):"},{"line_number":819,"context_line":"        # the initial zone map is constructed from device names so we index"},{"line_number":820,"context_line":"        # everything based on the port uuid fragment"},{"line_number":821,"context_line":"        short_port_id \u003d port_id[:(LINUX_DEV_LEN - LINUX_DEV_PREFIX_LEN)]"},{"line_number":822,"context_line":"        try:"},{"line_number":823,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":824,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_a777853a","line":821,"in_reply_to":"1a4dcd0f_d14e196e","updated":"2015-08-13 19:16:05.000000000","message":"I\u0027ll expand the comment a bit more.","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b4d190111113cc6c077fa0879875b68e7196c774","unresolved":false,"context_lines":[{"line_number":858,"context_line":"            if index \u003d\u003d 0:"},{"line_number":859,"context_line":"                # first zone used should be 1"},{"line_number":860,"context_line":"                if used !\u003d 1:"},{"line_number":861,"context_line":"                    return 1"},{"line_number":862,"context_line":"                continue"},{"line_number":863,"context_line":"            diff_from_last \u003d used - zones_in_use[index - 1]"},{"line_number":864,"context_line":"            if diff_from_last !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_b1410d0c","line":861,"updated":"2015-08-13 15:22:12.000000000","message":"it would be nice to test this code path in the unit test...","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a0fb66ee4437e94cae1ed2941c38b2aa80a30504","unresolved":false,"context_lines":[{"line_number":858,"context_line":"            if index \u003d\u003d 0:"},{"line_number":859,"context_line":"                # first zone used should be 1"},{"line_number":860,"context_line":"                if used !\u003d 1:"},{"line_number":861,"context_line":"                    return 1"},{"line_number":862,"context_line":"                continue"},{"line_number":863,"context_line":"            diff_from_last \u003d used - zones_in_use[index - 1]"},{"line_number":864,"context_line":"            if diff_from_last !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_47748135","line":861,"in_reply_to":"1a4dcd0f_b1410d0c","updated":"2015-08-13 19:16:05.000000000","message":"Done","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8aa86ecab57ec886bf889e2dd52939185942dc5d","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        last \u003d zones_in_use[-1]"},{"line_number":857,"context_line":"        if last \u003c MAX_CONNTRACK_ZONES:"},{"line_number":858,"context_line":"            return last + 1"},{"line_number":859,"context_line":"        for index, used in enumerate(zones_in_use):"},{"line_number":860,"context_line":"            if index \u003d\u003d 0:"},{"line_number":861,"context_line":"                # first zone used should be 1"},{"line_number":862,"context_line":"                if used !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_e13ed08a","line":859,"updated":"2015-08-13 23:35:57.000000000","message":"When I figured out what this does, a simpler alternative came to mind.  Would this work?\n\nfor index, used in enumerate(zones_in_use):\n    if used - index !\u003d 1:\n        # gap found, let\u0027s use it!\n        return index + 1","commit_id":"c52978c12df03283c3bdce02a873b1d6f0c7ee99"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8ef50f573e1b0901860a8874b5bd8054db143f42","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        last \u003d zones_in_use[-1]"},{"line_number":857,"context_line":"        if last \u003c MAX_CONNTRACK_ZONES:"},{"line_number":858,"context_line":"            return last + 1"},{"line_number":859,"context_line":"        for index, used in enumerate(zones_in_use):"},{"line_number":860,"context_line":"            if index \u003d\u003d 0:"},{"line_number":861,"context_line":"                # first zone used should be 1"},{"line_number":862,"context_line":"                if used !\u003d 1:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_fc84330c","line":859,"in_reply_to":"1a4dcd0f_e13ed08a","updated":"2015-08-14 00:21:27.000000000","message":"yes, much better, thanks","commit_id":"c52978c12df03283c3bdce02a873b1d6f0c7ee99"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8aa86ecab57ec886bf889e2dd52939185942dc5d","unresolved":false,"context_lines":[{"line_number":866,"context_line":"            if diff_from_last !\u003d 1:"},{"line_number":867,"context_line":"                # gap found, let\u0027s use it!"},{"line_number":868,"context_line":"                return (used - diff_from_last) + 1"},{"line_number":869,"context_line":"        # conntrack zones exhausted :("},{"line_number":870,"context_line":"        raise RuntimeError(\"iptables conntrack zones exhausted. \""},{"line_number":871,"context_line":"                           \"iptables rules cannot be applied.\")"},{"line_number":872,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_611ba074","line":869,"updated":"2015-08-13 23:35:57.000000000","message":"I think you should use a sadder face in this comment.  Like a double sad face maybe.  This single sad face doesn\u0027t convey the true sadness one should feel if we hit this.","commit_id":"c52978c12df03283c3bdce02a873b1d6f0c7ee99"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8ef50f573e1b0901860a8874b5bd8054db143f42","unresolved":false,"context_lines":[{"line_number":866,"context_line":"            if diff_from_last !\u003d 1:"},{"line_number":867,"context_line":"                # gap found, let\u0027s use it!"},{"line_number":868,"context_line":"                return (used - diff_from_last) + 1"},{"line_number":869,"context_line":"        # conntrack zones exhausted :("},{"line_number":870,"context_line":"        raise RuntimeError(\"iptables conntrack zones exhausted. \""},{"line_number":871,"context_line":"                           \"iptables rules cannot be applied.\")"},{"line_number":872,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_bc778b3a","line":869,"in_reply_to":"1a4dcd0f_611ba074","updated":"2015-08-14 00:21:27.000000000","message":"Done","commit_id":"c52978c12df03283c3bdce02a873b1d6f0c7ee99"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"fa75c7858a1323c17742be5492d30cdcebade6b7","unresolved":false,"context_lines":[{"line_number":859,"context_line":"        for index, used in enumerate(zones_in_use):"},{"line_number":860,"context_line":"            if used - index !\u003d 1:"},{"line_number":861,"context_line":"                    # gap found, let\u0027s use it!"},{"line_number":862,"context_line":"                    return index + 1"},{"line_number":863,"context_line":"        # conntrack zones exhausted :( :("},{"line_number":864,"context_line":"        raise RuntimeError(\"iptables conntrack zones exhausted. \""},{"line_number":865,"context_line":"                           \"iptables rules cannot be applied.\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_a2f6868e","line":862,"updated":"2015-08-14 01:33:41.000000000","message":"indentation, and flake8 didn\u0027t seem to care :(","commit_id":"e2b5e414ec6d5c16bd0e23b610493901eaf41f31"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"74b1da7363ad7caaabaf45fa6fc42607aeff70e7","unresolved":false,"context_lines":[{"line_number":859,"context_line":"        for index, used in enumerate(zones_in_use):"},{"line_number":860,"context_line":"            if used - index !\u003d 1:"},{"line_number":861,"context_line":"                    # gap found, let\u0027s use it!"},{"line_number":862,"context_line":"                    return index + 1"},{"line_number":863,"context_line":"        # conntrack zones exhausted :( :("},{"line_number":864,"context_line":"        raise RuntimeError(\"iptables conntrack zones exhausted. \""},{"line_number":865,"context_line":"                           \"iptables rules cannot be applied.\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_a2b99ccd","line":862,"in_reply_to":"1a4dcd0f_0fb2fe06","updated":"2015-08-14 07:47:53.000000000","message":":-)","commit_id":"e2b5e414ec6d5c16bd0e23b610493901eaf41f31"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e54d0767c5eb16ee7a43b690c8f93b461ef923e8","unresolved":false,"context_lines":[{"line_number":859,"context_line":"        for index, used in enumerate(zones_in_use):"},{"line_number":860,"context_line":"            if used - index !\u003d 1:"},{"line_number":861,"context_line":"                    # gap found, let\u0027s use it!"},{"line_number":862,"context_line":"                    return index + 1"},{"line_number":863,"context_line":"        # conntrack zones exhausted :( :("},{"line_number":864,"context_line":"        raise RuntimeError(\"iptables conntrack zones exhausted. \""},{"line_number":865,"context_line":"                           \"iptables rules cannot be applied.\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_0fb2fe06","line":862,"in_reply_to":"1a4dcd0f_a2f6868e","updated":"2015-08-14 04:11:38.000000000","message":"the indent is for extra emphasis on the excitement of finding a gap.","commit_id":"e2b5e414ec6d5c16bd0e23b610493901eaf41f31"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7e0801c6d3511bd9bb7c167d42c6526cf1d0dee1","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":826,"context_line":"        except KeyError:"},{"line_number":827,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":828,"context_line":"            return self._generate_device_zone(short_port_id)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _free_zones_from_removed_ports(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_62fb7048","line":827,"updated":"2015-08-14 20:34:18.000000000","message":"So this call caught my attention now, and it highlights the fact that we never clear a zone map when a port is removed, but wait until there is a collision to free up a bunch.  Seems we should be cleaning these up as we go.","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"be274fc235f407bb0971ea4c4731225973e384b4","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":826,"context_line":"        except KeyError:"},{"line_number":827,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":828,"context_line":"            return self._generate_device_zone(short_port_id)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _free_zones_from_removed_ports(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_ec1433a0","line":827,"in_reply_to":"1a4dcd0f_62fb7048","updated":"2015-08-17 04:34:00.000000000","message":"It\u0027s not waiting until a collision, it just happens every time a new zone needs to be allocated for a port.\n\nI preferred this approach because it means that we don\u0027t have to worry about cleaning up in the various places that a port can be removed.","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3239234cade1c1707d739687dfa4557bd12f70f8","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":826,"context_line":"        except KeyError:"},{"line_number":827,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":828,"context_line":"            return self._generate_device_zone(short_port_id)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _free_zones_from_removed_ports(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_c0bc9bdd","line":827,"in_reply_to":"1a4dcd0f_ec1433a0","updated":"2015-08-17 05:13:10.000000000","message":"Both ways should work. With different advantages. I like the \"garbage collector\" style here, is fail proof for port removal/deletion.","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c07dca299532e751521574fa339201def73a4fa2","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        try:"},{"line_number":825,"context_line":"            return self._device_zone_map[short_port_id]"},{"line_number":826,"context_line":"        except KeyError:"},{"line_number":827,"context_line":"            self._free_zones_from_removed_ports()"},{"line_number":828,"context_line":"            return self._generate_device_zone(short_port_id)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"    def _free_zones_from_removed_ports(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_f7a9ace0","line":827,"updated":"2015-08-17 17:33:41.000000000","message":"Thanks for the explanation on this call, but now I have another nit :)\n\nself._generate_device_zone() will most likely succeed even without this cleanup call, since we have 64K zone ids.  So the cleanup is really a pre-emptive attempt to not hit the exhaustion point on L864, correct?  So we are imposing an overhead here that isn\u0027t exactly necessary.\n\nBTW, the main reason I\u0027ve been noticing this code is that this is the only place self._free_zones_from_removed_ports() is called, and it just seems out of place for what it is doing.","commit_id":"7e9b0e4ac53e83b18dd949564435710e86c7b81e"}],"neutron/agent/securitygroups_rpc.py":[{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"6711fa1bbd34601bae2a677955ea8384fd302d0c","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.global_refresh_firewall \u003d False"},{"line_number":111,"context_line":"        self._use_enhanced_rpc \u003d None"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def set_local_zone(self, device):"},{"line_number":114,"context_line":"        \"\"\"Set local zone id for device"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        In order to separate conntrack in different networks, a local zone"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_f1772c9d","side":"PARENT","line":113,"updated":"2015-08-11 06:22:55.000000000","message":"hi ajo, kevin, the patch for managing VM ip conntrack has merged #https://review.openstack.org/#/c/147713/, it use the value of device[\u0027zone_id\u0027] to delete a port ip conntrack, so if we remove the method, we need add a new method to get a port zone id in class OVSHybridIptablesFirewallDriver.","commit_id":"50d662d95a03fa7986c0ddadb386cad12590c0ab"}],"neutron/tests/unit/agent/linux/test_iptables_firewall.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b4d190111113cc6c077fa0879875b68e7196c774","unresolved":false,"context_lines":[{"line_number":1840,"context_line":"        self.assertEqual(expected, self.firewall._device_zone_map)"},{"line_number":1841,"context_line":""},{"line_number":1842,"context_line":"    def test__generate_device_zone(self):"},{"line_number":1843,"context_line":"        # inital data has 1, 2, and 9 in use."},{"line_number":1844,"context_line":"        # we fill from top up first."},{"line_number":1845,"context_line":"        self.assertEqual(10, self.firewall._generate_device_zone(\u0027test\u0027))"},{"line_number":1846,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_d12db946","line":1843,"updated":"2015-08-13 15:22:12.000000000","message":"if you make remove/replace 1 in the initial data you can test the code path I was mentioning in my previous comment","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a0fb66ee4437e94cae1ed2941c38b2aa80a30504","unresolved":false,"context_lines":[{"line_number":1840,"context_line":"        self.assertEqual(expected, self.firewall._device_zone_map)"},{"line_number":1841,"context_line":""},{"line_number":1842,"context_line":"    def test__generate_device_zone(self):"},{"line_number":1843,"context_line":"        # inital data has 1, 2, and 9 in use."},{"line_number":1844,"context_line":"        # we fill from top up first."},{"line_number":1845,"context_line":"        self.assertEqual(10, self.firewall._generate_device_zone(\u0027test\u0027))"},{"line_number":1846,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_c77f3116","line":1843,"in_reply_to":"1a4dcd0f_d12db946","updated":"2015-08-13 19:16:05.000000000","message":"Done","commit_id":"cc89784c1659180c34952d369c7153b45f44fff4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7e0801c6d3511bd9bb7c167d42c6526cf1d0dee1","unresolved":false,"context_lines":[{"line_number":1053,"context_line":""},{"line_number":1054,"context_line":"    def _test_remove_conntrack_entries(self, ethertype, protocol,"},{"line_number":1055,"context_line":"                                       direction):"},{"line_number":1056,"context_line":"        port \u003d self._fake_port()"},{"line_number":1057,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1058,"context_line":"        port[\u0027security_groups\u0027] \u003d \u0027fake_sg_id\u0027"},{"line_number":1059,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_a2af382a","line":1056,"updated":"2015-08-14 20:34:18.000000000","message":"Don\u0027t think this is necessary any more","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3239234cade1c1707d739687dfa4557bd12f70f8","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"    def _test_remove_conntrack_entries(self, ethertype, protocol,"},{"line_number":1055,"context_line":"                                       direction):"},{"line_number":1056,"context_line":"        port \u003d self._fake_port()"},{"line_number":1057,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1058,"context_line":"        port[\u0027security_groups\u0027] \u003d \u0027fake_sg_id\u0027"},{"line_number":1059,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1060,"context_line":"        self.firewall.updated_rule_sg_ids \u003d set([\u0027fake_sg_id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_20953f3f","line":1057,"updated":"2015-08-17 05:13:10.000000000","message":"Good catch :)","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e996d29448d7af0bc316d4d420b78831693d4c17","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"    def _test_remove_conntrack_entries(self, ethertype, protocol,"},{"line_number":1055,"context_line":"                                       direction):"},{"line_number":1056,"context_line":"        port \u003d self._fake_port()"},{"line_number":1057,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1058,"context_line":"        port[\u0027security_groups\u0027] \u003d \u0027fake_sg_id\u0027"},{"line_number":1059,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1060,"context_line":"        self.firewall.updated_rule_sg_ids \u003d set([\u0027fake_sg_id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_edf1b102","line":1057,"updated":"2015-08-14 20:37:25.000000000","message":"I meant this line :)","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"be274fc235f407bb0971ea4c4731225973e384b4","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"    def _test_remove_conntrack_entries(self, ethertype, protocol,"},{"line_number":1055,"context_line":"                                       direction):"},{"line_number":1056,"context_line":"        port \u003d self._fake_port()"},{"line_number":1057,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1058,"context_line":"        port[\u0027security_groups\u0027] \u003d \u0027fake_sg_id\u0027"},{"line_number":1059,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1060,"context_line":"        self.firewall.updated_rule_sg_ids \u003d set([\u0027fake_sg_id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_2c1bfbcb","line":1057,"in_reply_to":"1a4dcd0f_edf1b102","updated":"2015-08-17 04:34:00.000000000","message":"Done","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7e0801c6d3511bd9bb7c167d42c6526cf1d0dee1","unresolved":false,"context_lines":[{"line_number":1099,"context_line":"                    \u0027IPv6\u0027, pro, direction)"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_remove_conntrack_entries_for_port_sec_group_change(self):"},{"line_number":1102,"context_line":"        port \u003d self._fake_port()"},{"line_number":1103,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1104,"context_line":"        port[\u0027security_groups\u0027] \u003d [\u0027fake_sg_id\u0027]"},{"line_number":1105,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_62a93024","line":1102,"updated":"2015-08-14 20:34:18.000000000","message":"Don\u0027t think this is necessary any more","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e996d29448d7af0bc316d4d420b78831693d4c17","unresolved":false,"context_lines":[{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_remove_conntrack_entries_for_port_sec_group_change(self):"},{"line_number":1102,"context_line":"        port \u003d self._fake_port()"},{"line_number":1103,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1104,"context_line":"        port[\u0027security_groups\u0027] \u003d [\u0027fake_sg_id\u0027]"},{"line_number":1105,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1106,"context_line":"        self.firewall.updated_sg_members \u003d set([\u0027tapfake_dev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_addc0975","line":1103,"updated":"2015-08-14 20:37:25.000000000","message":"And this one","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"be274fc235f407bb0971ea4c4731225973e384b4","unresolved":false,"context_lines":[{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_remove_conntrack_entries_for_port_sec_group_change(self):"},{"line_number":1102,"context_line":"        port \u003d self._fake_port()"},{"line_number":1103,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1104,"context_line":"        port[\u0027security_groups\u0027] \u003d [\u0027fake_sg_id\u0027]"},{"line_number":1105,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1106,"context_line":"        self.firewall.updated_sg_members \u003d set([\u0027tapfake_dev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_cc7857fb","line":1103,"in_reply_to":"1a4dcd0f_addc0975","updated":"2015-08-17 04:34:00.000000000","message":"Done","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3239234cade1c1707d739687dfa4557bd12f70f8","unresolved":false,"context_lines":[{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def test_remove_conntrack_entries_for_port_sec_group_change(self):"},{"line_number":1102,"context_line":"        port \u003d self._fake_port()"},{"line_number":1103,"context_line":"        port[\u0027zone_id\u0027] \u003d 1"},{"line_number":1104,"context_line":"        port[\u0027security_groups\u0027] \u003d [\u0027fake_sg_id\u0027]"},{"line_number":1105,"context_line":"        self.firewall.filtered_ports[port[\u0027device\u0027]] \u003d port"},{"line_number":1106,"context_line":"        self.firewall.updated_sg_members \u003d set([\u0027tapfake_dev\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_40908b4e","line":1103,"in_reply_to":"1a4dcd0f_addc0975","updated":"2015-08-17 05:13:10.000000000","message":"good catch :)","commit_id":"1d705c9dfebd8533549a1eb481e6a45cf60b1663"}]}
