)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"85c4d17d2d6a303bf44226d77173d17837e23da1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     yuli \u003cyuli.stremovsky@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-09-18 13:30:03 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Optimize code to handle swith update event"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I21a409381aebe07fab6a3da766f9a2f958b4300e"},{"line_number":10,"context_line":"Closes-bug: #1620471"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7a8ec9b2_ca70ff42","line":7,"range":{"start_line":7,"start_character":24,"end_line":7,"end_character":29},"updated":"2016-09-18 10:54:03.000000000","message":"switch?","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"}],"dragonflow/controller/dhcp_app.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"85c4d17d2d6a303bf44226d77173d17837e23da1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":78,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":79,"context_line":"                self.packet_in_handler)"},{"line_number":80,"context_line":"        self.switch_dhcp_ip_map \u003d {}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":83,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_2afde36d","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":36},"updated":"2016-09-18 10:54:03.000000000","message":"I would suggest using collections.defaultdict(set) here. It can simplify code in the following handling.","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"abc7bfec9b4b27a247c773a6b443c4d60a9ced36","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":78,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":79,"context_line":"                self.packet_in_handler)"},{"line_number":80,"context_line":"        self.switch_dhcp_ip_map \u003d {}"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":83,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_8ad997f5","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":36},"in_reply_to":"7a8ec9b2_2afde36d","updated":"2016-09-18 11:06:39.000000000","message":"Done","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"85c4d17d2d6a303bf44226d77173d17837e23da1","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":452,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":453,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":454,"context_line":"        deleted_dhcp_ips \u003d list(set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":455,"context_line":"                                set(all_dhcp_ips))"},{"line_number":456,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":457,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_2a340348","line":454,"range":{"start_line":454,"start_character":27,"end_line":454,"end_character":31},"updated":"2016-09-18 10:54:03.000000000","message":"It is actually no need to convert back to list, the set is also iteratable.","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"abc7bfec9b4b27a247c773a6b443c4d60a9ced36","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":452,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":453,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":454,"context_line":"        deleted_dhcp_ips \u003d list(set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":455,"context_line":"                                set(all_dhcp_ips))"},{"line_number":456,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":457,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_4ad30fd5","line":454,"range":{"start_line":454,"start_character":27,"end_line":454,"end_character":31},"in_reply_to":"7a8ec9b2_2a340348","updated":"2016-09-18 11:06:39.000000000","message":"Done","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"85c4d17d2d6a303bf44226d77173d17837e23da1","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":454,"context_line":"        deleted_dhcp_ips \u003d list(set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":455,"context_line":"                                set(all_dhcp_ips))"},{"line_number":456,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":457,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"    def remove_logical_switch(self, lswitch):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_caec7fbd","line":456,"range":{"start_line":456,"start_character":8,"end_line":456,"end_character":40},"updated":"2016-09-18 10:54:03.000000000","message":"I think you should remove the dhcp_ip from  self.switch_dhcp_ip_map here.","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"abc7bfec9b4b27a247c773a6b443c4d60a9ced36","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":454,"context_line":"        deleted_dhcp_ips \u003d list(set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":455,"context_line":"                                set(all_dhcp_ips))"},{"line_number":456,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":457,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"    def remove_logical_switch(self, lswitch):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_6ade0bde","line":456,"range":{"start_line":456,"start_character":8,"end_line":456,"end_character":40},"in_reply_to":"7a8ec9b2_caec7fbd","updated":"2016-09-18 11:06:39.000000000","message":"Done","commit_id":"4d88c5e40086293525a5eb4c17d9bd2d4c7a7a03"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b9bc0ab2cb5e8d272aaeb21ecedb4e52ddf35c6a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":79,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":80,"context_line":"                self.packet_in_handler)"},{"line_number":81,"context_line":"        self.switch_dhcp_ip_map \u003d collections.defaultdict(map)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":84,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8ec9b2_6a8c4bda","line":81,"updated":"2016-09-18 11:11:53.000000000","message":"That\u0027s not how you use defaultdict. Please review https://docs.python.org/2/library/collections.html#collections.defaultdict .","commit_id":"398ac35aafa02bddf1d1c21241e18d0d6d363be4"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"72175760d4032ac9e6d06bba05f1cbdc1687beed","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":79,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":80,"context_line":"                self.packet_in_handler)"},{"line_number":81,"context_line":"        self.switch_dhcp_ip_map \u003d collections.defaultdict(map)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":84,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8ec9b2_8a5c374c","line":81,"in_reply_to":"7a8ec9b2_6a8c4bda","updated":"2016-09-18 11:17:19.000000000","message":"Done","commit_id":"398ac35aafa02bddf1d1c21241e18d0d6d363be4"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b9bc0ab2cb5e8d272aaeb21ecedb4e52ddf35c6a","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            lswitch.get_id(),"},{"line_number":444,"context_line":"        )"},{"line_number":445,"context_line":"        all_dhcp_ips \u003d set()"},{"line_number":446,"context_line":"        if network_id not in self.switch_dhcp_ip_map:"},{"line_number":447,"context_line":"            self.switch_dhcp_ip_map[network_id] \u003d set()"},{"line_number":448,"context_line":"        for subnet in subnets:"},{"line_number":449,"context_line":"            if self._is_ipv4(subnet) and subnet.enable_dhcp():"},{"line_number":450,"context_line":"                dhcp_ip \u003d subnet.get_dhcp_server_address()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8ec9b2_ca8d5fd4","line":447,"range":{"start_line":446,"start_character":0,"end_line":447,"end_character":55},"updated":"2016-09-18 11:11:53.000000000","message":"This block is not needed with defaultdict.","commit_id":"398ac35aafa02bddf1d1c21241e18d0d6d363be4"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"72175760d4032ac9e6d06bba05f1cbdc1687beed","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            lswitch.get_id(),"},{"line_number":444,"context_line":"        )"},{"line_number":445,"context_line":"        all_dhcp_ips \u003d set()"},{"line_number":446,"context_line":"        if network_id not in self.switch_dhcp_ip_map:"},{"line_number":447,"context_line":"            self.switch_dhcp_ip_map[network_id] \u003d set()"},{"line_number":448,"context_line":"        for subnet in subnets:"},{"line_number":449,"context_line":"            if self._is_ipv4(subnet) and subnet.enable_dhcp():"},{"line_number":450,"context_line":"                dhcp_ip \u003d subnet.get_dhcp_server_address()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8ec9b2_aa573324","line":447,"range":{"start_line":446,"start_character":0,"end_line":447,"end_character":55},"in_reply_to":"7a8ec9b2_ca8d5fd4","updated":"2016-09-18 11:17:19.000000000","message":"Done","commit_id":"398ac35aafa02bddf1d1c21241e18d0d6d363be4"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"83429d390d7818222020696689cb6eddfb3df5f6","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":79,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":80,"context_line":"                self.packet_in_handler)"},{"line_number":81,"context_line":"        self.switch_dhcp_ip_map \u003d collections.defaultdict(list)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":84,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_ea33fb11","line":81,"range":{"start_line":81,"start_character":58,"end_line":81,"end_character":62},"updated":"2016-09-18 11:18:40.000000000","message":"You can just use set here.","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"8a7e4a88c84fdc3caed10c6362fa01551c57fa8f","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.local_tunnel_to_pid_map \u003d {}"},{"line_number":79,"context_line":"        self.api.register_table_handler(const.DHCP_TABLE,"},{"line_number":80,"context_line":"                self.packet_in_handler)"},{"line_number":81,"context_line":"        self.switch_dhcp_ip_map \u003d collections.defaultdict(list)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def switch_features_handler(self, ev):"},{"line_number":84,"context_line":"        self._install_dhcp_broadcast_match_flow()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_8d6611eb","line":81,"range":{"start_line":81,"start_character":58,"end_line":81,"end_character":62},"in_reply_to":"7a8ec9b2_ea33fb11","updated":"2016-09-18 11:33:23.000000000","message":"Done","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"83429d390d7818222020696689cb6eddfb3df5f6","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                dhcp_ip \u003d subnet.get_dhcp_server_address()"},{"line_number":449,"context_line":"                if dhcp_ip not in self.switch_dhcp_ip_map[network_id]:"},{"line_number":450,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_0a3747ff","line":451,"range":{"start_line":451,"start_character":56,"end_line":451,"end_character":62},"updated":"2016-09-18 11:18:40.000000000","message":"set don\u0027t support append, try to use add here.","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"8a7e4a88c84fdc3caed10c6362fa01551c57fa8f","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                dhcp_ip \u003d subnet.get_dhcp_server_address()"},{"line_number":449,"context_line":"                if dhcp_ip not in self.switch_dhcp_ip_map[network_id]:"},{"line_number":450,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_2d6dfdcb","line":451,"range":{"start_line":451,"start_character":56,"end_line":451,"end_character":62},"in_reply_to":"7a8ec9b2_0a3747ff","updated":"2016-09-18 11:33:23.000000000","message":"Done","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"83429d390d7818222020696689cb6eddfb3df5f6","unresolved":false,"context_lines":[{"line_number":449,"context_line":"                if dhcp_ip not in self.switch_dhcp_ip_map[network_id]:"},{"line_number":450,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"},{"line_number":455,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_2a3a43e7","line":452,"range":{"start_line":452,"start_character":29,"end_line":452,"end_character":35},"updated":"2016-09-18 11:18:40.000000000","message":"ditto","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"8a7e4a88c84fdc3caed10c6362fa01551c57fa8f","unresolved":false,"context_lines":[{"line_number":449,"context_line":"                if dhcp_ip not in self.switch_dhcp_ip_map[network_id]:"},{"line_number":450,"context_line":"                    self._install_dhcp_unicast_match_flow(dhcp_ip, network_id)"},{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"},{"line_number":455,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_4d7089a4","line":452,"range":{"start_line":452,"start_character":29,"end_line":452,"end_character":35},"in_reply_to":"7a8ec9b2_2a3a43e7","updated":"2016-09-18 11:33:23.000000000","message":"Done","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"83429d390d7818222020696689cb6eddfb3df5f6","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"},{"line_number":455,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":456,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"},{"line_number":457,"context_line":"            self.switch_dhcp_ip_map[network_id].remove(dhcp_ip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_4a3dcfdb","line":454,"updated":"2016-09-18 11:18:40.000000000","message":"To be more aggressive, you could try to just add flows for \nnew_dhcp_ips \u003d  all_dhcp_ips -self.switch_dhcp_ip_map[network_id]\nThose dhcp ip in switch_dhcp_ip_map should already been added to br-int.","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"8a7e4a88c84fdc3caed10c6362fa01551c57fa8f","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                    self.switch_dhcp_ip_map[network_id].append(dhcp_ip)"},{"line_number":452,"context_line":"                all_dhcp_ips.append(dhcp_ip)"},{"line_number":453,"context_line":"        deleted_dhcp_ips \u003d (set(self.switch_dhcp_ip_map[network_id]) -"},{"line_number":454,"context_line":"                           set(all_dhcp_ips))"},{"line_number":455,"context_line":"        for dhcp_ip in deleted_dhcp_ips:"},{"line_number":456,"context_line":"            self._remove_dhcp_unicast_match_flow(network_id, dhcp_ip)"},{"line_number":457,"context_line":"            self.switch_dhcp_ip_map[network_id].remove(dhcp_ip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a8ec9b2_8dad31eb","line":454,"in_reply_to":"7a8ec9b2_4a3dcfdb","updated":"2016-09-18 11:33:23.000000000","message":"Not clear. You advise first create 2 lists: one with new ips and another with list of ips to delete ?","commit_id":"0cf93b9990b5a4c918b2a9523c539e1e15d2b810"}]}
