)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0631d0ea1424426c6a5c99fdd620c1583fdfe226","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[L3][QoS] L3 agent side Floating IP rate limit"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch implemented the L3 agent side floating IP rate limit."},{"line_number":10,"context_line":"For all routers, if floating IP has qos rules, the corresponding"},{"line_number":11,"context_line":"TC filters will be added to:"},{"line_number":12,"context_line":"1. for legacy/HA router, the device is qg-device of qrouter-namespace,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"df87a7cf_7802a9b6","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":22},"updated":"2017-12-16 00:11:34.000000000","message":"implements","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"32d054f54e513cdd2620bac7c48eccd6afe6199b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[L3][QoS] L3 agent side Floating IP rate limit"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch implemented the L3 agent side floating IP rate limit."},{"line_number":10,"context_line":"For all routers, if floating IP has qos rules, the corresponding"},{"line_number":11,"context_line":"TC filters will be added to:"},{"line_number":12,"context_line":"1. for legacy/HA router, the device is qg-device of qrouter-namespace,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"df87a7cf_9ee1952d","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":22},"in_reply_to":"df87a7cf_7802a9b6","updated":"2017-12-16 06:49:53.000000000","message":"Done","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"}],"neutron/agent/l3/agent.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        ri.router \u003d router"},{"line_number":473,"context_line":"        ri.process()"},{"line_number":474,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_CREATE, self, router\u003dri)"},{"line_number":475,"context_line":"        self.l3_ext_manager.add_router(self.context, ri)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def _process_updated_router(self, router):"},{"line_number":478,"context_line":"        is_dvr_only_agent \u003d (self.conf.agent_mode in"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_afb0b38b","line":475,"updated":"2017-11-25 14:54:41.000000000","message":"is this change related somehow to Your patch?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"acd700febbeb56726784d74e51cc928b1da25388","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        ri.router \u003d router"},{"line_number":473,"context_line":"        ri.process()"},{"line_number":474,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_CREATE, self, router\u003dri)"},{"line_number":475,"context_line":"        self.l3_ext_manager.add_router(self.context, ri)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def _process_updated_router(self, router):"},{"line_number":478,"context_line":"        is_dvr_only_agent \u003d (self.conf.agent_mode in"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_aa7bbebb","line":475,"in_reply_to":"ff82abbf_953dc0c5","updated":"2017-11-26 20:12:46.000000000","message":"IMO it should be done in separate commit with proper commit message. It is required for QoS patch but in fact it is not part of QoS patch, it\u0027s rather something which should be described as \"Add support for L3 extensions in L3Agent\"","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        ri.router \u003d router"},{"line_number":473,"context_line":"        ri.process()"},{"line_number":474,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_CREATE, self, router\u003dri)"},{"line_number":475,"context_line":"        self.l3_ext_manager.add_router(self.context, ri)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def _process_updated_router(self, router):"},{"line_number":478,"context_line":"        is_dvr_only_agent \u003d (self.conf.agent_mode in"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_953dc0c5","line":475,"in_reply_to":"ff82abbf_afb0b38b","updated":"2017-11-26 04:30:45.000000000","message":"This is needed. Currently, there is no l3 agent extension. This is the first one. And this new extension needs to use some methods of RouterInfo object to get some device, namespace, router types etc.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                        self, router\u003dri)"},{"line_number":489,"context_line":"        ri.process()"},{"line_number":490,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_UPDATE, self, router\u003dri)"},{"line_number":491,"context_line":"        self.l3_ext_manager.update_router(self.context, ri)"},{"line_number":492,"context_line":""},{"line_number":493,"context_line":"    def _resync_router(self, router_update,"},{"line_number":494,"context_line":"                       priority\u003dqueue.PRIORITY_SYNC_ROUTERS_TASK):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_4fa9e721","line":491,"updated":"2017-11-25 14:54:41.000000000","message":"ditto","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0631d0ea1424426c6a5c99fdd620c1583fdfe226","unresolved":false,"context_lines":[{"line_number":486,"context_line":"        ri.router \u003d router"},{"line_number":487,"context_line":"        ri.process()"},{"line_number":488,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_CREATE, self, router\u003dri)"},{"line_number":489,"context_line":"        self.l3_ext_manager.add_router(self.context, ri)"},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    def _process_updated_router(self, router):"},{"line_number":492,"context_line":"        is_dvr_only_agent \u003d (self.conf.agent_mode in"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_f859d9fd","line":489,"range":{"start_line":489,"start_character":53,"end_line":489,"end_character":56},"updated":"2017-12-16 00:11:34.000000000","message":"This change should not be made. While it is true that there are no L3 extensions in the Neutron repo, FWaaS and VPNaaS use this interface: https://github.com/openstack/neutron-fwaas/blob/master/neutron_fwaas/services/firewall/agents/l3reference/firewall_l3_agent.py#L203 and https://github.com/openstack/neutron-vpnaas/blob/master/neutron_vpnaas/services/vpn/agent.py#L67. If we change it, we are going to break those projects.\n\nIn the future, you can use codesearch.openstack.org to see if your change will break Neutron sub-projects. This is the search I used for this comment: http://codesearch.openstack.org/?q\u003dAgentExtension\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d\n\nPlease note how FWaaS and VPNaaS get the router_info object from router. So this change is not really needed","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"32d054f54e513cdd2620bac7c48eccd6afe6199b","unresolved":false,"context_lines":[{"line_number":486,"context_line":"        ri.router \u003d router"},{"line_number":487,"context_line":"        ri.process()"},{"line_number":488,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_CREATE, self, router\u003dri)"},{"line_number":489,"context_line":"        self.l3_ext_manager.add_router(self.context, ri)"},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    def _process_updated_router(self, router):"},{"line_number":492,"context_line":"        is_dvr_only_agent \u003d (self.conf.agent_mode in"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_5e654d44","line":489,"range":{"start_line":489,"start_character":53,"end_line":489,"end_character":56},"in_reply_to":"df87a7cf_f859d9fd","updated":"2017-12-16 06:49:53.000000000","message":"OK, I know the alternative methods.","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0631d0ea1424426c6a5c99fdd620c1583fdfe226","unresolved":false,"context_lines":[{"line_number":502,"context_line":"                        self, router\u003dri)"},{"line_number":503,"context_line":"        ri.process()"},{"line_number":504,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_UPDATE, self, router\u003dri)"},{"line_number":505,"context_line":"        self.l3_ext_manager.update_router(self.context, ri)"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _resync_router(self, router_update,"},{"line_number":508,"context_line":"                       priority\u003dqueue.PRIORITY_SYNC_ROUTERS_TASK):"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_18127d0a","line":505,"range":{"start_line":505,"start_character":56,"end_line":505,"end_character":59},"updated":"2017-12-16 00:11:34.000000000","message":"Ditto","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"32d054f54e513cdd2620bac7c48eccd6afe6199b","unresolved":false,"context_lines":[{"line_number":502,"context_line":"                        self, router\u003dri)"},{"line_number":503,"context_line":"        ri.process()"},{"line_number":504,"context_line":"        registry.notify(resources.ROUTER, events.AFTER_UPDATE, self, router\u003dri)"},{"line_number":505,"context_line":"        self.l3_ext_manager.update_router(self.context, ri)"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _resync_router(self, router_update,"},{"line_number":508,"context_line":"                       priority\u003dqueue.PRIORITY_SYNC_ROUTERS_TASK):"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_fe5b0184","line":505,"range":{"start_line":505,"start_character":56,"end_line":505,"end_character":59},"in_reply_to":"df87a7cf_18127d0a","updated":"2017-12-16 06:49:53.000000000","message":"Done","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"}],"neutron/agent/l3/extensions/fip_qos.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"463ec5e3abfded44d5a6fd680984d6b234532237","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            return"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # Finally, add or update floating IP rate limit"},{"line_number":209,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":210,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":211,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":212,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_4149ac5d","line":209,"range":{"start_line":209,"start_character":13,"end_line":209,"end_character":25},"updated":"2017-11-18 00:14:55.000000000","message":"This is not acceptable in Python3 if old_rate is None:\n\n$ python3\nPython 3.5.2 (default, Sep 14 2017, 22:51:06) \n[GCC 5.4.0 20160609] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e None \u003e 0\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nTypeError: unorderable types: NoneType() \u003e int()\n\u003e\u003e\u003e \n\nThis is why some py35 unit tests are failing.","commit_id":"ef8e9535d12c92f8e9c9a66409de588d3ac79cd6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"15d18e2ba0cb61b65fc481bb1b9c2e88c79639c4","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            return"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        # Finally, add or update floating IP rate limit"},{"line_number":209,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":210,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":211,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":212,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_5ccd0f83","line":209,"range":{"start_line":209,"start_character":13,"end_line":209,"end_character":25},"in_reply_to":"1f485f77_4149ac5d","updated":"2017-11-18 02:26:33.000000000","message":"Yes, I noticed that. Line 188 should be:\nold_rate_limits.get(ip, (FIP_DEFAULT_RATE, FIP_DEFAULT_RATE))","commit_id":"ef8e9535d12c92f8e9c9a66409de588d3ac79cd6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"f9123d15c62fcbad81b002d82d161b154fc41efd","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        if hasattr(router, \"fip_ns\") and not hasattr(router, \"snat_namespace\"):"},{"line_number":217,"context_line":"            # DVR local router"},{"line_number":218,"context_line":"            name \u003d router.fip_ns.get_rtr_ext_device_name(router.router_id)"},{"line_number":219,"context_line":"        elif hasattr(router, \"fip_ns\") and hasattr(router, \"snat_namespace\"):"},{"line_number":220,"context_line":"            # DVR edge (or DVR edge ha) router do nothing"},{"line_number":221,"context_line":"            return"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            # Legacy/HA"},{"line_number":224,"context_line":"            ex_gw_port \u003d router.get_ex_gw_port()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_fc4efb94","line":221,"range":{"start_line":219,"start_character":0,"end_line":221,"end_character":18},"updated":"2017-11-18 03:37:19.000000000","message":"OK, here needs some change, because DVR fip (NORTH/SOUTH) can be set centralized.","commit_id":"ef8e9535d12c92f8e9c9a66409de588d3ac79cd6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"f9123d15c62fcbad81b002d82d161b154fc41efd","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            rates \u003d self.get_fip_qos_rates(context,"},{"line_number":294,"context_line":"                                           fip_addr,"},{"line_number":295,"context_line":"                                           fip.get(qos_consts.QOS_POLICY_ID))"},{"line_number":296,"context_line":"            if rates:"},{"line_number":297,"context_line":"                self.process_ip_rates(fip_addr, device, rates)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        self.policy_map.router_floating_ips[router.router_id] \u003d new_fips"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_9c470778","line":296,"range":{"start_line":296,"start_character":12,"end_line":296,"end_character":21},"updated":"2017-11-18 03:37:19.000000000","message":"ditto, needs check fip DVR_SNAT_BOUND status.","commit_id":"ef8e9535d12c92f8e9c9a66409de588d3ac79cd6"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def set_fip_policy(self, fip, policy):"},{"line_number":96,"context_line":"        \"\"\"Attach a fip to policy and return any previous policy on fip.\"\"\""},{"line_number":97,"context_line":"        old_policy \u003d self.get_fip_policy(fip)"},{"line_number":98,"context_line":"        self.known_policies[policy.id] \u003d policy"},{"line_number":99,"context_line":"        self.fip_policies[fip] \u003d policy.id"},{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_2ff7c361","line":98,"updated":"2017-11-25 14:54:41.000000000","message":"is You created separate method to update_policy which is doing exactly what is in this line, why You not use it here?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def set_fip_policy(self, fip, policy):"},{"line_number":96,"context_line":"        \"\"\"Attach a fip to policy and return any previous policy on fip.\"\"\""},{"line_number":97,"context_line":"        old_policy \u003d self.get_fip_policy(fip)"},{"line_number":98,"context_line":"        self.known_policies[policy.id] \u003d policy"},{"line_number":99,"context_line":"        self.fip_policies[fip] \u003d policy.id"},{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_f559ac34","line":98,"in_reply_to":"ff82abbf_2ff7c361","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                for fip in self.fip_qos_map.get_fips(qos_policy):"},{"line_number":157,"context_line":"                    router_id \u003d self.fip_qos_map.find_fip_router_id(fip)"},{"line_number":158,"context_line":"                    router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":159,"context_line":"                    if not router_info:"},{"line_number":160,"context_line":"                        continue"},{"line_number":161,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":162,"context_line":"                    if not device:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_cfe737ac","line":159,"updated":"2017-11-25 14:54:41.000000000","message":"I\u0027m not an L3 expert but shouldn\u0027t You log here (e.g. on DEBUG level) that router info can\u0027t be found?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                for fip in self.fip_qos_map.get_fips(qos_policy):"},{"line_number":157,"context_line":"                    router_id \u003d self.fip_qos_map.find_fip_router_id(fip)"},{"line_number":158,"context_line":"                    router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":159,"context_line":"                    if not router_info:"},{"line_number":160,"context_line":"                        continue"},{"line_number":161,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":162,"context_line":"                    if not device:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_9542a03d","line":159,"in_reply_to":"ff82abbf_cfe737ac","updated":"2017-11-26 04:30:45.000000000","message":"OK, add a log.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                        continue"},{"line_number":161,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":162,"context_line":"                    if not device:"},{"line_number":163,"context_line":"                        continue"},{"line_number":164,"context_line":"                    rates \u003d self.get_policy_rates(qos_policy)"},{"line_number":165,"context_line":"                    self.process_ip_rates(fip, device, rates)"},{"line_number":166,"context_line":"            self.fip_qos_map.update_policy(qos_policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_efec7b90","line":163,"updated":"2017-11-25 14:54:41.000000000","message":"here same as above","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                        continue"},{"line_number":161,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":162,"context_line":"                    if not device:"},{"line_number":163,"context_line":"                        continue"},{"line_number":164,"context_line":"                    rates \u003d self.get_policy_rates(qos_policy)"},{"line_number":165,"context_line":"                    self.process_ip_rates(fip, device, rates)"},{"line_number":166,"context_line":"            self.fip_qos_map.update_policy(qos_policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_b53fa4b2","line":163,"in_reply_to":"ff82abbf_efec7b90","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def process_ip_rate_limit(self, ip, direction, device, rate, burst):"},{"line_number":186,"context_line":"        ratelimits \u003d direction + \"_ratelimits\""},{"line_number":187,"context_line":"        old_rate_limits \u003d getattr(self.fip_qos_map, ratelimits, {})"},{"line_number":188,"context_line":"        old_rate, old_burst \u003d old_rate_limits.get(ip, (FIP_DEFAULT_RATE,"},{"line_number":189,"context_line":"                                                       FIP_DEFAULT_RATE))"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_8f05af48","line":187,"updated":"2017-11-25 14:54:41.000000000","message":"I would personally name it \"rate_limits\" or \"current_rate_limits\" because it is later used e.g. in L214 and it can be confusing that You are storing new values in \"old_rate_limits\" variable","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def process_ip_rate_limit(self, ip, direction, device, rate, burst):"},{"line_number":186,"context_line":"        ratelimits \u003d direction + \"_ratelimits\""},{"line_number":187,"context_line":"        old_rate_limits \u003d getattr(self.fip_qos_map, ratelimits, {})"},{"line_number":188,"context_line":"        old_rate, old_burst \u003d old_rate_limits.get(ip, (FIP_DEFAULT_RATE,"},{"line_number":189,"context_line":"                                                       FIP_DEFAULT_RATE))"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_5548985a","line":187,"in_reply_to":"ff82abbf_8f05af48","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        old_rate, old_burst \u003d old_rate_limits.get(ip, (FIP_DEFAULT_RATE,"},{"line_number":189,"context_line":"                                                       FIP_DEFAULT_RATE))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        if (old_rate and old_rate \u003d\u003d rate and old_burst"},{"line_number":192,"context_line":"            and old_burst \u003d\u003d burst) or ("},{"line_number":193,"context_line":"                (not old_rate and rate \u003d\u003d FIP_DEFAULT_RATE) and"},{"line_number":194,"context_line":"                (not old_burst and burst \u003d\u003d FIP_DEFAULT_RATE)):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_af02f33b","line":191,"updated":"2017-11-25 14:54:41.000000000","message":"I think that checking if old_rate or old_burst is not None is not necessary here. If it\u0027s None than it will be different than new one or new is also None and You don\u0027t need to do anything, right?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        old_rate, old_burst \u003d old_rate_limits.get(ip, (FIP_DEFAULT_RATE,"},{"line_number":189,"context_line":"                                                       FIP_DEFAULT_RATE))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        if (old_rate and old_rate \u003d\u003d rate and old_burst"},{"line_number":192,"context_line":"            and old_burst \u003d\u003d burst) or ("},{"line_number":193,"context_line":"                (not old_rate and rate \u003d\u003d FIP_DEFAULT_RATE) and"},{"line_number":194,"context_line":"                (not old_burst and burst \u003d\u003d FIP_DEFAULT_RATE)):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_1578d08d","line":191,"in_reply_to":"ff82abbf_af02f33b","updated":"2017-11-26 04:30:45.000000000","message":"Seems true, I will test that.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if (rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_RATE"},{"line_number":202,"context_line":"                and old_rate !\u003d FIP_DEFAULT_RATE"},{"line_number":203,"context_line":"                and old_burst !\u003d FIP_DEFAULT_RATE):"},{"line_number":204,"context_line":"            # Floating IP bandwidth was changed to no limit."}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_4ffb2746","line":201,"updated":"2017-11-25 14:54:41.000000000","message":"is You want to use such default constant You should define FIP_DEFAULT_BURST as separate const. Now it\u0027s little bit confusing that You are comparing burst to default rate value\nBTW. can\u0027t be the case that e.g. only burst is cleaned and rate not? shouldn\u0027t You do some action then?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if (rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_RATE"},{"line_number":202,"context_line":"                and old_rate !\u003d FIP_DEFAULT_RATE"},{"line_number":203,"context_line":"                and old_burst !\u003d FIP_DEFAULT_RATE):"},{"line_number":204,"context_line":"            # Floating IP bandwidth was changed to no limit."}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_d5a268fc","line":201,"in_reply_to":"ff82abbf_4ffb2746","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            return"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # Finally, add or update floating IP rate limit"},{"line_number":210,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":211,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":212,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_6ff86b48","line":210,"updated":"2017-11-25 14:54:41.000000000","message":"Why You are not comparing to FIP_DEFAULT_RATE but to hardcoded 0 value here?\nAnd second thing: I think that values here must be higher than 0 already as it didn\u0027t match in previous if, no?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            return"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # Finally, add or update floating IP rate limit"},{"line_number":210,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":211,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":212,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_f5a76c0a","line":210,"in_reply_to":"ff82abbf_6ff86b48","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":211,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":212,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"},{"line_number":214,"context_line":"        old_rate_limits[ip] \u003d (rate, burst)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_rate_limit_ip_device(self, router):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_0f975fee","line":213,"updated":"2017-11-25 14:54:41.000000000","message":"can\u0027t You implement update_ip_rate_limit as atomic operation? Now You are cleaning old values and then implementing new one. What if for some reason there will be some error after cleaning of old values and before setting new one? Did You handle it somehow?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":211,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":212,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"},{"line_number":214,"context_line":"        old_rate_limits[ip] \u003d (rate, burst)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_rate_limit_ip_device(self, router):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_95b06045","line":213,"in_reply_to":"ff82abbf_0f975fee","updated":"2017-11-26 04:30:45.000000000","message":"Yes, we can directly set it. l3_tc_lib will handle the existing rule.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if (rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_RATE"},{"line_number":202,"context_line":"                and old_rate !\u003d FIP_DEFAULT_RATE"},{"line_number":203,"context_line":"                and old_burst !\u003d FIP_DEFAULT_RATE):"},{"line_number":204,"context_line":"            # Floating IP bandwidth was changed to no limit."},{"line_number":205,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":206,"context_line":"            old_rate_limits.pop(ip, None)"},{"line_number":207,"context_line":"            return"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # Finally, add or update floating IP rate limit"},{"line_number":210,"context_line":"        if ((old_rate \u003e 0 and rate \u003e 0 and old_rate !\u003d rate) or"},{"line_number":211,"context_line":"                (old_burst \u003e 0 and burst \u003e 0 and old_burst !\u003d burst)):"},{"line_number":212,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"},{"line_number":214,"context_line":"        old_rate_limits[ip] \u003d (rate, burst)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_rate_limit_ip_device(self, router):"},{"line_number":217,"context_line":"        ex_gw_port \u003d router.get_ex_gw_port()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_75459c42","line":214,"range":{"start_line":201,"start_character":0,"end_line":214,"end_character":43},"updated":"2017-11-26 04:30:45.000000000","message":"Here needs some refactor to cover that:\n1. burst not set\n2. only burst changes\n3. only burst changed from x to DEFAULT","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4650751859ea0f893055ef242615a4bd7dc026f6","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"},{"line_number":214,"context_line":"        old_rate_limits[ip] \u003d (rate, burst)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_rate_limit_ip_device(self, router):"},{"line_number":217,"context_line":"        ex_gw_port \u003d router.get_ex_gw_port()"},{"line_number":218,"context_line":"        if not ex_gw_port:"},{"line_number":219,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_a5167654","line":216,"range":{"start_line":216,"start_character":40,"end_line":216,"end_character":46},"updated":"2017-11-27 22:02:42.000000000","message":"s/ri since it\u0027s a router_info","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"acd5f9fd0dfea972e7e5352f6731fb438e9b692f","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        tc_wrapper.set_ip_rate_limit(direction, ip, rate, burst)"},{"line_number":214,"context_line":"        old_rate_limits[ip] \u003d (rate, burst)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_rate_limit_ip_device(self, router):"},{"line_number":217,"context_line":"        ex_gw_port \u003d router.get_ex_gw_port()"},{"line_number":218,"context_line":"        if not ex_gw_port:"},{"line_number":219,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_763826ed","line":216,"range":{"start_line":216,"start_character":40,"end_line":216,"end_character":46},"in_reply_to":"ff82abbf_a5167654","updated":"2017-11-28 00:12:58.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4650751859ea0f893055ef242615a4bd7dc026f6","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        ex_gw_port \u003d router.get_ex_gw_port()"},{"line_number":218,"context_line":"        if not ex_gw_port:"},{"line_number":219,"context_line":"            return"},{"line_number":220,"context_line":"        if hasattr(router, \"fip_ns\") and hasattr(router, \"snat_namespace\"):"},{"line_number":221,"context_line":"            # DVR edge (or DVR edge ha) router"},{"line_number":222,"context_line":"            if not router._is_this_snat_host():"},{"line_number":223,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_e5379efe","line":220,"updated":"2017-11-27 22:02:42.000000000","message":"We shouldn\u0027t do this based on attributes in the object, better way would be to look at agent_mode, something like:\n\nif ri.agent_conf.agent_mode in [...]:","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"acd5f9fd0dfea972e7e5352f6731fb438e9b692f","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        ex_gw_port \u003d router.get_ex_gw_port()"},{"line_number":218,"context_line":"        if not ex_gw_port:"},{"line_number":219,"context_line":"            return"},{"line_number":220,"context_line":"        if hasattr(router, \"fip_ns\") and hasattr(router, \"snat_namespace\"):"},{"line_number":221,"context_line":"            # DVR edge (or DVR edge ha) router"},{"line_number":222,"context_line":"            if not router._is_this_snat_host():"},{"line_number":223,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_36261ed0","line":220,"in_reply_to":"ff82abbf_e5379efe","updated":"2017-11-28 00:12:58.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        return ip_lib.IPDevice(name, namespace\u003dnamespace)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _remove_ip_ratelimit_cache(self, ip, direction):"},{"line_number":237,"context_line":"        # remove cache"},{"line_number":238,"context_line":"        ratelimits \u003d direction + \"_ratelimits\""},{"line_number":239,"context_line":"        old_rate_limits \u003d getattr(self.fip_qos_map, ratelimits, {})"},{"line_number":240,"context_line":"        old_rate_limits.pop(ip, None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_2f9ca30d","line":237,"updated":"2017-11-25 14:54:41.000000000","message":"this comment is IMHO not necessary","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        return ip_lib.IPDevice(name, namespace\u003dnamespace)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _remove_ip_ratelimit_cache(self, ip, direction):"},{"line_number":237,"context_line":"        # remove cache"},{"line_number":238,"context_line":"        ratelimits \u003d direction + \"_ratelimits\""},{"line_number":239,"context_line":"        old_rate_limits \u003d getattr(self.fip_qos_map, ratelimits, {})"},{"line_number":240,"context_line":"        old_rate_limits.pop(ip, None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_357dd47e","line":237,"in_reply_to":"ff82abbf_2f9ca30d","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":245,"context_line":"            if device.exists():"},{"line_number":246,"context_line":"                tc_wrapper.clear_ip_rate_limit(direction, fip_ip)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            self._remove_ip_ratelimit_cache(fip_ip, direction)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    def get_fip_qos_rates(self, context, fip, policy_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_cf9c1710","line":247,"updated":"2017-11-25 14:54:41.000000000","message":"nit: this empty line is not necessary IMHO","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":245,"context_line":"            if device.exists():"},{"line_number":246,"context_line":"                tc_wrapper.clear_ip_rate_limit(direction, fip_ip)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"            self._remove_ip_ratelimit_cache(fip_ip, direction)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    def get_fip_qos_rates(self, context, fip, policy_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_d56d88cc","line":247,"in_reply_to":"ff82abbf_cf9c1710","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    def get_fip_qos_rates(self, context, fip, policy_id):"},{"line_number":251,"context_line":"        if policy_id is None:"},{"line_number":252,"context_line":"            # Clean the cache"},{"line_number":253,"context_line":"            self._process_reset_fip(fip)"},{"line_number":254,"context_line":"            # process_ip_rate_limit will treat value 0 as"},{"line_number":255,"context_line":"            # cleaning the tc filters if exits or no action."},{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_efa1db47","line":253,"updated":"2017-11-25 14:54:41.000000000","message":"_process_reset_fip() method contains only 1 line of code. IMHO if You want to wrap this line of code into separate method (like You did now), name of this helper method should be self descriptive and than comment from L252 should be not necessary. Or You can keep this comment and move code from L169 directly here","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    def get_fip_qos_rates(self, context, fip, policy_id):"},{"line_number":251,"context_line":"        if policy_id is None:"},{"line_number":252,"context_line":"            # Clean the cache"},{"line_number":253,"context_line":"            self._process_reset_fip(fip)"},{"line_number":254,"context_line":"            # process_ip_rate_limit will treat value 0 as"},{"line_number":255,"context_line":"            # cleaning the tc filters if exits or no action."},{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_f5720cad","line":253,"in_reply_to":"ff82abbf_efa1db47","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            # process_ip_rate_limit will treat value 0 as"},{"line_number":255,"context_line":"            # cleaning the tc filters if exits or no action."},{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":257,"context_line":"                                                  \"burst\": FIP_DEFAULT_RATE},"},{"line_number":258,"context_line":"                    constants.EGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":259,"context_line":"                                                 \"burst\": FIP_DEFAULT_RATE}}"},{"line_number":260,"context_line":"        policy \u003d self.resource_rpc.pull("}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_8f8a8fbc","line":257,"updated":"2017-11-25 14:54:41.000000000","message":"for burst then should be separate default value constant","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            # process_ip_rate_limit will treat value 0 as"},{"line_number":255,"context_line":"            # cleaning the tc filters if exits or no action."},{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":257,"context_line":"                                                  \"burst\": FIP_DEFAULT_RATE},"},{"line_number":258,"context_line":"                    constants.EGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":259,"context_line":"                                                 \"burst\": FIP_DEFAULT_RATE}}"},{"line_number":260,"context_line":"        policy \u003d self.resource_rpc.pull("}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_956b80b5","line":257,"in_reply_to":"ff82abbf_8f8a8fbc","updated":"2017-11-26 04:30:45.000000000","message":"Yes, process_ip_rate_limit may need that.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":257,"context_line":"                                                  \"burst\": FIP_DEFAULT_RATE},"},{"line_number":258,"context_line":"                    constants.EGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":259,"context_line":"                                                 \"burst\": FIP_DEFAULT_RATE}}"},{"line_number":260,"context_line":"        policy \u003d self.resource_rpc.pull("},{"line_number":261,"context_line":"            context, resources.QOS_POLICY, policy_id)"},{"line_number":262,"context_line":"        self.fip_qos_map.set_fip_policy(fip, policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_af8753b5","line":259,"updated":"2017-11-25 14:54:41.000000000","message":"ditto","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            return {constants.INGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":257,"context_line":"                                                  \"burst\": FIP_DEFAULT_RATE},"},{"line_number":258,"context_line":"                    constants.EGRESS_DIRECTION: {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":259,"context_line":"                                                 \"burst\": FIP_DEFAULT_RATE}}"},{"line_number":260,"context_line":"        policy \u003d self.resource_rpc.pull("},{"line_number":261,"context_line":"            context, resources.QOS_POLICY, policy_id)"},{"line_number":262,"context_line":"        self.fip_qos_map.set_fip_policy(fip, policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_b56804b9","line":259,"in_reply_to":"ff82abbf_af8753b5","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        rates \u003d {}"},{"line_number":267,"context_line":"        for rule in policy.rules:"},{"line_number":268,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":269,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":270,"context_line":"                if rule.direction not in rates:"},{"line_number":271,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_4f9007ee","line":269,"updated":"2017-11-25 14:54:41.000000000","message":"Why \"first\" direction? I don\u0027t understand this comment","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        rates \u003d {}"},{"line_number":267,"context_line":"        for rule in policy.rules:"},{"line_number":268,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":269,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":270,"context_line":"                if rule.direction not in rates:"},{"line_number":271,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_556178d2","line":269,"in_reply_to":"ff82abbf_4f9007ee","updated":"2017-11-26 04:30:45.000000000","message":"Loop all the rules, for each direction, use the first meets specific `direction`.\nIt\u0027s something like this:\n\nrules \u003d [a-ingress, b-ingress, c-egress, d-egress]\nSo, only a-ingress and c-egress rules will be used.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        for rule in policy.rules:"},{"line_number":268,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":269,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":270,"context_line":"                if rule.direction not in rates:"},{"line_number":271,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_6f8dcbd1","line":270,"updated":"2017-11-25 14:54:41.000000000","message":"not every rule_type has got direction attribute so this is not easy to extend in future","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        for rule in policy.rules:"},{"line_number":268,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":269,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":270,"context_line":"                if rule.direction not in rates:"},{"line_number":271,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_755efc12","line":270,"in_reply_to":"ff82abbf_6f8dcbd1","updated":"2017-11-26 04:30:45.000000000","message":"We only use `bandwidth_limit` rules here.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # The return rates dict must contain all directions. If there is no"},{"line_number":275,"context_line":"        # one specific direction qos rule, use the default values."},{"line_number":276,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":277,"context_line":"            if direction not in rates:"},{"line_number":278,"context_line":"                rates[direction] \u003d {\"rate\": FIP_DEFAULT_RATE,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_0fc0bfe0","line":275,"updated":"2017-11-25 14:54:41.000000000","message":"what will be with rule types which don\u0027t have direction attribute?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                                             \"burst\": rule.max_burst_kbps}"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        # The return rates dict must contain all directions. If there is no"},{"line_number":275,"context_line":"        # one specific direction qos rule, use the default values."},{"line_number":276,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":277,"context_line":"            if direction not in rates:"},{"line_number":278,"context_line":"                rates[direction] \u003d {\"rate\": FIP_DEFAULT_RATE,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_159d30bb","line":275,"in_reply_to":"ff82abbf_0fc0bfe0","updated":"2017-11-26 04:30:45.000000000","message":"We only use `bandwidth_limit` rules here.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":286,"context_line":"                fip, direction, device,"},{"line_number":287,"context_line":"                rate[\u0027rate\u0027], rate[\u0027burst\u0027])"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def process_floating_ip_addresses(self, context, router_info):"},{"line_number":290,"context_line":"        # Loop all the router floating ips, the corresponding floating IP tc"},{"line_number":291,"context_line":"        # rules will be configured:"},{"line_number":292,"context_line":"        # 1. for legacy and HA router, it will be all floating IPs to qg-device"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_2fc583f1","line":289,"updated":"2017-11-25 14:54:41.000000000","message":"shouldn\u0027t it be private method?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":286,"context_line":"                fip, direction, device,"},{"line_number":287,"context_line":"                rate[\u0027rate\u0027], rate[\u0027burst\u0027])"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def process_floating_ip_addresses(self, context, router_info):"},{"line_number":290,"context_line":"        # Loop all the router floating ips, the corresponding floating IP tc"},{"line_number":291,"context_line":"        # rules will be configured:"},{"line_number":292,"context_line":"        # 1. for legacy and HA router, it will be all floating IPs to qg-device"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_35a2b4fe","line":289,"in_reply_to":"ff82abbf_2fc583f1","updated":"2017-11-26 04:30:45.000000000","message":"Make this consistent with the router_info method, it is called `process_floating_ip_addresses`. And we are doing some similar things to router floating IPs.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4650751859ea0f893055ef242615a4bd7dc026f6","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            self.process_ip_rates(fip_addr, device, rates)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.fip_qos_map.router_floating_ips[router_info.router_id] \u003d new_fips"},{"line_number":325,"context_line":"        fip_removed \u003d current_fips - new_fips"},{"line_number":326,"context_line":"        for fip in fip_removed:"},{"line_number":327,"context_line":"            self._remove_fip_rate_limit(device, fip)"},{"line_number":328,"context_line":"            self._process_reset_fip(fip)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_10b3e24e","line":325,"range":{"start_line":325,"start_character":8,"end_line":325,"end_character":19},"updated":"2017-11-27 22:02:42.000000000","message":"s/fips_removed","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"acd5f9fd0dfea972e7e5352f6731fb438e9b692f","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            self.process_ip_rates(fip_addr, device, rates)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.fip_qos_map.router_floating_ips[router_info.router_id] \u003d new_fips"},{"line_number":325,"context_line":"        fip_removed \u003d current_fips - new_fips"},{"line_number":326,"context_line":"        for fip in fip_removed:"},{"line_number":327,"context_line":"            self._remove_fip_rate_limit(device, fip)"},{"line_number":328,"context_line":"            self._process_reset_fip(fip)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_f62bd691","line":325,"range":{"start_line":325,"start_character":8,"end_line":325,"end_character":19},"in_reply_to":"ff82abbf_10b3e24e","updated":"2017-11-28 00:12:58.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5884c5f69c16d759206e40cdccec1307b3702c9c","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                    router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":160,"context_line":"                    if not router_info:"},{"line_number":161,"context_line":"                        LOG.debug(\"Router %s may be removed by L3 agent \""},{"line_number":162,"context_line":"                                  \"concurrently.\", router_id)"},{"line_number":163,"context_line":"                        continue"},{"line_number":164,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":165,"context_line":"                    if not device:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_7fdbc820","line":162,"updated":"2017-11-30 16:17:27.000000000","message":"nit: would use similar text from the HA code:\n\n\u0027Router %s is not managed by this agent. It was \u0027\n\u0027possibly deleted concurrently.\u0027, router_id)","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3726621d06096ab27a5fd01af1bae811bb2758e","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                    router_info \u003d self.agent_api.get_router_info(router_id)"},{"line_number":160,"context_line":"                    if not router_info:"},{"line_number":161,"context_line":"                        LOG.debug(\"Router %s may be removed by L3 agent \""},{"line_number":162,"context_line":"                                  \"concurrently.\", router_id)"},{"line_number":163,"context_line":"                        continue"},{"line_number":164,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":165,"context_line":"                    if not device:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_a1235c05","line":162,"in_reply_to":"ff82abbf_7fdbc820","updated":"2017-12-01 09:45:10.000000000","message":"Done","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5884c5f69c16d759206e40cdccec1307b3702c9c","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":165,"context_line":"                    if not device:"},{"line_number":166,"context_line":"                        LOG.debug(\"Router %s does not have floating IP \""},{"line_number":167,"context_line":"                                  \"related device, or may be removed by L3 \""},{"line_number":168,"context_line":"                                  \"agent concurrently.\", router_id)"},{"line_number":169,"context_line":"                        continue"},{"line_number":170,"context_line":"                    rates \u003d self.get_policy_rates(qos_policy)"},{"line_number":171,"context_line":"                    self.process_ip_rates(fip, device, rates)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_7f04287f","line":168,"range":{"start_line":167,"start_character":51,"end_line":168,"end_character":40},"updated":"2017-11-30 16:17:27.000000000","message":"s/it was possibly deleted","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3726621d06096ab27a5fd01af1bae811bb2758e","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":165,"context_line":"                    if not device:"},{"line_number":166,"context_line":"                        LOG.debug(\"Router %s does not have floating IP \""},{"line_number":167,"context_line":"                                  \"related device, or may be removed by L3 \""},{"line_number":168,"context_line":"                                  \"agent concurrently.\", router_id)"},{"line_number":169,"context_line":"                        continue"},{"line_number":170,"context_line":"                    rates \u003d self.get_policy_rates(qos_policy)"},{"line_number":171,"context_line":"                    self.process_ip_rates(fip, device, rates)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_e11164ae","line":168,"range":{"start_line":167,"start_character":51,"end_line":168,"end_character":40},"in_reply_to":"ff82abbf_7f04287f","updated":"2017-12-01 09:45:10.000000000","message":"Done","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5884c5f69c16d759206e40cdccec1307b3702c9c","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            self.fip_qos_map.update_policy(qos_policy)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def _process_reset_fip(self, fip):"},{"line_number":175,"context_line":"        # Clean the cache"},{"line_number":176,"context_line":"        self.fip_qos_map.clean_by_fip(fip)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _register_rpc_consumers(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_fff7d88b","line":175,"updated":"2017-11-30 16:17:27.000000000","message":"comment doesn\u0027t add much","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3726621d06096ab27a5fd01af1bae811bb2758e","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            self.fip_qos_map.update_policy(qos_policy)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def _process_reset_fip(self, fip):"},{"line_number":175,"context_line":"        # Clean the cache"},{"line_number":176,"context_line":"        self.fip_qos_map.clean_by_fip(fip)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def _register_rpc_consumers(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_2118acd1","line":175,"in_reply_to":"ff82abbf_fff7d88b","updated":"2017-12-01 09:45:10.000000000","message":"Done","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5884c5f69c16d759206e40cdccec1307b3702c9c","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            return"},{"line_number":220,"context_line":"        agent_mode \u003d router_info.agent_conf.agent_mode"},{"line_number":221,"context_line":"        is_distributed_router \u003d router_info.router.get(\u0027distributed\u0027)"},{"line_number":222,"context_line":"        if is_distributed_router and agent_mode \u003d\u003d \u0027dvr_snat\u0027:"},{"line_number":223,"context_line":"            # DVR edge (or DVR edge ha) router"},{"line_number":224,"context_line":"            if not router_info._is_this_snat_host():"},{"line_number":225,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_6c17a453","line":222,"range":{"start_line":222,"start_character":51,"end_line":222,"end_character":61},"updated":"2017-11-30 16:17:27.000000000","message":"s/constants.L3_AGENT_MODE_DVR_SNAT","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3726621d06096ab27a5fd01af1bae811bb2758e","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            return"},{"line_number":220,"context_line":"        agent_mode \u003d router_info.agent_conf.agent_mode"},{"line_number":221,"context_line":"        is_distributed_router \u003d router_info.router.get(\u0027distributed\u0027)"},{"line_number":222,"context_line":"        if is_distributed_router and agent_mode \u003d\u003d \u0027dvr_snat\u0027:"},{"line_number":223,"context_line":"            # DVR edge (or DVR edge ha) router"},{"line_number":224,"context_line":"            if not router_info._is_this_snat_host():"},{"line_number":225,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_816bb81d","line":222,"range":{"start_line":222,"start_character":51,"end_line":222,"end_character":61},"in_reply_to":"ff82abbf_6c17a453","updated":"2017-12-01 09:45:10.000000000","message":"Done","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3726621d06096ab27a5fd01af1bae811bb2758e","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            return"},{"line_number":220,"context_line":"        agent_mode \u003d router_info.agent_conf.agent_mode"},{"line_number":221,"context_line":"        is_distributed_router \u003d router_info.router.get(\u0027distributed\u0027)"},{"line_number":222,"context_line":"        if is_distributed_router and agent_mode \u003d\u003d \u0027dvr_snat\u0027:"},{"line_number":223,"context_line":"            # DVR edge (or DVR edge ha) router"},{"line_number":224,"context_line":"            if not router_info._is_this_snat_host():"},{"line_number":225,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff82abbf_c1cf8027","line":222,"range":{"start_line":222,"start_character":51,"end_line":222,"end_character":61},"in_reply_to":"ff82abbf_6c17a453","updated":"2017-12-01 09:45:10.000000000","message":"Done","commit_id":"83bbbc2ec81fe180c47ba082c83b779704f09f03"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def get_fip_policy(self, fip):"},{"line_number":92,"context_line":"        policy_id \u003d self.fip_policies.get(fip)"},{"line_number":93,"context_line":"        if policy_id:"},{"line_number":94,"context_line":"            return self.get_policy(policy_id)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def set_fip_policy(self, fip, policy):"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_bed71024","line":93,"updated":"2017-12-01 21:59:10.000000000","message":"nit: this \"if\" is not necessary in fact, even if policy_id will be None then get_policy() method will return None and result will be the same","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e7a9e1e09de70521a398c4245cdaa769b635a447","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def get_fip_policy(self, fip):"},{"line_number":92,"context_line":"        policy_id \u003d self.fip_policies.get(fip)"},{"line_number":93,"context_line":"        if policy_id:"},{"line_number":94,"context_line":"            return self.get_policy(policy_id)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def set_fip_policy(self, fip, policy):"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_afbcb8bb","line":93,"in_reply_to":"df87a7cf_bed71024","updated":"2017-12-02 01:30:22.000000000","message":"Done","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        if old_rate \u003d\u003d rate and old_burst \u003d\u003d burst:"},{"line_number":199,"context_line":"            # 1. Floating IP rate limit does not change."},{"line_number":200,"context_line":"            # 2. Floating IP bandwidth does not limit."},{"line_number":201,"context_line":"            return"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_5edcc445","line":200,"updated":"2017-12-01 21:59:10.000000000","message":"nit: those comments are IMHO not necessary, it\u0027s quite obvious what You said here :)","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7c58ee585089a32ff6c7b923ecf99b0c3162e2f1","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        if old_rate \u003d\u003d rate and old_burst \u003d\u003d burst:"},{"line_number":199,"context_line":"            # 1. Floating IP rate limit does not change."},{"line_number":200,"context_line":"            # 2. Floating IP bandwidth does not limit."},{"line_number":201,"context_line":"            return"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_a3837056","line":200,"in_reply_to":"df87a7cf_4f6f2cc5","updated":"2017-12-02 11:44:00.000000000","message":"I don\u0027t totally agree with that but I will not block anything because of comment. If You think that it is useful than fine :)","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e7a9e1e09de70521a398c4245cdaa769b635a447","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        if old_rate \u003d\u003d rate and old_burst \u003d\u003d burst:"},{"line_number":199,"context_line":"            # 1. Floating IP rate limit does not change."},{"line_number":200,"context_line":"            # 2. Floating IP bandwidth does not limit."},{"line_number":201,"context_line":"            return"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_4f6f2cc5","line":200,"in_reply_to":"df87a7cf_5edcc445","updated":"2017-12-02 01:30:22.000000000","message":"Point 1 is obvious. Point 2 is not. Comments help people to read code，can we remain this lines. ：）","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":206,"context_line":"            # Floating IP bandwidth was changed to no limit."},{"line_number":207,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":208,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_7ee188fe","line":205,"updated":"2017-12-01 21:59:10.000000000","message":"if FIP_DEFAULT_{RATE,BURST} means no limit I would name it maybe \"FIP_NO_{RATE,BURST}\" or \"FIP_NO_LIMIT_...\" maybe","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7c58ee585089a32ff6c7b923ecf99b0c3162e2f1","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":206,"context_line":"            # Floating IP bandwidth was changed to no limit."},{"line_number":207,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":208,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_e3909898","line":205,"in_reply_to":"df87a7cf_0fa2849b","updated":"2017-12-02 11:44:00.000000000","message":"I read it and still IMHO even if it is used in some cache it means \"no limit\" as point 2 from Your comment said","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e7a9e1e09de70521a398c4245cdaa769b635a447","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":206,"context_line":"            # Floating IP bandwidth was changed to no limit."},{"line_number":207,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":208,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_0fa2849b","line":205,"in_reply_to":"df87a7cf_7ee188fe","updated":"2017-12-02 01:30:22.000000000","message":"Line 45-50 I give a lot of informations. This is also used in cache dicts.","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":206,"context_line":"            # Floating IP bandwidth was changed to no limit."},{"line_number":207,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":208,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"},{"line_number":209,"context_line":"            rate_limits.pop(ip, None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_1ee63c18","line":206,"updated":"2017-12-01 21:59:10.000000000","message":"if You do what I wrote above, this comment will not be necessary","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        namespace \u003d router_info.get_gw_ns_name()"},{"line_number":238,"context_line":"        return ip_lib.IPDevice(name, namespace\u003dnamespace)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _remove_ip_ratelimit_cache(self, ip, direction):"},{"line_number":241,"context_line":"        rate_limits_direction \u003d direction + \"_ratelimits\""},{"line_number":242,"context_line":"        rate_limits \u003d getattr(self.fip_qos_map, rate_limits_direction, {})"},{"line_number":243,"context_line":"        rate_limits.pop(ip, None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_3ee30008","line":240,"updated":"2017-12-01 21:59:10.000000000","message":"nit: everywhere else You have \"rate_limit\" so maybe here it should be like that also?","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e7a9e1e09de70521a398c4245cdaa769b635a447","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        namespace \u003d router_info.get_gw_ns_name()"},{"line_number":238,"context_line":"        return ip_lib.IPDevice(name, namespace\u003dnamespace)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _remove_ip_ratelimit_cache(self, ip, direction):"},{"line_number":241,"context_line":"        rate_limits_direction \u003d direction + \"_ratelimits\""},{"line_number":242,"context_line":"        rate_limits \u003d getattr(self.fip_qos_map, rate_limits_direction, {})"},{"line_number":243,"context_line":"        rate_limits.pop(ip, None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_54134567","line":240,"in_reply_to":"df87a7cf_3ee30008","updated":"2017-12-02 01:30:22.000000000","message":"Done","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"36f4a451d5c9afea9bee15b0d18c3caf8c9ca6a9","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        self.fip_policies[fip] \u003d policy.id"},{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"},{"line_number":102,"context_line":"            del self.qos_policy_fips[old_policy.id][fip]"},{"line_number":103,"context_line":"        return old_policy"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def clean_by_fip(self, fip):"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_2ac70c15","line":102,"updated":"2017-12-04 21:21:07.000000000","message":"are You sure that old_policy.id is always available here? Maybe better would be something like:\n\nself.qos_policy_fips.get(old_policy.id, {}).pop(fip, None)","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fafe14706871cffc081c3a9db7ae1a183f9556e5","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        self.fip_policies[fip] \u003d policy.id"},{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"},{"line_number":102,"context_line":"            del self.qos_policy_fips[old_policy.id][fip]"},{"line_number":103,"context_line":"        return old_policy"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def clean_by_fip(self, fip):"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_22416c3a","line":102,"in_reply_to":"df87a7cf_2ac70c15","updated":"2017-12-05 04:47:49.000000000","message":"Line 97 and `if old_policy` ensure that. This code is similar to :\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l2/extensions/qos.py#L175","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"36f4a451d5c9afea9bee15b0d18c3caf8c9ca6a9","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                  \"information on floating IP %s\", fip)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _clean_policy_info(self, qos_policy_id):"},{"line_number":119,"context_line":"        del self.qos_policy_fips[qos_policy_id]"},{"line_number":120,"context_line":"        del self.known_policies[qos_policy_id]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def find_fip_router_id(self, fip):"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_4accd034","line":119,"updated":"2017-12-04 21:21:07.000000000","message":"maybe better would be to use \"self.qos_policy_fips.pop(qos_policy_id, None)\"? It would be proof for case where qos_policy_id would be not in dict\u0027s keys","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fafe14706871cffc081c3a9db7ae1a183f9556e5","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                  \"information on floating IP %s\", fip)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _clean_policy_info(self, qos_policy_id):"},{"line_number":119,"context_line":"        del self.qos_policy_fips[qos_policy_id]"},{"line_number":120,"context_line":"        del self.known_policies[qos_policy_id]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def find_fip_router_id(self, fip):"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_423cb0be","line":119,"in_reply_to":"df87a7cf_4accd034","updated":"2017-12-05 04:47:49.000000000","message":"line 109 take care of that, ditto, similar to :\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l2/extensions/qos.py#L193","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"36f4a451d5c9afea9bee15b0d18c3caf8c9ca6a9","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _clean_policy_info(self, qos_policy_id):"},{"line_number":119,"context_line":"        del self.qos_policy_fips[qos_policy_id]"},{"line_number":120,"context_line":"        del self.known_policies[qos_policy_id]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def find_fip_router_id(self, fip):"},{"line_number":123,"context_line":"        for router_id, ips in self.router_floating_ips.items():"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_ead044cc","line":120,"updated":"2017-12-04 21:21:07.000000000","message":"and same here","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fafe14706871cffc081c3a9db7ae1a183f9556e5","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _clean_policy_info(self, qos_policy_id):"},{"line_number":119,"context_line":"        del self.qos_policy_fips[qos_policy_id]"},{"line_number":120,"context_line":"        del self.known_policies[qos_policy_id]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def find_fip_router_id(self, fip):"},{"line_number":123,"context_line":"        for router_id, ips in self.router_floating_ips.items():"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_e24aa453","line":120,"in_reply_to":"df87a7cf_ead044cc","updated":"2017-12-05 04:47:49.000000000","message":"ditto:\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l2/extensions/qos.py#L194","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"36f4a451d5c9afea9bee15b0d18c3caf8c9ca6a9","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        if old_rate \u003d\u003d rate and old_burst \u003d\u003d burst:"},{"line_number":198,"context_line":"            # 1. Floating IP rate limit does not change."},{"line_number":199,"context_line":"            # 2. Floating IP bandwidth does not limit."},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_0ad6c8c6","line":199,"updated":"2017-12-04 21:21:07.000000000","message":"one question to be sure: this comment describes two possible cases (\"or condition\") or both 1 and 2 should comes together (\"and condition\")?","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fafe14706871cffc081c3a9db7ae1a183f9556e5","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        if old_rate \u003d\u003d rate and old_burst \u003d\u003d burst:"},{"line_number":198,"context_line":"            # 1. Floating IP rate limit does not change."},{"line_number":199,"context_line":"            # 2. Floating IP bandwidth does not limit."},{"line_number":200,"context_line":"            return"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_82a878db","line":199,"in_reply_to":"df87a7cf_0ad6c8c6","updated":"2017-12-05 04:47:49.000000000","message":"OK, let\u0027s say more, aka set `verbose \u003d True` here.","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0631d0ea1424426c6a5c99fdd620c1583fdfe226","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_concurrency import lockutils"},{"line_number":20,"context_line":"from oslo_log import log as logging"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.agent.l3 import l3_agent_extension"},{"line_number":23,"context_line":"from neutron.agent.linux import ip_lib"},{"line_number":24,"context_line":"from neutron.agent.linux import l3_tc_lib as tc_lib"},{"line_number":25,"context_line":"from neutron.api.rpc.callbacks.consumer import registry"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_781b891a","line":22,"range":{"start_line":22,"start_character":1,"end_line":22,"end_character":47},"updated":"2017-12-16 00:11:34.000000000","message":"I suggest to use the API definition in neutron-lib: https://github.com/openstack/neutron-lib/blob/master/neutron_lib/agent/l3_extension.py","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"32d054f54e513cdd2620bac7c48eccd6afe6199b","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_concurrency import lockutils"},{"line_number":20,"context_line":"from oslo_log import log as logging"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.agent.l3 import l3_agent_extension"},{"line_number":23,"context_line":"from neutron.agent.linux import ip_lib"},{"line_number":24,"context_line":"from neutron.agent.linux import l3_tc_lib as tc_lib"},{"line_number":25,"context_line":"from neutron.api.rpc.callbacks.consumer import registry"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_1e5fc572","line":22,"range":{"start_line":22,"start_character":1,"end_line":22,"end_character":47},"in_reply_to":"df87a7cf_781b891a","updated":"2017-12-16 06:49:53.000000000","message":"Done","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0631d0ea1424426c6a5c99fdd620c1583fdfe226","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class FipQosAgentExtension("},{"line_number":129,"context_line":"        l3_agent_extension.L3AgentCoreResourceExtension):"},{"line_number":130,"context_line":"    SUPPORTED_RESOURCE_TYPES \u003d [resources.QOS_POLICY]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def initialize(self, connection, driver_type):"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_38d3c13a","line":129,"range":{"start_line":129,"start_character":9,"end_line":129,"end_character":55},"updated":"2017-12-16 00:11:34.000000000","message":"See comment to L22","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"32d054f54e513cdd2620bac7c48eccd6afe6199b","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class FipQosAgentExtension("},{"line_number":129,"context_line":"        l3_agent_extension.L3AgentCoreResourceExtension):"},{"line_number":130,"context_line":"    SUPPORTED_RESOURCE_TYPES \u003d [resources.QOS_POLICY]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def initialize(self, connection, driver_type):"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_5eca2d1a","line":129,"range":{"start_line":129,"start_character":9,"end_line":129,"end_character":55},"in_reply_to":"df87a7cf_38d3c13a","updated":"2017-12-16 06:49:53.000000000","message":"Done","commit_id":"94d5f627acabccbe3f010ca1e72471253ffa52f6"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2404d88831c9d3813eadf0a7e09e2daa3522ac7f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":3,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":4,"context_line":"#    a copy of the License at"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_24ea6ad7","line":1,"updated":"2017-12-20 01:02:39.000000000","message":"I\u0027m surprised there is no copyright year here, either with the Openstack foundation or a company name.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8c869a7ee29c0a8cc24fd5667fb68845ad8dac6f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":3,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":4,"context_line":"#    a copy of the License at"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_ef721b12","line":1,"in_reply_to":"df87a7cf_24ea6ad7","updated":"2017-12-20 02:06:28.000000000","message":"Done. I will add:\nCopyright 2017 OpenStack Foundation","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2404d88831c9d3813eadf0a7e09e2daa3522ac7f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"},{"line_number":102,"context_line":"            del self.qos_policy_fips[old_policy.id][fip]"},{"line_number":103,"context_line":"        return old_policy"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def clean_by_fip(self, fip):"},{"line_number":106,"context_line":"        \"\"\"Detach fip from policy and cleanup data we don\u0027t need anymore.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_e4a6c2c1","line":103,"updated":"2017-12-20 01:02:39.000000000","message":"Why does this return the old policy when the caller never uses it?  L260","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8c869a7ee29c0a8cc24fd5667fb68845ad8dac6f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.qos_policy_fips[policy.id][fip] \u003d fip"},{"line_number":101,"context_line":"        if old_policy and old_policy.id !\u003d policy.id:"},{"line_number":102,"context_line":"            del self.qos_policy_fips[old_policy.id][fip]"},{"line_number":103,"context_line":"        return old_policy"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def clean_by_fip(self, fip):"},{"line_number":106,"context_line":"        \"\"\"Detach fip from policy and cleanup data we don\u0027t need anymore.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_cff5d758","line":103,"in_reply_to":"df87a7cf_e4a6c2c1","updated":"2017-12-20 02:06:28.000000000","message":"Nice catch, removed next update.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2404d88831c9d3813eadf0a7e09e2daa3522ac7f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                        continue"},{"line_number":160,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":161,"context_line":"                    if not device:"},{"line_number":162,"context_line":"                        LOG.debug(\"Router %s does not have floating IP \""},{"line_number":163,"context_line":"                                  \"related device, it was possibly deleted \""},{"line_number":164,"context_line":"                                  \"concurrently.\", router_id)"},{"line_number":165,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_04740635","line":162,"range":{"start_line":162,"start_character":59,"end_line":162,"end_character":67},"updated":"2017-12-20 01:02:39.000000000","message":"s/a floating\n\nActually, looking at the called code, it\u0027s not always the case the the device was deleted, it might simply not be present or it\u0027s not the right router mode.\n\n\"Router %s does not have a floating IP related device, skipping.\"\n\nI hope this message doesn\u0027t get printed a lot on certain types of routers.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8c869a7ee29c0a8cc24fd5667fb68845ad8dac6f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                        continue"},{"line_number":160,"context_line":"                    device \u003d self._get_rate_limit_ip_device(router_info)"},{"line_number":161,"context_line":"                    if not device:"},{"line_number":162,"context_line":"                        LOG.debug(\"Router %s does not have floating IP \""},{"line_number":163,"context_line":"                                  \"related device, it was possibly deleted \""},{"line_number":164,"context_line":"                                  \"concurrently.\", router_id)"},{"line_number":165,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_ef4bfbad","line":162,"range":{"start_line":162,"start_character":59,"end_line":162,"end_character":67},"in_reply_to":"df87a7cf_04740635","updated":"2017-12-20 02:06:28.000000000","message":"Yes, router may not sent to l3 agent, but the policy get updated first, so there is no device.\nAnd, done.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"cd9d43bafaee249d7e2b367e334b67bfca1cffdf","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":202,"context_line":"            # According to the agreements from line 45 - 50, floating IP"},{"line_number":203,"context_line":"            # bandwidth was changed to default value (no limit)."},{"line_number":204,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":205,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_30741136","line":202,"range":{"start_line":202,"start_character":52,"end_line":202,"end_character":59},"updated":"2017-12-18 15:01:41.000000000","message":"nit: such comments are IMHO not necessary and can be outdated very soon. If someone else will do some changes in this file and those code will move to other lines I bet nobody will care about updating this comment and it will be confusing then :)","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3ebf14278c5439e7e4db5afcc8bc25e4fc3a009","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        tc_wrapper \u003d self._get_tc_wrapper(device)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if rate \u003d\u003d FIP_DEFAULT_RATE and burst \u003d\u003d FIP_DEFAULT_BURST:"},{"line_number":202,"context_line":"            # According to the agreements from line 45 - 50, floating IP"},{"line_number":203,"context_line":"            # bandwidth was changed to default value (no limit)."},{"line_number":204,"context_line":"            # NOTE: l3_tc_lib will ignore exception FilterIDForIPNotFound."},{"line_number":205,"context_line":"            tc_wrapper.clear_ip_rate_limit(direction, ip)"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_28ad789a","line":202,"range":{"start_line":202,"start_character":52,"end_line":202,"end_character":59},"in_reply_to":"df87a7cf_30741136","updated":"2017-12-19 02:11:31.000000000","message":"Done","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"cd9d43bafaee249d7e2b367e334b67bfca1cffdf","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        rates \u003d {}"},{"line_number":265,"context_line":"        for rule in policy.rules:"},{"line_number":266,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":267,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":268,"context_line":"                if rule.direction not in rates:"},{"line_number":269,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":270,"context_line":"                                             \"burst\": rule.max_burst_kbps}"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_90a07d92","line":267,"updated":"2017-12-18 15:01:41.000000000","message":"there can\u0027t be more than one bandwidth limit rule with same direction associated with one QoS policy. It\u0027s DB level constraint","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3ebf14278c5439e7e4db5afcc8bc25e4fc3a009","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        rates \u003d {}"},{"line_number":265,"context_line":"        for rule in policy.rules:"},{"line_number":266,"context_line":"            if rule.rule_type in SUPPORTED_RULES:"},{"line_number":267,"context_line":"                # Use the first `direction` bandwidth_limit values"},{"line_number":268,"context_line":"                if rule.direction not in rates:"},{"line_number":269,"context_line":"                    rates[rule.direction] \u003d {\"rate\": rule.max_kbps,"},{"line_number":270,"context_line":"                                             \"burst\": rule.max_burst_kbps}"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_08a8b489","line":267,"in_reply_to":"df87a7cf_90a07d92","updated":"2017-12-19 02:11:31.000000000","message":"Done","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e3ebf14278c5439e7e4db5afcc8bc25e4fc3a009","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        # The return rates dict must contain all directions. If there is no"},{"line_number":273,"context_line":"        # one specific direction qos rule, use the default values."},{"line_number":274,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":275,"context_line":"            if direction not in rates:"},{"line_number":276,"context_line":"                rates[direction] \u003d {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":277,"context_line":"                                    \"burst\": FIP_DEFAULT_BURST}"},{"line_number":278,"context_line":"        return rates"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_088194fb","line":275,"range":{"start_line":275,"start_character":12,"end_line":275,"end_character":38},"updated":"2017-12-19 02:11:31.000000000","message":"Will add a WARNING log here to notify user that the policy does not contain one specific direction bandwidth rule.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"02803ea1c576ce829edb4766ac28a1673b0d46f2","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        # The return rates dict must contain all directions. If there is no"},{"line_number":273,"context_line":"        # one specific direction qos rule, use the default values."},{"line_number":274,"context_line":"        for direction in constants.VALID_DIRECTIONS:"},{"line_number":275,"context_line":"            if direction not in rates:"},{"line_number":276,"context_line":"                rates[direction] \u003d {\"rate\": FIP_DEFAULT_RATE,"},{"line_number":277,"context_line":"                                    \"burst\": FIP_DEFAULT_BURST}"},{"line_number":278,"context_line":"        return rates"}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_8a233da7","line":275,"range":{"start_line":275,"start_character":12,"end_line":275,"end_character":38},"in_reply_to":"df87a7cf_088194fb","updated":"2017-12-20 02:22:38.000000000","message":"Eventually add a debug log here, because this function does not have fip or router info. And it\u0027s weird to add a param to one function for a log.","commit_id":"d5b82ec425ccfd027147d015706f9af90e2931b0"}],"neutron/tests/common/l3_test_common.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    if enable_floating_ip:"},{"line_number":114,"context_line":"        fip \u003d {\u0027id\u0027: _uuid(),"},{"line_number":115,"context_line":"               \u0027port_id\u0027: _uuid(),"},{"line_number":116,"context_line":"               \u0027status\u0027: \u0027DOWN\u0027,"},{"line_number":117,"context_line":"               \u0027floating_ip_address\u0027: \u002719.4.4.2\u0027,"},{"line_number":118,"context_line":"               \u0027fixed_ip_address\u0027: \u002710.0.0.1\u0027}"},{"line_number":119,"context_line":"        qos_policy_id \u003d kwargs.get(qos_consts.QOS_POLICY_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_0ff2ff70","line":116,"updated":"2017-11-25 14:54:41.000000000","message":"I think that there is constant defined somewhere for \"DOWN\" string","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    if enable_floating_ip:"},{"line_number":114,"context_line":"        fip \u003d {\u0027id\u0027: _uuid(),"},{"line_number":115,"context_line":"               \u0027port_id\u0027: _uuid(),"},{"line_number":116,"context_line":"               \u0027status\u0027: \u0027DOWN\u0027,"},{"line_number":117,"context_line":"               \u0027floating_ip_address\u0027: \u002719.4.4.2\u0027,"},{"line_number":118,"context_line":"               \u0027fixed_ip_address\u0027: \u002710.0.0.1\u0027}"},{"line_number":119,"context_line":"        qos_policy_id \u003d kwargs.get(qos_consts.QOS_POLICY_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_b53a44c9","line":116,"in_reply_to":"ff82abbf_0ff2ff70","updated":"2017-11-26 04:30:45.000000000","message":"This is a refactor.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"}],"neutron/tests/functional/agent/l3/extensions/test_fip_qos_extension.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from neutron.tests.functional.agent.l3 import framework"},{"line_number":26,"context_line":"from neutron.tests.functional.agent.l3 import test_dvr_router"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":29,"context_line":"TEST_POLICY_ID1 \u003d _uuid()"},{"line_number":30,"context_line":"TEST_POLICY_ID2 \u003d _uuid()"},{"line_number":31,"context_line":"TEST_POLICY_ID3 \u003d _uuid()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_cfb5f77f","line":28,"updated":"2017-11-25 14:54:41.000000000","message":"is this shortcut really necessary?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from neutron.tests.functional.agent.l3 import framework"},{"line_number":26,"context_line":"from neutron.tests.functional.agent.l3 import test_dvr_router"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":29,"context_line":"TEST_POLICY_ID1 \u003d _uuid()"},{"line_number":30,"context_line":"TEST_POLICY_ID2 \u003d _uuid()"},{"line_number":31,"context_line":"TEST_POLICY_ID3 \u003d _uuid()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_d554a800","line":28,"in_reply_to":"ff82abbf_cfb5f77f","updated":"2017-11-26 04:30:45.000000000","message":"Let\u0027s keep this. We used this below.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            qos_policy_id\u003dTEST_POLICY_ID3,"},{"line_number":60,"context_line":"            id\u003d_uuid(),"},{"line_number":61,"context_line":"            max_kbps\u003d777,"},{"line_number":62,"context_line":"            max_burst_kbps\u003d888,"},{"line_number":63,"context_line":"            direction\u003dconstants.EGRESS_DIRECTION)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_efba3b6c","line":62,"updated":"2017-11-25 14:54:41.000000000","message":"what about the case when e.g. only max_kbps is set? what burst will be then configured?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"d3174f678a2cbf336dae14a885cc20d0fa5b6821","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            qos_policy_id\u003dTEST_POLICY_ID3,"},{"line_number":60,"context_line":"            id\u003d_uuid(),"},{"line_number":61,"context_line":"            max_kbps\u003d777,"},{"line_number":62,"context_line":"            max_burst_kbps\u003d888,"},{"line_number":63,"context_line":"            direction\u003dconstants.EGRESS_DIRECTION)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_67205df8","line":62,"in_reply_to":"ff82abbf_3554f4fe","updated":"2017-11-28 16:21:10.000000000","message":"Unit test will cover this.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            qos_policy_id\u003dTEST_POLICY_ID3,"},{"line_number":60,"context_line":"            id\u003d_uuid(),"},{"line_number":61,"context_line":"            max_kbps\u003d777,"},{"line_number":62,"context_line":"            max_burst_kbps\u003d888,"},{"line_number":63,"context_line":"            direction\u003dconstants.EGRESS_DIRECTION)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_3554f4fe","line":62,"in_reply_to":"ff82abbf_efba3b6c","updated":"2017-11-26 04:30:45.000000000","message":"Nice, this scenario should be consider. I think function [1] needs some refactor.\n\n[1] process_ip_rate_limit https://review.openstack.org/#/c/521079/4/neutron/agent/l3/extensions/fip_qos.py@185","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b522470e80bc8693dec3db13b1dcec49d9464589","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def get_filter_id():"},{"line_number":112,"context_line":"            try:"},{"line_number":113,"context_line":"                return tc_wrapper.get_filter_id_for_ip(rule.direction, ip)"},{"line_number":114,"context_line":"            except exceptions.FilterIDForIPNotFound:"},{"line_number":115,"context_line":"                pass"},{"line_number":116,"context_line":"        common_utils.wait_until_true(get_filter_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_5abd2700","line":113,"updated":"2017-11-25 16:47:35.000000000","message":"IMHO such assertion is not enough. You are only testing if something is configured on interface, why You don\u0027t get configured values and asserts if proper values are really configured on interface?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def get_filter_id():"},{"line_number":112,"context_line":"            try:"},{"line_number":113,"context_line":"                return tc_wrapper.get_filter_id_for_ip(rule.direction, ip)"},{"line_number":114,"context_line":"            except exceptions.FilterIDForIPNotFound:"},{"line_number":115,"context_line":"                pass"},{"line_number":116,"context_line":"        common_utils.wait_until_true(get_filter_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_75303ce9","line":113,"in_reply_to":"ff82abbf_5abd2700","updated":"2017-11-26 04:30:45.000000000","message":"I think that check is redundant, l3_tc_lib can ensure that the proper value is installed. And l3_tc_lib has no such interface to get the rate and burst value. If you insist maybe I can do it here.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            try:"},{"line_number":113,"context_line":"                return tc_wrapper.get_filter_id_for_ip(rule.direction, ip)"},{"line_number":114,"context_line":"            except exceptions.FilterIDForIPNotFound:"},{"line_number":115,"context_line":"                pass"},{"line_number":116,"context_line":"        common_utils.wait_until_true(get_filter_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _assert_bandwidth_limit_rule_not_set(self, router, ip, rule,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_8fb36f98","line":115,"updated":"2017-11-25 14:54:41.000000000","message":"nit: I would personally add new line below this line","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            try:"},{"line_number":113,"context_line":"                return tc_wrapper.get_filter_id_for_ip(rule.direction, ip)"},{"line_number":114,"context_line":"            except exceptions.FilterIDForIPNotFound:"},{"line_number":115,"context_line":"                pass"},{"line_number":116,"context_line":"        common_utils.wait_until_true(get_filter_id)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _assert_bandwidth_limit_rule_not_set(self, router, ip, rule,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_154f706b","line":115,"in_reply_to":"ff82abbf_8fb36f98","updated":"2017-11-26 04:30:45.000000000","message":"Done","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"11bd3fab8cd654d32cdd540931f1c3a986acb12c","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_ha_router_fip_qos_egress(self):"},{"line_number":172,"context_line":"        self._test_centralized_routers(enable_ha\u003dTrue,"},{"line_number":173,"context_line":"                                       ingress\u003dFalse, egress\u003dTrue)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"class TestL3AgentFipQosExtensionDVR("}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_deef74e7","line":173,"updated":"2017-12-01 21:59:10.000000000","message":"IMHO all those variables like enable_ha, ingress, egress could be defined as scenarios and then You could have just one test in this class defined","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7c58ee585089a32ff6c7b923ecf99b0c3162e2f1","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_ha_router_fip_qos_egress(self):"},{"line_number":172,"context_line":"        self._test_centralized_routers(enable_ha\u003dTrue,"},{"line_number":173,"context_line":"                                       ingress\u003dFalse, egress\u003dTrue)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"class TestL3AgentFipQosExtensionDVR("}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_a3e85016","line":173,"in_reply_to":"df87a7cf_6f0d4f8f","updated":"2017-12-02 11:44:00.000000000","message":"rigth but scenarios are made for exactly that purpose so why don\u0027t use it?","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b4b8bb396375c506eaeb6b4fd7524c698a9d6838","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_ha_router_fip_qos_egress(self):"},{"line_number":172,"context_line":"        self._test_centralized_routers(enable_ha\u003dTrue,"},{"line_number":173,"context_line":"                                       ingress\u003dFalse, egress\u003dTrue)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"class TestL3AgentFipQosExtensionDVR("}],"source_content_type":"text/x-python","patch_set":7,"id":"df87a7cf_6f0d4f8f","line":173,"in_reply_to":"df87a7cf_deef74e7","updated":"2017-12-02 03:10:03.000000000","message":"All roads lead to Rome. Right？ ：）","commit_id":"d4225eb3da26567a1bd5cf1b087cca94bd006e93"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"36f4a451d5c9afea9bee15b0d18c3caf8c9ca6a9","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_ha_router_fip_qos_egress(self):"},{"line_number":172,"context_line":"        self._test_centralized_routers(enable_ha\u003dTrue,"},{"line_number":173,"context_line":"                                       ingress\u003dFalse, egress\u003dTrue)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"class TestL3AgentFipQosExtensionDVR("}],"source_content_type":"text/x-python","patch_set":8,"id":"df87a7cf_aada3ce6","line":173,"updated":"2017-12-04 21:21:07.000000000","message":"I still think that scenarios would be good to use here :)","commit_id":"347dea6ad9a38f01baada14d7b587259da4892ec"}],"neutron/tests/unit/agent/l3/extensions/test_fip_qos.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from neutron.tests import base"},{"line_number":29,"context_line":"from neutron.tests.unit.agent.l3 import test_agent"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":32,"context_line":"TEST_POLICY \u003d policy.QosPolicy(context\u003dNone,"},{"line_number":33,"context_line":"                               name\u003d\u0027test1\u0027, id\u003d_uuid())"},{"line_number":34,"context_line":"TEST_POLICY2 \u003d policy.QosPolicy(context\u003dNone,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_4fe247a2","line":31,"updated":"2017-11-25 14:54:41.000000000","message":"nit: is this shortcut necessary?","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"53e8d127e4f5870da828d06596be13da318cfe90","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from neutron.tests import base"},{"line_number":29,"context_line":"from neutron.tests.unit.agent.l3 import test_agent"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":32,"context_line":"TEST_POLICY \u003d policy.QosPolicy(context\u003dNone,"},{"line_number":33,"context_line":"                               name\u003d\u0027test1\u0027, id\u003d_uuid())"},{"line_number":34,"context_line":"TEST_POLICY2 \u003d policy.QosPolicy(context\u003dNone,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_5533b8f6","line":31,"in_reply_to":"ff82abbf_4fe247a2","updated":"2017-11-26 04:30:45.000000000","message":"yes, we use this everywhere below.","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4aa058b4873a41899207dbbfa1beb12c19941552","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        with mock.patch.object("},{"line_number":252,"context_line":"                self.fip_qos_ext.resource_rpc, \u0027pull\u0027,"},{"line_number":253,"context_line":"                return_value\u003dpolicy):"},{"line_number":254,"context_line":"            with mock.patch.object(self.fip_qos_ext, \u0027_get_tc_wrapper\u0027,"},{"line_number":255,"context_line":"                                   return_value\u003dtc_wrapper):"},{"line_number":256,"context_line":"                func(self.context, self.router_info)"},{"line_number":257,"context_line":"                if direction \u003d\u003d lib_const.INGRESS_DIRECTION:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_6fdf0bd6","line":254,"updated":"2017-11-25 14:54:41.000000000","message":"nit: You can use more than one mock.patch inside one \"with\" statement","commit_id":"eea8efe74a094f01965ba554c7c5bb30900a16c4"}]}
